can flash using DFU even if sofware reset is not possible
This commit is contained in:
parent
b1a9b811ba
commit
aa30d0db52
3
Makefile
3
Makefile
|
@ -104,6 +104,7 @@ OOCD_TARGET ?= stm32f1x
|
||||||
|
|
||||||
# which USB CDC ACM port is used bu the device, so we can reset it
|
# which USB CDC ACM port is used bu the device, so we can reset it
|
||||||
ACMPORT = /dev/ttyACM0
|
ACMPORT = /dev/ttyACM0
|
||||||
|
ACMPORT_EXISTS = $(shell [ -e $(ACMPORT) ] && echo 1 || echo 0 )
|
||||||
|
|
||||||
# board specific USB DFU bootloader
|
# board specific USB DFU bootloader
|
||||||
BOOTLOADERS = STM32duino-bootloader
|
BOOTLOADERS = STM32duino-bootloader
|
||||||
|
@ -172,8 +173,10 @@ flash-swd: $(BINARY).hex
|
||||||
|
|
||||||
# reset device by setting the data width to 5 bis on the USB CDC ACM port
|
# reset device by setting the data width to 5 bis on the USB CDC ACM port
|
||||||
reset:
|
reset:
|
||||||
|
ifeq ($(ACMPORT_EXISTS), 1)
|
||||||
$(Q)stty --file $(ACMPORT) 115200 raw cs5
|
$(Q)stty --file $(ACMPORT) 115200 raw cs5
|
||||||
$(Q)sleep 0.5
|
$(Q)sleep 0.5
|
||||||
|
endif
|
||||||
|
|
||||||
flash-dfu: $(BINARY).bin reset
|
flash-dfu: $(BINARY).bin reset
|
||||||
$(info flashing $(<) using DFU)
|
$(info flashing $(<) using DFU)
|
||||||
|
|
Loading…
Reference in New Issue