Skip to content

Commit 842210f

Browse files
dhylandsdpgeorge
authored andcommitted
Add pydfu.py to the micropython tree. Use dfu_util bgy default
You can do: make USE_PYDFU=1 deploy to use pydfu.py
1 parent e7a4782 commit 842210f

2 files changed

Lines changed: 533 additions & 0 deletions

File tree

stmhal/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ USBDEV_DIR=usbdev
2424
FATFS_DIR=fatfs
2525
DFU=../tools/dfu.py
2626
# may need to prefix dfu-util with sudo
27+
USE_PYDFU ?= 0
28+
PYDFU = ../tools/pydfu.py
2729
DFU_UTIL ?= dfu-util
2830
DEVICE=0483:df11
2931

@@ -249,7 +251,11 @@ all: $(BUILD)/firmware.dfu $(BUILD)/firmware.hex
249251

250252
deploy: $(BUILD)/firmware.dfu
251253
$(ECHO) "Writing $< to the board"
254+
ifeq ($(USE_PYDFU),1)
255+
$(Q)$(PYTHON) $(PYDFU) -u $<
256+
else
252257
$(Q)$(DFU_UTIL) -a 0 -d $(DEVICE) -D $<
258+
endif
253259

254260
$(BUILD)/firmware.dfu: $(BUILD)/firmware.elf
255261
$(ECHO) "Create $@"

0 commit comments

Comments
 (0)