diff --git a/boards/calliope-mini/Makefile.include b/boards/calliope-mini/Makefile.include index 35575ba53e..a7deba75d0 100644 --- a/boards/calliope-mini/Makefile.include +++ b/boards/calliope-mini/Makefile.include @@ -10,12 +10,12 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) PROGRAMMER ?= fscopy ifeq (fscopy,$(PROGRAMMER)) - export FFLAGS = $(HEXFILE) - export DEBUGGER_FLAGS = + FFLAGS = $(HEXFILE) + DEBUGGER_FLAGS = - export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh - export DEBUGGER = - export DEBUGSERVER = + FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh + DEBUGGER = + DEBUGSERVER = else ifeq (openocd,$(PROGRAMMER)) DEBUG_ADAPTER = dap else ifeq (pyocd,$(PROGRAMMER)) diff --git a/boards/cc2538dk/Makefile.include b/boards/cc2538dk/Makefile.include index 58e495ad87..91b36cbcc5 100644 --- a/boards/cc2538dk/Makefile.include +++ b/boards/cc2538dk/Makefile.include @@ -15,24 +15,24 @@ include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/renode.inc.mk # debugger config -export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh -export DEBUGSERVER = JLinkGDBServer -device CC2538SF53 -export RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh +DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh +DEBUGSERVER = JLinkGDBServer -device CC2538SF53 +RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh # Define the flash-tool and default port: export PROGRAMMER ?= cc2538-bsl ifeq ($(PROGRAMMER),cc2538-bsl) - export FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py - export FFLAGS = -p "$(PORT)" -e -w -v $(FLASHFILE) + FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py + FFLAGS = -p "$(PORT)" -e -w -v $(FLASHFILE) else ifeq ($(PROGRAMMER),jlink) - export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh - export FFLAGS = $(BINDIR) $(FLASHFILE) + FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh + FFLAGS = $(BINDIR) $(FLASHFILE) endif OFLAGS = --gap-fill 0xff FLASHFILE ?= $(BINFILE) -export DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE) -export RESET_FLAGS = $(BINDIR) +DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE) +RESET_FLAGS = $(BINDIR) export OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb diff --git a/boards/chronos/Makefile.include b/boards/chronos/Makefile.include index 12321d761c..c13f7c5b8f 100644 --- a/boards/chronos/Makefile.include +++ b/boards/chronos/Makefile.include @@ -3,8 +3,8 @@ export CPU = cc430 export CPU_MODEL = cc430f6137 # flasher configuration -export FLASHER = mspdebug -export FFLAGS = rf2500 "prog $(HEXFILE)" +FLASHER = mspdebug +FFLAGS = rf2500 "prog $(HEXFILE)" INCLUDES += -I$(RIOTBOARD)/$(BOARD)/drivers/include diff --git a/boards/common/esp32/Makefile.include b/boards/common/esp32/Makefile.include index 2ce4a3dbea..0fb3fb3c25 100644 --- a/boards/common/esp32/Makefile.include +++ b/boards/common/esp32/Makefile.include @@ -8,4 +8,4 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) include $(RIOTMAKE)/tools/serial.inc.mk # reset tool configuration -export RESET = esptool.py --before default_reset run +RESET = esptool.py --before default_reset run diff --git a/boards/common/esp8266/Makefile.include b/boards/common/esp8266/Makefile.include index 5460a7fd32..4c60974b9a 100644 --- a/boards/common/esp8266/Makefile.include +++ b/boards/common/esp8266/Makefile.include @@ -8,4 +8,4 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) include $(RIOTMAKE)/tools/serial.inc.mk # reset tool configuration -export RESET = esptool.py --before default_reset run +RESET = esptool.py --before default_reset run diff --git a/boards/common/msb-430/Makefile.include b/boards/common/msb-430/Makefile.include index 5c054c4c66..58be9005a8 100644 --- a/boards/common/msb-430/Makefile.include +++ b/boards/common/msb-430/Makefile.include @@ -10,18 +10,18 @@ include $(RIOTMAKE)/tools/serial.inc.mk # setup flash tool export PROGRAMMER ?= olimex -export MSPDEBUGFLAGS += -j $(PROGRAMMER) +MSPDEBUGFLAGS += -j $(PROGRAMMER) ifeq ($(strip $(PROGRAMMER)),uif) - export MSPDEBUGFLAGS += -d $(PORT) + MSPDEBUGFLAGS += -d $(PORT) endif -export FLASHER ?= mspdebug -export FFLAGS = $(MSPDEBUGFLAGS) "prog $(HEXFILE)" +FLASHER ?= mspdebug +FFLAGS = $(MSPDEBUGFLAGS) "prog $(HEXFILE)" # setup debugger -export DEBUGSERVER = $(FLASHER) -export DEBUGSERVER_FLAGS = $(MSPDEBUGFLAGS) gdb -export DEBUGGER = $(PREFIX)gdb -export DEBUGGER_FLAGS = --tui --ex="target remote localhost:2000" --ex "monitor reset halt" --ex load -ex "monitor reset halt" $(ELFFILE) +DEBUGSERVER = $(FLASHER) +DEBUGSERVER_FLAGS = $(MSPDEBUGFLAGS) gdb +DEBUGGER = $(PREFIX)gdb +DEBUGGER_FLAGS = --tui --ex="target remote localhost:2000" --ex "monitor reset halt" --ex load -ex "monitor reset halt" $(ELFFILE) # export common msb-430 includes export INCLUDES += -I$(RIOTBOARD)/common/msb-430/include diff --git a/boards/common/remote/Makefile.include b/boards/common/remote/Makefile.include index aeccff4ca8..baa8250b4c 100644 --- a/boards/common/remote/Makefile.include +++ b/boards/common/remote/Makefile.include @@ -12,21 +12,21 @@ ifeq ($(PROGRAMMER),cc2538-bsl) else ifeq ($(OS),Darwin) PORT_BSL ?= $(PORT_DARWIN) endif - export RESET = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py -p "$(PORT_BSL)" - export FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py - export FFLAGS = -p "$(PORT_BSL)" -e -w -v -b 115200 $(FLASHFILE) + RESET = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py -p "$(PORT_BSL)" + FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py + FFLAGS = -p "$(PORT_BSL)" -e -w -v -b 115200 $(FLASHFILE) else ifeq ($(PROGRAMMER),jlink) - export FLASHER = $(RIOTBOARD)/common/remote/dist/flash.sh - export FFLAGS = $(BINDIR) $(FLASHFILE) - export DEBUGGER = $(RIOTBOARD)/common/remote/dist/debug.sh - export DEBUGSERVER = JLinkGDBServer -device CC2538SF53 - export RESET = $(RIOTBOARD)/common/remote/dist/reset.sh - export RESET_FLAGS = $(BINDIR) + FLASHER = $(RIOTBOARD)/common/remote/dist/flash.sh + FFLAGS = $(BINDIR) $(FLASHFILE) + DEBUGGER = $(RIOTBOARD)/common/remote/dist/debug.sh + DEBUGSERVER = JLinkGDBServer -device CC2538SF53 + RESET = $(RIOTBOARD)/common/remote/dist/reset.sh + RESET_FLAGS = $(BINDIR) endif OFLAGS = --gap-fill 0xff FLASHFILE ?= $(BINFILE) -export DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE) +DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE) export OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb # include common remote includes diff --git a/boards/common/stm32f103c8/Makefile.include b/boards/common/stm32f103c8/Makefile.include index 40997dc0ce..120700b236 100644 --- a/boards/common/stm32f103c8/Makefile.include +++ b/boards/common/stm32f103c8/Makefile.include @@ -23,14 +23,14 @@ include $(RIOTMAKE)/tools/serial.inc.mk # (ground) GPIO B1. ifeq ($(PROGRAMMER),dfu-util) export ROM_OFFSET ?= 0x2000 # Skip the space needed by the embedded bootloader - export FLASHER = dfu-util - export DEBUGGER = # no debugger - export RESET = # dfu-util has no support for resetting the device + FLASHER = dfu-util + DEBUGGER = # no debugger + RESET = # dfu-util has no support for resetting the device HEXFILE = $(BINFILE) - export FFLAGS = -d 1eaf:0003 -a 2 -D "$(HEXFILE)" + FFLAGS = -d 1eaf:0003 -a 2 -D "$(HEXFILE)" # for older bootloader versions use this: - #export FFLAGS = -d 1d50:6017 -s 0x08002000:leave -D "$(HEXFILE)" + # FFLAGS = -d 1d50:6017 -s 0x08002000:leave -D "$(HEXFILE)" else # this board uses openocd by default diff --git a/boards/common/wsn430/Makefile.include b/boards/common/wsn430/Makefile.include index 8987fe0958..9853cc8cf0 100644 --- a/boards/common/wsn430/Makefile.include +++ b/boards/common/wsn430/Makefile.include @@ -13,8 +13,8 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) include $(RIOTMAKE)/tools/serial.inc.mk # configure the flash tool -export FLASHER = mspdebug -export FFLAGS = -d $(PORT) -j uif "prog $(HEXFILE)" +FLASHER = mspdebug +FFLAGS = -d $(PORT) -j uif "prog $(HEXFILE)" # Use the HEXFILE when using iot-lab.single.inc.mk IOTLAB_FLASHFILE = $(HEXFILE) diff --git a/boards/f4vi1/Makefile.include b/boards/f4vi1/Makefile.include index 4ac58f2318..8ac44da078 100644 --- a/boards/f4vi1/Makefile.include +++ b/boards/f4vi1/Makefile.include @@ -13,11 +13,11 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) include $(RIOTMAKE)/tools/serial.inc.mk # st-flash -export FLASHER = st-flash -export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh -export DEBUGSERVER = st-util +FLASHER = st-flash +DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh +DEBUGSERVER = st-util # define st-flash parameters HEXFILE = $(BINFILE) -export FFLAGS = write $(HEXFILE) 0x8000000 -export DEBUGGER_FLAGS = $(RIOTBOARD)/$(BOARD)/dist/gdb.conf $(ELFFILE) +FFLAGS = write $(HEXFILE) 0x8000000 +DEBUGGER_FLAGS = $(RIOTBOARD)/$(BOARD)/dist/gdb.conf $(ELFFILE) diff --git a/boards/hifive1/Makefile.include b/boards/hifive1/Makefile.include index a3abd6fe0d..258cc562e9 100644 --- a/boards/hifive1/Makefile.include +++ b/boards/hifive1/Makefile.include @@ -17,4 +17,4 @@ export OPENOCD_CMD_RESET_RUN=-c _reset include $(RIOTMAKE)/tools/openocd.inc.mk # use our own openocd script to flash since HiFive1 has reset problems. -export FLASHER = $(RIOTBASE)/boards/hifive1/dist/flasher.sh +FLASHER = $(RIOTBASE)/boards/hifive1/dist/flasher.sh diff --git a/boards/mbed_lpc1768/Makefile.include b/boards/mbed_lpc1768/Makefile.include index e5511e48d7..41c33bcd87 100644 --- a/boards/mbed_lpc1768/Makefile.include +++ b/boards/mbed_lpc1768/Makefile.include @@ -1,13 +1,13 @@ # define the cpu used by the mbed_lpx1768 board export CPU = lpc1768 -export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh -export DEBUGGER = -export DEBUGSERVER = +FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh +DEBUGGER = +DEBUGSERVER = HEXFILE = $(BINFILE) -export FFLAGS = $(HEXFILE) -export DEBUGGER_FLAGS = +FFLAGS = $(HEXFILE) +DEBUGGER_FLAGS = # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyACM0 diff --git a/boards/microbit/Makefile.include b/boards/microbit/Makefile.include index 3436b5f801..496edb3d1b 100644 --- a/boards/microbit/Makefile.include +++ b/boards/microbit/Makefile.include @@ -10,12 +10,12 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) PROGRAMMER ?= fscopy ifeq (fscopy,$(PROGRAMMER)) - export FFLAGS = $(HEXFILE) - export DEBUGGER_FLAGS = + FFLAGS = $(HEXFILE) + DEBUGGER_FLAGS = - export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh - export DEBUGGER = - export DEBUGSERVER = + FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh + DEBUGGER = + DEBUGSERVER = else ifeq (openocd,$(PROGRAMMER)) # this board uses a daplink adapter by default DEBUG_ADAPTER = dap diff --git a/boards/native/Makefile.include b/boards/native/Makefile.include index 91b4c84b1f..9ee94c3eb3 100644 --- a/boards/native/Makefile.include +++ b/boards/native/Makefile.include @@ -35,13 +35,13 @@ else endif ifeq ($(shell uname -s),Darwin) - export DEBUGGER ?= lldb + DEBUGGER ?= lldb else - export DEBUGGER ?= gdb + DEBUGGER ?= gdb endif TERMPROG ?= $(ELFFILE) -export FLASHER = true +FLASHER = true export VALGRIND ?= valgrind export CGANNOTATE ?= cg_annotate export GPROF ?= gprof @@ -104,9 +104,9 @@ TERMFLAGS := $(PORT) $(TERMFLAGS) export ASFLAGS = ifeq ($(shell basename $(DEBUGGER)),lldb) - export DEBUGGER_FLAGS = -- $(ELFFILE) $(TERMFLAGS) + DEBUGGER_FLAGS = -- $(ELFFILE) $(TERMFLAGS) else - export DEBUGGER_FLAGS = -q --args $(ELFFILE) $(TERMFLAGS) + DEBUGGER_FLAGS = -q --args $(ELFFILE) $(TERMFLAGS) endif term-valgrind: export VALGRIND_FLAGS ?= \ --leak-check=full \ diff --git a/boards/nz32-sc151/Makefile.include b/boards/nz32-sc151/Makefile.include index ad09aecc57..2e780acaee 100644 --- a/boards/nz32-sc151/Makefile.include +++ b/boards/nz32-sc151/Makefile.include @@ -9,12 +9,12 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # set the default id export ID ?= 0483:df11 -export FLASHER = dfu-util -export DEBUGGER = # dfu-util has no debugger -export RESET = # dfu-util has no support for resetting the device +FLASHER = dfu-util +DEBUGGER = # dfu-util has no debugger +RESET = # dfu-util has no support for resetting the device HEXFILE = $(BINFILE) -export FFLAGS = -d $(ID) -a 0 -s 0x08000000:leave -D "$(HEXFILE)" +FFLAGS = -d $(ID) -a 0 -s 0x08000000:leave -D "$(HEXFILE)" # setup serial terminal include $(RIOTMAKE)/tools/serial.inc.mk diff --git a/boards/opencm904/Makefile.include b/boards/opencm904/Makefile.include index 8ce69924a1..3f04b4aec5 100644 --- a/boards/opencm904/Makefile.include +++ b/boards/opencm904/Makefile.include @@ -3,13 +3,13 @@ export CPU = stm32f1 export CPU_MODEL = stm32f103cb # custom flasher to use with the bootloader -export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/robotis-loader.py -export DEBUGGER = -export DEBUGSERVER = +FLASHER = $(RIOTBOARD)/$(BOARD)/dist/robotis-loader.py +DEBUGGER = +DEBUGSERVER = HEXFILE = $(BINFILE) -export FFLAGS = $(PORT) $(HEXFILE) -export DEBUGGER_FLAGS = +FFLAGS = $(PORT) $(HEXFILE) +DEBUGGER_FLAGS = # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyACM0 diff --git a/boards/openmote-b/Makefile.include b/boards/openmote-b/Makefile.include index 43124605aa..49978e45ce 100644 --- a/boards/openmote-b/Makefile.include +++ b/boards/openmote-b/Makefile.include @@ -16,19 +16,19 @@ ifeq ($(PROGRAMMER),cc2538-bsl) else ifeq ($(OS),Darwin) PORT_BSL ?= $(PORT_DARWIN) endif - export FLASHER = $(RIOTBASE)/dist/tools/cc2538-bsl/cc2538-bsl.py - export FFLAGS = -p "$(PORT_BSL)" --bootloader-invert-lines -e -w -v -b 460800 $(FLASHFILE) + FLASHER = $(RIOTBASE)/dist/tools/cc2538-bsl/cc2538-bsl.py + FFLAGS = -p "$(PORT_BSL)" --bootloader-invert-lines -e -w -v -b 460800 $(FLASHFILE) else ifeq ($(PROGRAMMER),jlink) - export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh - export FFLAGS = $(BINDIR) $(FLASHFILE) - export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh - export DEBUGSERVER = JLinkGDBServer -device CC2538SF53 - export RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh + FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh + FFLAGS = $(BINDIR) $(FLASHFILE) + DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh + DEBUGSERVER = JLinkGDBServer -device CC2538SF53 + RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh endif FLASHFILE ?= $(BINFILE) -export DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE) -export RESET_FLAGS = $(BINDIR) +DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE) +RESET_FLAGS = $(BINDIR) export OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb # setup serial terminal diff --git a/boards/openmote-cc2538/Makefile.include b/boards/openmote-cc2538/Makefile.include index 5c7c30b6f0..d77f06b787 100644 --- a/boards/openmote-cc2538/Makefile.include +++ b/boards/openmote-cc2538/Makefile.include @@ -18,8 +18,8 @@ ifeq ($(PROGRAMMER),jlink) include $(RIOTMAKE)/tools/jlink.inc.mk else FLASHFILE ?= $(BINFILE) - export FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py - export FFLAGS = -p "$(PORT)" -e -w -v -b 460800 $(FLASHFILE) + FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py + FFLAGS = -p "$(PORT)" -e -w -v -b 460800 $(FLASHFILE) endif # setup serial terminal diff --git a/boards/spark-core/Makefile.include b/boards/spark-core/Makefile.include index cd71cdea80..6203e36a80 100644 --- a/boards/spark-core/Makefile.include +++ b/boards/spark-core/Makefile.include @@ -7,12 +7,12 @@ PORT_LINUX ?= /dev/ttyUSB0 PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) include $(RIOTMAKE)/tools/serial.inc.mk -export FLASHER = dfu-util -export DEBUGGER = # spark core has no debugger -export RESET = # dfu-util has no support for resetting the device +FLASHER = dfu-util +DEBUGGER = # spark core has no debugger +RESET = # dfu-util has no support for resetting the device HEXFILE = $(BINFILE) -export FFLAGS = -d 1d50:607f -a 0 -s 0x08005000:leave -D "$(HEXFILE)" +FFLAGS = -d 1d50:607f -a 0 -s 0x08005000:leave -D "$(HEXFILE)" # Skip the space needed by the embedded bootloader export ROM_OFFSET ?= 0x5000 diff --git a/boards/telosb/Makefile.include b/boards/telosb/Makefile.include index 1133e7fd73..f3a088913f 100644 --- a/boards/telosb/Makefile.include +++ b/boards/telosb/Makefile.include @@ -10,5 +10,5 @@ export BAUD ?= 9600 include $(RIOTMAKE)/tools/serial.inc.mk # flash tool configuration -export FLASHER = $(RIOTTOOLS)/goodfet/goodfet.bsl -export FFLAGS = --telosb -c $(PORT) -r -e -I -p $(HEXFILE) +FLASHER = $(RIOTTOOLS)/goodfet/goodfet.bsl +FFLAGS = --telosb -c $(PORT) -r -e -I -p $(HEXFILE) diff --git a/boards/z1/Makefile.include b/boards/z1/Makefile.include index 2f64e0af73..7d99332157 100644 --- a/boards/z1/Makefile.include +++ b/boards/z1/Makefile.include @@ -9,5 +9,5 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) include $(RIOTMAKE)/tools/serial.inc.mk # setup flash tool -export FLASHER = $(RIOTTOOLS)/goodfet/goodfet.bsl -export FFLAGS = --z1 -I -c $(PORT) -r -e -p $(HEXFILE) +FLASHER = $(RIOTTOOLS)/goodfet/goodfet.bsl +FFLAGS = --z1 -I -c $(PORT) -r -e -p $(HEXFILE) diff --git a/cpu/esp32/Makefile.include b/cpu/esp32/Makefile.include index 79beae95be..2194541f16 100644 --- a/cpu/esp32/Makefile.include +++ b/cpu/esp32/Makefile.include @@ -145,40 +145,40 @@ LINKFLAGS += -Wl,--warn-unresolved-symbols FLASH_MODE ?= dout # FIX configuration, DO NOT CHANGE FLASH_FREQ = 40m # FIX configuration, DO NOT CHANGE FLASH_SIZE ?= 2MB -export PREFLASHER = $(ESPTOOL) -export PREFFLAGS = --chip esp32 elf2image -export PREFFLAGS += -fm $(FLASH_MODE) -fs $(FLASH_SIZE) -ff $(FLASH_FREQ) -export PREFFLAGS += -o $(ELFFILE).bin $(ELFFILE); -export PREFFLAGS += echo "" > $(BINDIR)/partitions.csv; -export PREFFLAGS += echo "nvs, data, nvs, 0x9000, 0x6000" >> $(BINDIR)/partitions.csv; -export PREFFLAGS += echo "phy_init, data, phy, 0xf000, 0x1000" >> $(BINDIR)/partitions.csv; -export PREFFLAGS += echo -n "factory, app, factory, 0x10000, " >> $(BINDIR)/partitions.csv; -export PREFFLAGS += ls -l $(ELFFILE).bin | awk '{ print $$5 }' >> $(BINDIR)/partitions.csv; +PREFLASHER = $(ESPTOOL) +PREFFLAGS = --chip esp32 elf2image +PREFFLAGS += -fm $(FLASH_MODE) -fs $(FLASH_SIZE) -ff $(FLASH_FREQ) +PREFFLAGS += -o $(ELFFILE).bin $(ELFFILE); +PREFFLAGS += echo "" > $(BINDIR)/partitions.csv; +PREFFLAGS += echo "nvs, data, nvs, 0x9000, 0x6000" >> $(BINDIR)/partitions.csv; +PREFFLAGS += echo "phy_init, data, phy, 0xf000, 0x1000" >> $(BINDIR)/partitions.csv; +PREFFLAGS += echo -n "factory, app, factory, 0x10000, " >> $(BINDIR)/partitions.csv; +PREFFLAGS += ls -l $(ELFFILE).bin | awk '{ print $$5 }' >> $(BINDIR)/partitions.csv; -export PREFFLAGS += python $(RIOTCPU)/$(CPU)/gen_esp32part.py --disable-sha256sum -export PREFFLAGS += --verify $(BINDIR)/partitions.csv $(BINDIR)/partitions.bin -export FLASHDEPS = preflash +PREFFLAGS += python $(RIOTCPU)/$(CPU)/gen_esp32part.py --disable-sha256sum +PREFFLAGS += --verify $(BINDIR)/partitions.csv $(BINDIR)/partitions.bin +FLASHDEPS = preflash # flasher configuration ifeq ($(QEMU), 1) - export FLASHER = dd - export FFLAGS += if=/dev/zero bs=1M count=4 | tr "\\000" "\\377" > tmp.bin && cat tmp.bin | - export FFLAGS += head -c $$((0x1000)) | - export FFLAGS += cat - $(RIOTCPU)/$(CPU)/bin/bootloader.bin tmp.bin | - export FFLAGS += head -c $$((0x8000)) | - export FFLAGS += cat - $(BINDIR)/partitions.bin tmp.bin | - export FFLAGS += head -c $$((0x10000)) | - export FFLAGS += cat - $(ELFFILE).bin tmp.bin | - export FFLAGS += head -c $$((0x400000)) > $(BINDIR)/esp32flash.bin && rm tmp.bin && - export FFLAGS += cp $(RIOTCPU)/$(CPU)/bin/rom_0x3ff90000_0x00010000.bin $(BINDIR)/rom1.bin && - export FFLAGS += cp $(RIOTCPU)/$(CPU)/bin/rom_0x40000000_0x000c2000.bin $(BINDIR)/rom.bin + FLASHER = dd + FFLAGS += if=/dev/zero bs=1M count=4 | tr "\\000" "\\377" > tmp.bin && cat tmp.bin | + FFLAGS += head -c $$((0x1000)) | + FFLAGS += cat - $(RIOTCPU)/$(CPU)/bin/bootloader.bin tmp.bin | + FFLAGS += head -c $$((0x8000)) | + FFLAGS += cat - $(BINDIR)/partitions.bin tmp.bin | + FFLAGS += head -c $$((0x10000)) | + FFLAGS += cat - $(ELFFILE).bin tmp.bin | + FFLAGS += head -c $$((0x400000)) > $(BINDIR)/esp32flash.bin && rm tmp.bin && + FFLAGS += cp $(RIOTCPU)/$(CPU)/bin/rom_0x3ff90000_0x00010000.bin $(BINDIR)/rom1.bin && + FFLAGS += cp $(RIOTCPU)/$(CPU)/bin/rom_0x40000000_0x000c2000.bin $(BINDIR)/rom.bin else export PROGRAMMER_SPEED ?= 460800 - export FLASHER = $(ESPTOOL) - export FFLAGS += --chip esp32 -p $(PORT) -b $(PROGRAMMER_SPEED) - export FFLAGS += --before default_reset --after hard_reset write_flash - export FFLAGS += -z -fm $(FLASH_MODE) -fs detect -ff $(FLASH_FREQ) - export FFLAGS += 0x1000 $(RIOTCPU)/$(CPU)/bin/bootloader.bin - export FFLAGS += 0x8000 $(BINDIR)/partitions.bin - export FFLAGS += 0x10000 $(ELFFILE).bin + FLASHER = $(ESPTOOL) + FFLAGS += --chip esp32 -p $(PORT) -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 + FFLAGS += 0x8000 $(BINDIR)/partitions.bin + FFLAGS += 0x10000 $(ELFFILE).bin endif diff --git a/cpu/esp8266/Makefile.include b/cpu/esp8266/Makefile.include index e90a4eb6b5..01d2885d2c 100644 --- a/cpu/esp8266/Makefile.include +++ b/cpu/esp8266/Makefile.include @@ -131,22 +131,22 @@ LINKFLAGS += -Wl,--warn-unresolved-symbols # configure preflasher to convert .elf to .bin before flashing FLASH_SIZE = -fs 8m -export PREFLASHER ?= esptool.py -export PREFFLAGS ?= elf2image $(FLASH_SIZE) $(ELFFILE) -export FLASHDEPS ?= preflash +PREFLASHER ?= esptool.py +PREFFLAGS ?= elf2image $(FLASH_SIZE) $(ELFFILE) +FLASHDEPS ?= preflash # flasher configuration ifeq ($(QEMU), 1) - export FLASHER = cat - export FFLAGS += $(ELFFILE)-0x00000.bin /dev/zero | head -c $$((0x10000)) | cat - - export FFLAGS += $(ELFFILE)-0x10000.bin /dev/zero | head -c $$((0xfc000)) | cat - - export FFLAGS += $(RIOTCPU)/$(CPU)/bin/esp_init_data_default.bin > $(ELFFILE).bin + FLASHER = cat + FFLAGS += $(ELFFILE)-0x00000.bin /dev/zero | head -c $$((0x10000)) | cat - + FFLAGS += $(ELFFILE)-0x10000.bin /dev/zero | head -c $$((0xfc000)) | cat - + FFLAGS += $(RIOTCPU)/$(CPU)/bin/esp_init_data_default.bin > $(ELFFILE).bin else FLASH_MODE ?= dout export PROGRAMMER_SPEED ?= 460800 - export FLASHER = esptool.py - export FFLAGS += -p $(PORT) -b $(PROGRAMMER_SPEED) write_flash - export FFLAGS += -fm $(FLASH_MODE) - export FFLAGS += 0 $(ELFFILE)-0x00000.bin - export FFLAGS += 0x10000 $(ELFFILE)-0x10000.bin; esptool.py -p $(PORT) run + FLASHER = esptool.py + FFLAGS += -p $(PORT) -b $(PROGRAMMER_SPEED) write_flash + FFLAGS += -fm $(FLASH_MODE) + FFLAGS += 0 $(ELFFILE)-0x00000.bin + FFLAGS += 0x10000 $(ELFFILE)-0x10000.bin; esptool.py -p $(PORT) run endif diff --git a/dist/tools/buildsystem_sanity_check/check.sh b/dist/tools/buildsystem_sanity_check/check.sh index 52f6c85fad..7704287551 100755 --- a/dist/tools/buildsystem_sanity_check/check.sh +++ b/dist/tools/buildsystem_sanity_check/check.sh @@ -50,6 +50,13 @@ check_not_parsing_features() { UNEXPORTED_VARIABLES=() UNEXPORTED_VARIABLES+=('FLASHFILE') UNEXPORTED_VARIABLES+=('TERMPROG' 'TERMFLAGS') +UNEXPORTED_VARIABLES+=('FLASHER' 'FFLAGS') +UNEXPORTED_VARIABLES+=('RESET' 'RESETFLAGS') +UNEXPORTED_VARIABLES+=('DEBUGGER' 'DEBUGGER_FLAGS') +UNEXPORTED_VARIABLES+=('DEBUGSERVER' 'DEBUGSERVER_FLAGS') +UNEXPORTED_VARIABLES+=('PREFLASHER' 'PREFFLAGS' 'FLASHDEPS') + +EXPORTED_VARIABLES_ONLY_IN_VARS=() check_not_exporting_variables() { local patterns=() local pathspec=() @@ -58,13 +65,22 @@ check_not_exporting_variables() { patterns+=(-e "export[[:blank:]]\+${variable}") done - pathspec+=('*') + git -C "${RIOTBASE}" grep "${patterns[@]}" - # Ignore `makefiles/vars.inc.mk` as it currently is the only place that - # should export common variables. + # Some variables may still be exported in 'makefiles/vars.inc.mk' as the + # only place that should export commont variables + pathspec+=('*') pathspec+=(':!makefiles/vars.inc.mk') - git -C "${RIOTBASE}" grep "${patterns[@]}" -- "${pathspec[@]}" + patterns=() + for variable in "${EXPORTED_VARIABLES_ONLY_IN_VARS[@]}"; do + patterns+=(-e "export[[:blank:]]\+${variable}") + done + + # Only run if there are patterns, otherwise it matches everything + if [ ${#patterns[@]} -ne 0 ]; then + git -C "${RIOTBASE}" grep "${patterns[@]}" -- "${pathspec[@]}" + fi } diff --git a/makefiles/tools/bossa.inc.mk b/makefiles/tools/bossa.inc.mk index b98eee54da..b755a9053a 100644 --- a/makefiles/tools/bossa.inc.mk +++ b/makefiles/tools/bossa.inc.mk @@ -1,5 +1,5 @@ -export FLASHER ?= $(RIOTTOOLS)/bossa/bossac -export FFLAGS ?= -p $(PORT) -e -i -w -v -b -R $(HEXFILE) +FLASHER ?= $(RIOTTOOLS)/bossa/bossac +FFLAGS ?= -p $(PORT) -e -i -w -v -b -R $(HEXFILE) HEXFILE = $(BINFILE) diff --git a/makefiles/tools/jlink.inc.mk b/makefiles/tools/jlink.inc.mk index 61abdd1290..b7f04be2fc 100644 --- a/makefiles/tools/jlink.inc.mk +++ b/makefiles/tools/jlink.inc.mk @@ -1,11 +1,11 @@ -export FLASHER = $(RIOTTOOLS)/jlink/jlink.sh -export DEBUGGER = $(RIOTTOOLS)/jlink/jlink.sh -export DEBUGSERVER = $(RIOTTOOLS)/jlink/jlink.sh -export RESET = $(RIOTTOOLS)/jlink/jlink.sh +FLASHER = $(RIOTTOOLS)/jlink/jlink.sh +DEBUGGER = $(RIOTTOOLS)/jlink/jlink.sh +DEBUGSERVER = $(RIOTTOOLS)/jlink/jlink.sh +RESET = $(RIOTTOOLS)/jlink/jlink.sh FLASHFILE ?= $(BINFILE) -export FFLAGS ?= flash $(FLASHFILE) -export DEBUGGER_FLAGS ?= debug $(ELFFILE) -export DEBUGSERVER_FLAGS ?= debug-server -export RESET_FLAGS ?= reset +FFLAGS ?= flash $(FLASHFILE) +DEBUGGER_FLAGS ?= debug $(ELFFILE) +DEBUGSERVER_FLAGS ?= debug-server +RESET_FLAGS ?= reset diff --git a/makefiles/tools/openocd.inc.mk b/makefiles/tools/openocd.inc.mk index 74709c59e4..b478ab2711 100644 --- a/makefiles/tools/openocd.inc.mk +++ b/makefiles/tools/openocd.inc.mk @@ -1,13 +1,13 @@ -export FLASHER ?= $(RIOTTOOLS)/openocd/openocd.sh -export DEBUGGER = $(RIOTTOOLS)/openocd/openocd.sh -export DEBUGSERVER = $(RIOTTOOLS)/openocd/openocd.sh -export RESET ?= $(RIOTTOOLS)/openocd/openocd.sh +FLASHER ?= $(RIOTTOOLS)/openocd/openocd.sh +DEBUGGER = $(RIOTTOOLS)/openocd/openocd.sh +DEBUGSERVER = $(RIOTTOOLS)/openocd/openocd.sh +RESET ?= $(RIOTTOOLS)/openocd/openocd.sh FLASHFILE ?= $(ELFFILE) -export FFLAGS ?= flash $(FLASHFILE) -export DEBUGGER_FLAGS ?= debug $(ELFFILE) -export DEBUGSERVER_FLAGS ?= debug-server -export RESET_FLAGS ?= reset +FFLAGS ?= flash $(FLASHFILE) +DEBUGGER_FLAGS ?= debug $(ELFFILE) +DEBUGSERVER_FLAGS ?= debug-server +RESET_FLAGS ?= reset ifneq (,$(DEBUG_ADAPTER)) include $(RIOTMAKE)/tools/openocd-adapters/$(DEBUG_ADAPTER).inc.mk diff --git a/makefiles/tools/pyocd.inc.mk b/makefiles/tools/pyocd.inc.mk index 998a1eff1b..f8ba7c6547 100644 --- a/makefiles/tools/pyocd.inc.mk +++ b/makefiles/tools/pyocd.inc.mk @@ -1,10 +1,10 @@ -export FLASHER ?= $(RIOTBASE)/dist/tools/pyocd/pyocd.sh -export DEBUGGER = $(RIOTBASE)/dist/tools/pyocd/pyocd.sh -export DEBUGSERVER = $(RIOTBASE)/dist/tools/pyocd/pyocd.sh -export RESET ?= $(RIOTBASE)/dist/tools/pyocd/pyocd.sh +FLASHER ?= $(RIOTBASE)/dist/tools/pyocd/pyocd.sh +DEBUGGER = $(RIOTBASE)/dist/tools/pyocd/pyocd.sh +DEBUGSERVER = $(RIOTBASE)/dist/tools/pyocd/pyocd.sh +RESET ?= $(RIOTBASE)/dist/tools/pyocd/pyocd.sh export OFLAGS ?= -O ihex -export FFLAGS ?= flash $(HEXFILE) -export DEBUGGER_FLAGS ?= debug $(ELFFILE) -export DEBUGSERVER_FLAGS ?= debug-server -export RESET_FLAGS ?= reset +FFLAGS ?= flash $(HEXFILE) +DEBUGGER_FLAGS ?= debug $(ELFFILE) +DEBUGSERVER_FLAGS ?= debug-server +RESET_FLAGS ?= reset diff --git a/makefiles/tools/uniflash.inc.mk b/makefiles/tools/uniflash.inc.mk index f2aebbd17c..91f315754c 100644 --- a/makefiles/tools/uniflash.inc.mk +++ b/makefiles/tools/uniflash.inc.mk @@ -4,27 +4,27 @@ FLASHFILE ?= $(ELFFILE) export UNIFLASH_PATH ?= "UNIFLASH_PATH unconfigured" # check which uniflash version is available, either 4.x or 3.x ifneq ("$(wildcard $(UNIFLASH_PATH)/dslite.sh)","") - export FLASHER ?= $(UNIFLASH_PATH)/dslite.sh - export FFLAGS = --config $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).ccxml $(FLASHFILE) + FLASHER ?= $(UNIFLASH_PATH)/dslite.sh + FFLAGS = --config $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).ccxml $(FLASHFILE) # configure uniflash for resetting target # xds110reset path changed in version UniFlash v4.4.0 # Try to detect the newest one and fallback to only 'xds110reset' _XDS110RESET_4_0_4_3 ?= $(UNIFLASH_PATH)/simplelink/gen2/bin/xds110reset _XDS110RESET ?= $(UNIFLASH_PATH)/simplelink/imagecreator/bin/xds110reset XDS110RESET ?= $(firstword $(wildcard $(_XDS110RESET) $(_XDS110RESET_4_0_4_3)) xds110reset) - export RESET = $(XDS110RESET) - export RESET_FLAGS + RESET = $(XDS110RESET) + RESET_FLAGS else - export FLASHER = $(UNIFLASH_PATH)/uniflash.sh - export FFLAGS = -ccxml $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).ccxml -program $(FLASHFILE) + FLASHER = $(UNIFLASH_PATH)/uniflash.sh + FFLAGS = -ccxml $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).ccxml -program $(FLASHFILE) # configure uniflash for resetting target - export RESET = $(UNIFLASH_PATH)/uniflash.sh - export RESET_FLAGS = -ccxml $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).ccxml -reset + RESET = $(UNIFLASH_PATH)/uniflash.sh + RESET_FLAGS = -ccxml $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).ccxml -reset endif # configure the debug server -export DEBUGSERVER = $(UNIFLASH_PATH)/ccs_base/common/uscif/gdb_agent_console -export DEBUGSERVER_FLAGS = -p 3333 $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).dat +DEBUGSERVER = $(UNIFLASH_PATH)/ccs_base/common/uscif/gdb_agent_console +DEBUGSERVER_FLAGS = -p 3333 $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).dat # configure the debugging tool -export DEBUGGER = $(PREFIX)gdb -export DEBUGGER_FLAGS = -x $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_gdb.conf $(ELFFILE) +DEBUGGER = $(PREFIX)gdb +DEBUGGER_FLAGS = -x $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_gdb.conf $(ELFFILE) diff --git a/makefiles/vars.inc.mk b/makefiles/vars.inc.mk index bff4d74f52..f2c5ac9ed0 100644 --- a/makefiles/vars.inc.mk +++ b/makefiles/vars.inc.mk @@ -69,8 +69,8 @@ export WERROR # Treat all compiler warnings as errors if set to 1 export GITCACHE # path to git-cache executable export GIT_CACHE_DIR # path to git-cache cache directory -export FLASHER # The command to call on "make flash". -export FFLAGS # The parameters to supply to FLASHER. +# FLASHER # The command to call on "make flash". +# FFLAGS # The parameters to supply to FLASHER. export FLASH_ADDR # Define an offset to flash code into ROM memory. # TERMPROG # The command to call on "make term". # TERMFLAGS # Additional parameters to supply to TERMPROG. @@ -78,12 +78,12 @@ export PORT # The port to connect the TERMPROG to. export ELFFILE # The unstripped result of the compilation. export HEXFILE # The stripped result of the compilation. # FLASHFILE # The output file used for flashing (transition phase: only if defined) -export DEBUGGER # The command to call on "make debug", usually a script starting the GDB front-end. -export DEBUGGER_FLAGS # The parameters to supply to DEBUGGER. -export DEBUGSERVER # The command to call on "make debug-server", usually a script starting the GDB server. -export DEBUGSERVER_FLAGS # The parameters to supply to DEBUGSERVER. -export RESET # The command to call on "make reset", this command resets/reboots the target. -export RESET_FLAGS # The parameters to supply to RESET. +# DEBUGGER # The command to call on "make debug", usually a script starting the GDB front-end. +# DEBUGGER_FLAGS # The parameters to supply to DEBUGGER. +# DEBUGSERVER # The command to call on "make debug-server", usually a script starting the GDB server. +# DEBUGSERVER_FLAGS # The parameters to supply to DEBUGSERVER. +# RESET # The command to call on "make reset", this command resets/reboots the target. +# RESET_FLAGS # The parameters to supply to RESET. export CCACHE_BASEDIR # ccache basedir, allows multiple riot build # directories to share a ccache directory