summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-05-01 23:25:57 +0100
committerDamien George <damien.p.george@gmail.com>2014-05-01 23:25:57 +0100
commit20c23c31bec47145430ff2b902285eca141b4e7a (patch)
treed9ae807b6a5d5c1a4bc514d9f885655433bfbb44
parent28dfbc2ba2ef41a7810e4e39290031eb2207a0a9 (diff)
parented9d8d635408b3df44c18db573c540ae67753302 (diff)
downloadmicropython-20c23c31bec47145430ff2b902285eca141b4e7a.tar.gz
micropython-20c23c31bec47145430ff2b902285eca141b4e7a.zip
Merge pull request #536 from lurch/patch-1
Add flashboard target to the stmhal Makefile to run dfu-util
-rw-r--r--stmhal/Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/stmhal/Makefile b/stmhal/Makefile
index a32d9afbba..09c03d71e4 100644
--- a/stmhal/Makefile
+++ b/stmhal/Makefile
@@ -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 $@