Skip to content

Commit ed9d8d6

Browse files
committed
Add flashboard target to the stmhal Makefile to run dfu-util
Which allows you to run "make -C stmhal flashboard" from the top-level directory. Also ties in nicely with my configurable BUILD directory from adafruit#506
1 parent dddf5bd commit ed9d8d6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

stmhal/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ USBDEV_DIR=usbdev
1313
FATFS_DIR=fatfs
1414
CC3K_DIR=cc3k
1515
DFU=../tools/dfu.py
16+
# may need to prefix dfu-util with sudo
17+
DFU_UTIL=dfu-util
1618

1719
CROSS_COMPILE = arm-none-eabi-
1820

@@ -189,6 +191,12 @@ OBJ += $(BUILD)/pins_$(BOARD).o
189191

190192
all: $(BUILD)/flash.dfu
191193

194+
.PHONY: flashboard
195+
196+
flashboard: $(BUILD)/flash.dfu
197+
$(ECHO) "Writing $< to the board"
198+
$(Q)$(DFU_UTIL) -a 0 -D $<
199+
192200
$(BUILD)/flash.dfu: $(BUILD)/flash0.bin $(BUILD)/flash1.bin
193201
$(ECHO) "Create $@"
194202
$(Q)$(PYTHON) $(DFU) -b 0x08000000:$(BUILD)/flash0.bin -b 0x08020000:$(BUILD)/flash1.bin $@

0 commit comments

Comments
 (0)