Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make: allow to override RESET and RESET_FLAGS for all boards and tools #11649

Merged
merged 10 commits into from
Jun 7, 2019
4 changes: 2 additions & 2 deletions boards/cc2538dk/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ include $(RIOTMAKE)/tools/renode.inc.mk
# debugger config
DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh
DEBUGSERVER = JLinkGDBServer -device CC2538SF53
RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh
RESET ?= $(RIOTBOARD)/$(BOARD)/dist/reset.sh

# Define the flash-tool and default port:
export PROGRAMMER ?= cc2538-bsl
Expand All @@ -33,6 +33,6 @@ endif
OFLAGS = --gap-fill 0xff
FLASHFILE ?= $(BINFILE)
DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE)
RESET_FLAGS = $(BINDIR)
RESET_FLAGS ?= $(BINDIR)

export OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb
2 changes: 1 addition & 1 deletion boards/common/esp32/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
include $(RIOTMAKE)/tools/serial.inc.mk

# reset tool configuration
RESET = esptool.py --before default_reset run
RESET ?= esptool.py --before default_reset run
2 changes: 1 addition & 1 deletion boards/common/esp8266/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
include $(RIOTMAKE)/tools/serial.inc.mk

# reset tool configuration
RESET = esptool.py --before default_reset run
RESET ?= esptool.py --before default_reset run
6 changes: 3 additions & 3 deletions boards/common/remote/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ ifeq ($(PROGRAMMER),cc2538-bsl)
else ifeq ($(OS),Darwin)
PORT_BSL ?= $(PORT_DARWIN)
endif
RESET = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py -p "$(PORT_BSL)"
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)
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)
RESET ?= $(RIOTBOARD)/common/remote/dist/reset.sh
RESET_FLAGS ?= $(BINDIR)
endif

OFLAGS = --gap-fill 0xff
Expand Down
2 changes: 1 addition & 1 deletion boards/common/stm32f103c8/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ifeq ($(PROGRAMMER),dfu-util)
export ROM_OFFSET ?= 0x2000 # Skip the space needed by the embedded bootloader
FLASHER = dfu-util
DEBUGGER = # no debugger
RESET = # dfu-util has no support for resetting the device
RESET ?= # dfu-util has no support for resetting the device

HEXFILE = $(BINFILE)
FFLAGS = -d 1eaf:0003 -a 2 -D "$(HEXFILE)"
Expand Down
2 changes: 1 addition & 1 deletion boards/nz32-sc151/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export ID ?= 0483:df11

FLASHER = dfu-util
DEBUGGER = # dfu-util has no debugger
RESET = # dfu-util has no support for resetting the device
RESET ?= # dfu-util has no support for resetting the device

HEXFILE = $(BINFILE)
FFLAGS = -d $(ID) -a 0 -s 0x08000000:leave -D "$(HEXFILE)"
Expand Down
4 changes: 2 additions & 2 deletions boards/openmote-b/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ else ifeq ($(PROGRAMMER),jlink)
FFLAGS = $(BINDIR) $(FLASHFILE)
DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh
DEBUGSERVER = JLinkGDBServer -device CC2538SF53
RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh
RESET ?= $(RIOTBOARD)/$(BOARD)/dist/reset.sh
endif

FLASHFILE ?= $(BINFILE)
DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE)
RESET_FLAGS = $(BINDIR)
RESET_FLAGS ?= $(BINDIR)
export OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb

# setup serial terminal
Expand Down
2 changes: 1 addition & 1 deletion boards/spark-core/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ 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
RESET ?= # dfu-util has no support for resetting the device

HEXFILE = $(BINFILE)
FFLAGS = -d 1d50:607f -a 0 -s 0x08005000:leave -D "$(HEXFILE)"
Expand Down
2 changes: 1 addition & 1 deletion makefiles/tools/jlink.inc.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FLASHER = $(RIOTTOOLS)/jlink/jlink.sh
DEBUGGER = $(RIOTTOOLS)/jlink/jlink.sh
DEBUGSERVER = $(RIOTTOOLS)/jlink/jlink.sh
RESET = $(RIOTTOOLS)/jlink/jlink.sh
RESET ?= $(RIOTTOOLS)/jlink/jlink.sh

FLASHFILE ?= $(BINFILE)

Expand Down
6 changes: 3 additions & 3 deletions makefiles/tools/uniflash.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ ifneq ("$(wildcard $(UNIFLASH_PATH)/dslite.sh)","")
_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)
RESET = $(XDS110RESET)
RESET ?= $(XDS110RESET)
else
FLASHER = $(UNIFLASH_PATH)/uniflash.sh
FFLAGS = -ccxml $(RIOTBOARD)/$(BOARD)/dist/$(CPU_MODEL)_$(XDEBUGGER).ccxml -program $(FLASHFILE)
# configure uniflash for resetting target
RESET = $(UNIFLASH_PATH)/uniflash.sh
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
DEBUGSERVER = $(UNIFLASH_PATH)/ccs_base/common/uscif/gdb_agent_console
Expand Down