diff --git a/Makefile b/Makefile index 5724d4287..2e6f0eeed 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,9 @@ OPTIONS ?= # Debugger optons, must be empty or GDB DEBUG ?= +# Serial port/Device for flashing +SERIAL_DEVICE ?= /dev/ttyUSB0 + ############################################################################### # Things that need to be maintained as the source changes # @@ -193,9 +196,9 @@ clean: rm -f $(TARGET_HEX) $(TARGET_ELF) $(TARGET_OBJS) flash_$(TARGET): $(TARGET_HEX) - stty -F /dev/ttyUSB0 raw speed 115200 -crtscts cs8 -parenb -cstopb -ixon - echo -n 'R' >/dev/ttyUSB0 - stm32flash -w $(TARGET_HEX) -v -g 0x0 -b 115200 /dev/ttyUSB0 + stty -F $(SERIAL_DEVICE) raw speed 115200 -crtscts cs8 -parenb -cstopb -ixon + echo -n 'R' >$(SERIAL_DEVICE) + stm32flash -w $(TARGET_HEX) -v -g 0x0 -b 115200 $(SERIAL_DEVICE) flash: flash_$(TARGET)