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 #506
This commit is contained in:
Andrew Scheller 2014-05-01 02:51:29 +01:00
parent dddf5bd330
commit ed9d8d6354
1 changed files with 8 additions and 0 deletions

View File

@ -13,6 +13,8 @@ USBDEV_DIR=usbdev
FATFS_DIR=fatfs
CC3K_DIR=cc3k
DFU=../tools/dfu.py
# may need to prefix dfu-util with sudo
DFU_UTIL=dfu-util
CROSS_COMPILE = arm-none-eabi-
@ -189,6 +191,12 @@ OBJ += $(BUILD)/pins_$(BOARD).o
all: $(BUILD)/flash.dfu
.PHONY: flashboard
flashboard: $(BUILD)/flash.dfu
$(ECHO) "Writing $< to the board"
$(Q)$(DFU_UTIL) -a 0 -D $<
$(BUILD)/flash.dfu: $(BUILD)/flash0.bin $(BUILD)/flash1.bin
$(ECHO) "Create $@"
$(Q)$(PYTHON) $(DFU) -b 0x08000000:$(BUILD)/flash0.bin -b 0x08020000:$(BUILD)/flash1.bin $@