diff --git a/conf/Makefile.stm32 b/conf/Makefile.stm32 index ada3d31c48..818b3bd4f7 100644 --- a/conf/Makefile.stm32 +++ b/conf/Makefile.stm32 @@ -231,17 +231,26 @@ $(AOBJ) : $(OBJDIR)/%.o : %.S # check which flash mode is configured # ifeq ($(FLASH_MODE),DFU) +ifeq ($(DFU_UTIL),y) +# +# DFU flash mode using dfu-util +DFU_ADDR ?= 0x08000000 +upload: $(OBJDIR)/$(TARGET).bin + @echo "Using dfu-util at $(DFU_ADDR)" + $(Q)dfu-util -d 0483:df11 -c 1 -i 0 -a 0 -s $(DFU_ADDR) -D $^ -v +else +# +# DFU flash mode paparazzi stm32_mem ifdef DFU_ADDR DFU_ADDR_CMD = --addr=$(DFU_ADDR) endif ifdef DFU_PRODUCT DFU_PRODUCT_CMD = --product=$(DFU_PRODUCT) endif -# -# DFU flash mode upload: $(OBJDIR)/$(TARGET).bin @echo "Using stm32 mem dfu loader" $(PYTHON) $(PAPARAZZI_SRC)/sw/tools/dfu/stm32_mem.py $(DFU_PRODUCT_CMD) $(DFU_ADDR_CMD) $^ +endif # # serial flash mode diff --git a/conf/boards/apogee_0.99.makefile b/conf/boards/apogee_0.99.makefile index e100a6f701..7e9c58de1c 100644 --- a/conf/boards/apogee_0.99.makefile +++ b/conf/boards/apogee_0.99.makefile @@ -19,8 +19,9 @@ HARD_FLOAT=yes # default flash mode is via usb dfu bootloader # possibilities: DFU, SWD -FLASH_MODE ?= SWD +FLASH_MODE ?= DFU STLINK ?= y +DFU_UTIL ?= y # # default LED configuration