From aa30d0db52a500123e7884044a9b21698394ffeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Fri, 29 Jan 2016 11:07:02 +0100 Subject: [PATCH] can flash using DFU even if sofware reset is not possible --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 610987b..3f3890e 100644 --- a/Makefile +++ b/Makefile @@ -104,6 +104,7 @@ OOCD_TARGET ?= stm32f1x # which USB CDC ACM port is used bu the device, so we can reset it ACMPORT = /dev/ttyACM0 +ACMPORT_EXISTS = $(shell [ -e $(ACMPORT) ] && echo 1 || echo 0 ) # board specific USB DFU 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: +ifeq ($(ACMPORT_EXISTS), 1) $(Q)stty --file $(ACMPORT) 115200 raw cs5 $(Q)sleep 0.5 +endif flash-dfu: $(BINARY).bin reset $(info flashing $(<) using DFU)