Merge pull request #289 from zvecr/more_flashers

Refactor STM32 flashers
This commit is contained in:
Ha Thach 2023-03-01 14:43:47 +07:00 committed by GitHub
commit 9d9c309554
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 14 deletions

View file

@ -170,6 +170,13 @@ flash-stlink: $(BUILD)/$(OUTNAME).elf
erase-stlink:
STM32_Programmer_CLI --connect port=swd --erase all
# st-flash must be in PATH
flash-stflash: $(BUILD)/$(OUTNAME).bin
st-flash --reset --format binary write $< 0x8000000
erase-stflash:
st-flash erase
#-------------------- Flash with pyocd --------------------
# Flash hex file using pyocd
@ -184,3 +191,12 @@ flash-pyocd-bin: $(BUILD)/$(OUTNAME).bin
erase-pyocd:
pyocd erase -t $(PYOCD_TARGET) -c
#-------------------- Flash with dfu-util -----------------
# flash using ROM bootloader
flash-dfu-util: $(BUILD)/$(OUTNAME).bin
dfu-util -R -a 0 --dfuse-address 0x08000000 -D $<
erase-dfu-util:
dfu-util -R -a 0 --dfuse-address 0x08000000:mass-erase:force

View file

@ -5,10 +5,6 @@ include ../make.mk
include port.mk
include ../rules.mk
# flash using ROM bootloader
flash-dfu-util: $(BUILD)/$(OUTNAME).bin
dfu-util -R -a 0 --dfuse-address 0x08000000 -D $<
#------------------------------------------
# Self-update
#------------------------------------------

View file

@ -5,10 +5,6 @@ include ../make.mk
include port.mk
include ../rules.mk
# flash using ROM bootloader
flash-dfu-util: $(BUILD)/$(OUTNAME).bin
dfu-util -R -a 0 --dfuse-address 0x08000000 -D $<
#------------------------------------------
# Self-update
#------------------------------------------

View file

@ -9,4 +9,4 @@ SRC_S += \
JLINK_DEVICE = stm32f401cc
flash: flash-dfu-util
erase: erase-jlink
erase: erase-dfu-util

View file

@ -9,4 +9,4 @@ SRC_S += \
JLINK_DEVICE = stm32f411ce
flash: flash-dfu-util
erase: erase-jlink
erase: erase-dfu-util

View file

@ -53,10 +53,6 @@ INC += \
include ../rules.mk
# flash target ROM bootloader
flash-dfu-util: $(BUILD)/$(OUTNAME).bin
dfu-util -R -a 0 --dfuse-address 0x08000000 -D $<
#-------------- Self-update --------------
self-update:
@echo "not implemented yet"