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)