From 1ae087376919679f6cae0e122c87f970e5cce701 Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Tue, 15 Oct 2019 14:29:51 +0200 Subject: [PATCH] boards: change PORT used for flash/debug/reset to PROG_DEV --- boards/cc2538dk/Makefile.include | 2 +- boards/common/esp32/Makefile.include | 2 +- boards/common/esp8266/Makefile.include | 2 +- boards/common/msb-430/Makefile.include | 2 +- boards/common/msba2/Makefile.include | 2 +- boards/common/remote/Makefile.include | 1 - boards/common/wsn430/Makefile.include | 2 +- boards/lobaro-lorabox/Makefile.include | 2 +- boards/opencm904/Makefile.include | 15 +++++++-------- boards/openmote-cc2538/Makefile.include | 7 +++---- boards/spark-core/Makefile.include | 2 +- boards/telosb/Makefile.include | 2 +- boards/z1/Makefile.include | 2 +- cpu/esp32/Makefile.include | 2 +- cpu/esp8266/Makefile.include | 4 ++-- makefiles/tools/bossa.inc.mk | 5 +++-- 16 files changed, 26 insertions(+), 28 deletions(-) diff --git a/boards/cc2538dk/Makefile.include b/boards/cc2538dk/Makefile.include index bacc8ea869..25d3a09264 100644 --- a/boards/cc2538dk/Makefile.include +++ b/boards/cc2538dk/Makefile.include @@ -20,7 +20,7 @@ export PROGRAMMER ?= cc2538-bsl ifeq ($(PROGRAMMER),cc2538-bsl) FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py - FFLAGS = -p "$(PORT)" -e -w -v $(FLASHFILE) + FFLAGS = -p "$(PROG_DEV)" -e -w -v $(FLASHFILE) else ifeq ($(PROGRAMMER),jlink) FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh FFLAGS = $(BINDIR) $(FLASHFILE) diff --git a/boards/common/esp32/Makefile.include b/boards/common/esp32/Makefile.include index e2f7e5725f..d830ea9a47 100644 --- a/boards/common/esp32/Makefile.include +++ b/boards/common/esp32/Makefile.include @@ -5,4 +5,4 @@ include $(RIOTMAKE)/tools/serial.inc.mk # reset tool configuration RESET ?= esptool.py -RESET_FLAGS ?= --port $(PORT) --before default_reset run +RESET_FLAGS ?= --port $(PROG_DEV) --before default_reset run diff --git a/boards/common/esp8266/Makefile.include b/boards/common/esp8266/Makefile.include index e2f7e5725f..d830ea9a47 100644 --- a/boards/common/esp8266/Makefile.include +++ b/boards/common/esp8266/Makefile.include @@ -5,4 +5,4 @@ include $(RIOTMAKE)/tools/serial.inc.mk # reset tool configuration RESET ?= esptool.py -RESET_FLAGS ?= --port $(PORT) --before default_reset run +RESET_FLAGS ?= --port $(PROG_DEV) --before default_reset run diff --git a/boards/common/msb-430/Makefile.include b/boards/common/msb-430/Makefile.include index 24db7f1355..512ba18c8c 100644 --- a/boards/common/msb-430/Makefile.include +++ b/boards/common/msb-430/Makefile.include @@ -8,7 +8,7 @@ include $(RIOTMAKE)/tools/serial.inc.mk export PROGRAMMER ?= olimex MSPDEBUGFLAGS += -j $(PROGRAMMER) ifeq ($(strip $(PROGRAMMER)),uif) - MSPDEBUGFLAGS += -d $(PORT) + MSPDEBUGFLAGS += -d $(PROG_DEV) endif FLASHER ?= mspdebug FLASHFILE ?= $(HEXFILE) diff --git a/boards/common/msba2/Makefile.include b/boards/common/msba2/Makefile.include index 7de6908d3d..505bcd840c 100644 --- a/boards/common/msba2/Makefile.include +++ b/boards/common/msba2/Makefile.include @@ -20,6 +20,6 @@ PYTERMFLAGS += -tg include $(RIOTMAKE)/tools/serial.inc.mk FLASHFILE ?= $(HEXFILE) -FFLAGS = $(PORT) $(FLASHFILE) +FFLAGS = $(PROG_DEV) $(FLASHFILE) INCLUDES += -I$(RIOTBOARD)/common/msba2/include diff --git a/boards/common/remote/Makefile.include b/boards/common/remote/Makefile.include index 681cadb020..f2d6ea1841 100644 --- a/boards/common/remote/Makefile.include +++ b/boards/common/remote/Makefile.include @@ -30,4 +30,3 @@ OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb # include common remote includes INCLUDES += -I$(RIOTBOARD)/common/remote/include - diff --git a/boards/common/wsn430/Makefile.include b/boards/common/wsn430/Makefile.include index b87e3af0ee..d31ac368ad 100644 --- a/boards/common/wsn430/Makefile.include +++ b/boards/common/wsn430/Makefile.include @@ -11,4 +11,4 @@ include $(RIOTMAKE)/tools/serial.inc.mk # configure the flash tool FLASHER = mspdebug FLASHFILE ?= $(HEXFILE) -FFLAGS = -d $(PORT) -j uif "prog $(FLASHFILE)" +FFLAGS = -d $(PROG_DEV) -j uif "prog $(FLASHFILE)" diff --git a/boards/lobaro-lorabox/Makefile.include b/boards/lobaro-lorabox/Makefile.include index 905d3d9e39..86ae07a808 100644 --- a/boards/lobaro-lorabox/Makefile.include +++ b/boards/lobaro-lorabox/Makefile.include @@ -15,6 +15,6 @@ FLASHFILE ?= $(BINFILE) # -u: use sector by sector erase # -S: swap RTS and DTR # -l 0x1ff: amount of sectors to erase -FFLAGS += -p $(PORT) -e -u -S -l 0x1ff -w $(FLASHFILE) +FFLAGS += -p $(PROG_DEV) -e -u -S -l 0x1ff -w $(FLASHFILE) PYTERMFLAGS += --set-rts 0 diff --git a/boards/opencm904/Makefile.include b/boards/opencm904/Makefile.include index f45764a0df..47ce35d5f5 100644 --- a/boards/opencm904/Makefile.include +++ b/boards/opencm904/Makefile.include @@ -1,18 +1,17 @@ +# define the default port depending on the host OS +PORT_LINUX ?= /dev/ttyACM0 +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) +# setup serial terminal +include $(RIOTMAKE)/tools/serial.inc.mk + # custom flasher to use with the bootloader FLASHER = $(RIOTBOARD)/$(BOARD)/dist/robotis-loader.py DEBUGGER = DEBUGSERVER = FLASHFILE ?= $(BINFILE) -FFLAGS = $(PORT) $(FLASHFILE) +FFLAGS = $(PROG_DEV) $(FLASHFILE) DEBUGGER_FLAGS = -# define the default port depending on the host OS -PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) - # Skip the space needed by the embedded bootloader export ROM_OFFSET ?= 0x3000 - -# setup serial terminal -include $(RIOTMAKE)/tools/serial.inc.mk diff --git a/boards/openmote-cc2538/Makefile.include b/boards/openmote-cc2538/Makefile.include index 26e9e1f1c1..81671bef69 100644 --- a/boards/openmote-cc2538/Makefile.include +++ b/boards/openmote-cc2538/Makefile.include @@ -2,6 +2,8 @@ PORT_LINUX ?= /dev/ttyUSB0 PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*))) +# setup serial terminal +include $(RIOTMAKE)/tools/serial.inc.mk # Set default flash tool export PROGRAMMER ?= cc2538-bsl @@ -15,8 +17,5 @@ ifeq ($(PROGRAMMER),jlink) else FLASHFILE ?= $(BINFILE) FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py - FFLAGS = -p "$(PORT)" -e -w -v -b 460800 $(FLASHFILE) + FFLAGS = -p "$(PROG_DEV)" -e -w -v -b 460800 $(FLASHFILE) endif - -# setup serial terminal -include $(RIOTMAKE)/tools/serial.inc.mk diff --git a/boards/spark-core/Makefile.include b/boards/spark-core/Makefile.include index 96d76b6b45..89c3d5fbf4 100644 --- a/boards/spark-core/Makefile.include +++ b/boards/spark-core/Makefile.include @@ -1,8 +1,8 @@ # configure the serial interface PORT_LINUX ?= /dev/ttyUSB0 PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) -include $(RIOTMAKE)/tools/serial.inc.mk +include $(RIOTMAKE)/tools/serial.inc.mk FLASHER = dfu-util DEBUGGER = # spark core has no debugger RESET ?= # dfu-util has no support for resetting the device diff --git a/boards/telosb/Makefile.include b/boards/telosb/Makefile.include index f0ae27c240..44af567b40 100644 --- a/boards/telosb/Makefile.include +++ b/boards/telosb/Makefile.include @@ -8,4 +8,4 @@ include $(RIOTMAKE)/tools/serial.inc.mk # flash tool configuration FLASHER = $(RIOTTOOLS)/goodfet/goodfet.bsl FLASHFILE ?= $(HEXFILE) -FFLAGS = --telosb -c $(PORT) -r -e -I -p $(FLASHFILE) +FFLAGS = --telosb -c $(PROG_DEV) -r -e -I -p $(FLASHFILE) diff --git a/boards/z1/Makefile.include b/boards/z1/Makefile.include index 59f64ef416..f38e9a5b05 100644 --- a/boards/z1/Makefile.include +++ b/boards/z1/Makefile.include @@ -7,4 +7,4 @@ include $(RIOTMAKE)/tools/serial.inc.mk # setup flash tool FLASHER = $(RIOTTOOLS)/goodfet/goodfet.bsl FLASHFILE ?= $(HEXFILE) -FFLAGS = --z1 -I -c $(PORT) -r -e -p $(FLASHFILE) +FFLAGS = --z1 -I -c $(PROG_DEV) -r -e -p $(FLASHFILE) diff --git a/cpu/esp32/Makefile.include b/cpu/esp32/Makefile.include index 90cd21dc18..230d586f54 100644 --- a/cpu/esp32/Makefile.include +++ b/cpu/esp32/Makefile.include @@ -196,7 +196,7 @@ ifeq ($(QEMU), 1) else export PROGRAMMER_SPEED ?= 460800 FLASHER = $(ESPTOOL) - FFLAGS += --chip esp32 -p $(PORT) -b $(PROGRAMMER_SPEED) + FFLAGS += --chip esp32 -p $(PROG_DEV) -b $(PROGRAMMER_SPEED) FFLAGS += --before default_reset --after hard_reset write_flash FFLAGS += -z -fm $(FLASH_MODE) -fs detect -ff $(FLASH_FREQ) FFLAGS += 0x1000 $(RIOTCPU)/$(CPU)/bin/bootloader.bin diff --git a/cpu/esp8266/Makefile.include b/cpu/esp8266/Makefile.include index 6415d899a4..f488ed2f61 100644 --- a/cpu/esp8266/Makefile.include +++ b/cpu/esp8266/Makefile.include @@ -156,10 +156,10 @@ else FLASH_MODE ?= dout export PROGRAMMER_SPEED ?= 460800 FLASHER = esptool.py - FFLAGS += -p $(PORT) -b $(PROGRAMMER_SPEED) write_flash + FFLAGS += -p $(PROG_DEV) -b $(PROGRAMMER_SPEED) write_flash FFLAGS += -fm $(FLASH_MODE) FFLAGS += 0 $(FLASHFILE)-0x00000.bin - FFLAGS += 0x10000 $(FLASHFILE)-0x10000.bin; esptool.py -p $(PORT) run + FFLAGS += 0x10000 $(FLASHFILE)-0x10000.bin; esptool.py -p $(PROG_DEV) run endif OPTIONAL_CFLAGS_BLACKLIST += -fdiagnostics-color diff --git a/makefiles/tools/bossa.inc.mk b/makefiles/tools/bossa.inc.mk index 5297f0ff18..67863741e9 100644 --- a/makefiles/tools/bossa.inc.mk +++ b/makefiles/tools/bossa.inc.mk @@ -1,6 +1,6 @@ FLASHFILE ?= $(BINFILE) FLASHER ?= $(RIOTTOOLS)/bossa/bossac -FFLAGS ?= -p $(PORT) -e -i -w -v -b -R $(FLASHFILE) +FFLAGS ?= -p $(PROG_DEV) -e -i -w -v -b -R $(FLASHFILE) # some arduino boards need to toggle the serial interface a little bit to get # them ready for flashing... @@ -12,8 +12,9 @@ ifneq (,$(BOSSA_ARDUINO_PREFLASH)) endif PREFLASHER ?= stty - PREFFLAGS ?= $(STTY_FLAG) $(PORT) raw ispeed 1200 ospeed 1200 cs8 -cstopb ignpar eol 255 eof 255 + PREFFLAGS ?= $(STTY_FLAG) $(PROG_DEV) raw ispeed 1200 ospeed 1200 cs8 -cstopb ignpar eol 255 eof 255 FLASHDEPS += preflash + endif # if we go with the default (BOSSA shipped with RIOT), we download and build