1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #11554 from cladmi/pr/make/exports/remove_flash_debug_reset

make: remove exports for flash debug reset
This commit is contained in:
Gaëtan Harter 2019-05-28 18:15:03 +02:00 committed by GitHub
commit dedbe9c737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 200 additions and 184 deletions

View File

@ -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))

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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
}

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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