From 40e754c9d86afaa43b6dca397935a7c618517579 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 3 Mar 2020 11:56:09 +0100 Subject: [PATCH 01/13] makefiles/jlink: only export JLINK_DEVICE when required --- makefiles/tools/jlink.inc.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/makefiles/tools/jlink.inc.mk b/makefiles/tools/jlink.inc.mk index 3a38274fa970..e95d1725db6e 100644 --- a/makefiles/tools/jlink.inc.mk +++ b/makefiles/tools/jlink.inc.mk @@ -15,3 +15,6 @@ JLINK_SERIAL ?= $(DEBUG_ADAPTER_ID) # Export JLINK_SERIAL to required targets JLINK_TARGETS = debug% flash% reset term-rtt $(call target-export-variables,$(JLINK_TARGETS),JLINK_SERIAL) + +# Export JLINK_DEVICE to required targets +$(call target-export-variables,$(JLINK_TARGETS),JLINK_DEVICE) From 1e9879fbcff3bd7ecda42ba2c54d6a88547c515c Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 3 Mar 2020 11:56:38 +0100 Subject: [PATCH 02/13] boards: unexport JLINK_DEVICE variable --- boards/common/arduino-mkr/Makefile.include | 2 +- boards/common/nrf51/Makefile.include | 2 +- boards/common/nrf52/Makefile.include | 2 +- boards/common/silabs/Makefile.include | 2 +- boards/common/slwstk6000b/Makefile.include | 2 +- boards/feather-m0/Makefile.include | 2 +- boards/hamilton/Makefile.include | 2 +- boards/hifive1b/Makefile.include | 2 +- boards/ikea-tradfri/Makefile.include | 2 +- boards/openmote-b/Makefile.include | 2 +- boards/openmote-cc2538/Makefile.include | 2 +- boards/pic32-wifire/Makefile.include | 2 +- boards/sensebox_samd21/Makefile.include | 2 +- boards/sltb001a/Makefile.include | 2 +- boards/slwstk6220a/Makefile.include | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/boards/common/arduino-mkr/Makefile.include b/boards/common/arduino-mkr/Makefile.include index bede2ee73f22..6bebf8f75a7c 100644 --- a/boards/common/arduino-mkr/Makefile.include +++ b/boards/common/arduino-mkr/Makefile.include @@ -7,7 +7,7 @@ include $(RIOTMAKE)/tools/serial.inc.mk # setup the flash tool used ifeq ($(PROGRAMMER),jlink) # in case J-Link is attached to SWD pins, use a plain CPU memory model - export JLINK_DEVICE := $(MKR_JLINK_DEVICE) + JLINK_DEVICE = $(MKR_JLINK_DEVICE) include $(RIOTMAKE)/tools/jlink.inc.mk else # by default, we use BOSSA to flash this board and take into account the diff --git a/boards/common/nrf51/Makefile.include b/boards/common/nrf51/Makefile.include index 6fd03b1055de..81643dbac034 100644 --- a/boards/common/nrf51/Makefile.include +++ b/boards/common/nrf51/Makefile.include @@ -15,6 +15,6 @@ ifeq ($(PROGRAMMER),openocd) include $(RIOTMAKE)/tools/openocd.inc.mk else ifeq ($(PROGRAMMER),jlink) # setup JLink for flashing - export JLINK_DEVICE := nrf51822 + JLINK_DEVICE = nrf51822 include $(RIOTMAKE)/tools/jlink.inc.mk endif diff --git a/boards/common/nrf52/Makefile.include b/boards/common/nrf52/Makefile.include index 351c70ae6fd3..c8e0c42a7ee5 100644 --- a/boards/common/nrf52/Makefile.include +++ b/boards/common/nrf52/Makefile.include @@ -14,7 +14,7 @@ include $(RIOTBOARD)/$(BOARD)/Makefile.dep PROGRAMMER ?= jlink ifeq (jlink,$(PROGRAMMER)) # setup JLink for flashing - export JLINK_DEVICE := nrf52 + JLINK_DEVICE = nrf52 # special options when using SoftDevice ifneq (,$(filter nordic_softdevice_ble,$(USEPKG))) diff --git a/boards/common/silabs/Makefile.include b/boards/common/silabs/Makefile.include index 45e6730dccf6..de7502dbc31c 100644 --- a/boards/common/silabs/Makefile.include +++ b/boards/common/silabs/Makefile.include @@ -3,7 +3,7 @@ INCLUDES += -I$(RIOTBOARD)/common/silabs/drivers/include PROGRAMMER ?= jlink -export JLINK_DEVICE ?= ${CPU_MODEL} +JLINK_DEVICE ?= ${CPU_MODEL} OPENOCD_CONFIG ?= board/efm32.cfg ifeq ($(PROGRAMMER),jlink) diff --git a/boards/common/slwstk6000b/Makefile.include b/boards/common/slwstk6000b/Makefile.include index eca05dc67d69..a85fed1e5d34 100644 --- a/boards/common/slwstk6000b/Makefile.include +++ b/boards/common/slwstk6000b/Makefile.include @@ -11,7 +11,7 @@ include $(RIOTMAKE)/tools/serial.inc.mk # setup JLink for flashing include $(RIOTBOARD)/common/slwstk6000b/slwstk6000b.info.mk -export JLINK_DEVICE = $(word 2, $(SLWSTK6000B_MAINBOARD_VARS_$(BOARD_MODULE))) +JLINK_DEVICE = $(word 2, $(SLWSTK6000B_MAINBOARD_VARS_$(BOARD_MODULE))) # include board common include $(RIOTBOARD)/common/silabs/Makefile.include diff --git a/boards/feather-m0/Makefile.include b/boards/feather-m0/Makefile.include index a0290f54ed3c..3e5872289075 100644 --- a/boards/feather-m0/Makefile.include +++ b/boards/feather-m0/Makefile.include @@ -7,7 +7,7 @@ include $(RIOTMAKE)/tools/serial.inc.mk # setup the flash tool used ifeq ($(PROGRAMMER),jlink) # in case J-Link is attached to SWD pins, use a plain CPU memory model - export JLINK_DEVICE := atsamd21 + JLINK_DEVICE = atsamd21 include $(RIOTMAKE)/tools/jlink.inc.mk else # by default, we use BOSSA to flash this board to take into account the diff --git a/boards/hamilton/Makefile.include b/boards/hamilton/Makefile.include index b946467ae6a5..003c4219b4d3 100644 --- a/boards/hamilton/Makefile.include +++ b/boards/hamilton/Makefile.include @@ -1,5 +1,5 @@ # debugger config -export JLINK_DEVICE := atsamr21e18a +JLINK_DEVICE = atsamr21e18a OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb OFLAGS := --gap-fill 0xff diff --git a/boards/hifive1b/Makefile.include b/boards/hifive1b/Makefile.include index 3b9e3baf7430..f30a44d85118 100644 --- a/boards/hifive1b/Makefile.include +++ b/boards/hifive1b/Makefile.include @@ -7,7 +7,7 @@ include $(RIOTMAKE)/tools/serial.inc.mk # setup JLink for flashing # export JLINK := JLink -export JLINK_DEVICE := FE310 +JLINK_DEVICE = FE310 export JLINK_IF := JTAG export FLASH_ADDR := 0x20010000 include $(RIOTMAKE)/tools/jlink.inc.mk diff --git a/boards/ikea-tradfri/Makefile.include b/boards/ikea-tradfri/Makefile.include index 3d675eda294d..5f71eecf9b4a 100644 --- a/boards/ikea-tradfri/Makefile.include +++ b/boards/ikea-tradfri/Makefile.include @@ -3,7 +3,7 @@ PORT_LINUX ?= /dev/ttyACM0 PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) # setup JLink for flashing -export JLINK_DEVICE := EFR32MG1PxxxF256 +JLINK_DEVICE = EFR32MG1PxxxF256 include $(RIOTMAKE)/tools/jlink.inc.mk # setup serial terminal diff --git a/boards/openmote-b/Makefile.include b/boards/openmote-b/Makefile.include index 083cf2846822..8b692dc75961 100644 --- a/boards/openmote-b/Makefile.include +++ b/boards/openmote-b/Makefile.include @@ -22,7 +22,7 @@ ifeq ($(PROGRAMMER),cc2538-bsl) else ifeq ($(PROGRAMMER),jlink) # Special flashing and reset scripts are required due to board hardware export FLASH_ADDR = 0x200000 - export JLINK_DEVICE = CC2538SF53 + JLINK_DEVICE = CC2538SF53 export JLINK_IF = JTAG export JLINK_RESET_FILE = $(RIOTBOARD)/openmote-b/dist/hw_reset.seg include $(RIOTMAKE)/tools/jlink.inc.mk diff --git a/boards/openmote-cc2538/Makefile.include b/boards/openmote-cc2538/Makefile.include index f05ef48ba99c..960d7edf708e 100644 --- a/boards/openmote-cc2538/Makefile.include +++ b/boards/openmote-cc2538/Makefile.include @@ -9,7 +9,7 @@ PROGRAMMER ?= cc2538-bsl ifeq ($(PROGRAMMER),jlink) # setup JLink for flashing - export JLINK_DEVICE := cc2538sf53 + JLINK_DEVICE = cc2538sf53 export FLASH_ADDR := 0x200000 export JLINK_IF := JTAG export TUI := 1 diff --git a/boards/pic32-wifire/Makefile.include b/boards/pic32-wifire/Makefile.include index 157f041f06ea..c1ff0a5ec8ef 100644 --- a/boards/pic32-wifire/Makefile.include +++ b/boards/pic32-wifire/Makefile.include @@ -20,7 +20,7 @@ ifeq ($(PROGRAMMER),pic32prog) include $(RIOTMAKE)/tools/pic32prog.inc.mk else ifeq ($(PROGRAMMER),jlink) FLASHFILE ?= $(HEXFILE) - export JLINK_DEVICE := PIC32MZ2048EFG100 + JLINK_DEVICE = PIC32MZ2048EFG100 export JLINK_IF := JTAG include $(RIOTMAKE)/tools/jlink.inc.mk endif diff --git a/boards/sensebox_samd21/Makefile.include b/boards/sensebox_samd21/Makefile.include index 57f12755b9e3..0139d90fb5c7 100644 --- a/boards/sensebox_samd21/Makefile.include +++ b/boards/sensebox_samd21/Makefile.include @@ -7,7 +7,7 @@ include $(RIOTMAKE)/tools/serial.inc.mk # setup the flash tool used ifeq ($(PROGRAMMER),jlink) # in case J-Link is attached to SWD pins, use a plain CPU memory model - export JLINK_DEVICE := atsamd21 + JLINK_DEVICE = atsamd21 include $(RIOTMAKE)/tools/jlink.inc.mk else # by default, we use BOSSA to flash this board to take into account the diff --git a/boards/sltb001a/Makefile.include b/boards/sltb001a/Makefile.include index 55148eb7e5a5..4124f8b61fa6 100644 --- a/boards/sltb001a/Makefile.include +++ b/boards/sltb001a/Makefile.include @@ -6,7 +6,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) include $(RIOTMAKE)/tools/serial.inc.mk # setup JLink for flashing -export JLINK_DEVICE := EFR32MG1PxxxF256 +JLINK_DEVICE = EFR32MG1PxxxF256 export JLINK_PRE_FLASH = r # include board common diff --git a/boards/slwstk6220a/Makefile.include b/boards/slwstk6220a/Makefile.include index 2b84830990d9..1bedea3b29c9 100644 --- a/boards/slwstk6220a/Makefile.include +++ b/boards/slwstk6220a/Makefile.include @@ -3,7 +3,7 @@ PORT_LINUX ?= /dev/ttyACM0 PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) # setup JLink for flashing -export JLINK_DEVICE := ezr32wg330f256 +JLINK_DEVICE = ezr32wg330f256 include $(RIOTMAKE)/tools/jlink.inc.mk # setup serial terminal From 9c2e5c9b7c11f922de2b2cee2b22743d06f680d2 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 3 Mar 2020 13:13:41 +0100 Subject: [PATCH 03/13] ci/buildsystem_check: ensure JLINK_DEVICE is not exported --- dist/tools/buildsystem_sanity_check/check.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/dist/tools/buildsystem_sanity_check/check.sh b/dist/tools/buildsystem_sanity_check/check.sh index 36eaa3f7d51c..60e27ca7d5a2 100755 --- a/dist/tools/buildsystem_sanity_check/check.sh +++ b/dist/tools/buildsystem_sanity_check/check.sh @@ -86,6 +86,7 @@ UNEXPORTED_VARIABLES+=('OPENOCD_CONFIG') UNEXPORTED_VARIABLES+=('OPENOCD_RESET_USE_CONNECT_ASSERT_SRST') UNEXPORTED_VARIABLES+=('FLASH_TARGET_TYPE') UNEXPORTED_VARIABLES+=('PYOCD_ADAPTER_INIT') +UNEXPORTED_VARIABLES+=('JLINK_DEVICE') EXPORTED_VARIABLES_ONLY_IN_VARS=() EXPORTED_VARIABLES_ONLY_IN_VARS+=('APPDEPS') From 04d32e9609a34915fcedc21e39ca3a9bea4e6ce1 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 3 Mar 2020 16:07:57 +0100 Subject: [PATCH 04/13] makefiles/jlink: export JLINK_IF to required targets --- makefiles/tools/jlink.inc.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/makefiles/tools/jlink.inc.mk b/makefiles/tools/jlink.inc.mk index e95d1725db6e..34a252609790 100644 --- a/makefiles/tools/jlink.inc.mk +++ b/makefiles/tools/jlink.inc.mk @@ -12,9 +12,16 @@ RESET_FLAGS ?= reset JLINK_SERIAL ?= $(DEBUG_ADAPTER_ID) +JLINK_IF ?= + # Export JLINK_SERIAL to required targets JLINK_TARGETS = debug% flash% reset term-rtt $(call target-export-variables,$(JLINK_TARGETS),JLINK_SERIAL) # Export JLINK_DEVICE to required targets $(call target-export-variables,$(JLINK_TARGETS),JLINK_DEVICE) + +ifneq (,$(JLINK_IF)) + # Export JLINK_IF to required targets if not empty + $(call target-export-variables,$(JLINK_TARGETS),JLINK_IF) +endif From 84005896ddbc96db06fb889ef51e227c21323238 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 3 Mar 2020 16:14:54 +0100 Subject: [PATCH 05/13] boards: don't export JLINK_IF --- boards/hifive1b/Makefile.include | 2 +- boards/openmote-b/Makefile.include | 2 +- boards/openmote-cc2538/Makefile.include | 2 +- boards/pic32-wifire/Makefile.include | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/boards/hifive1b/Makefile.include b/boards/hifive1b/Makefile.include index f30a44d85118..a91219181e0c 100644 --- a/boards/hifive1b/Makefile.include +++ b/boards/hifive1b/Makefile.include @@ -8,7 +8,7 @@ include $(RIOTMAKE)/tools/serial.inc.mk # setup JLink for flashing # export JLINK := JLink JLINK_DEVICE = FE310 -export JLINK_IF := JTAG +JLINK_IF = JTAG export FLASH_ADDR := 0x20010000 include $(RIOTMAKE)/tools/jlink.inc.mk diff --git a/boards/openmote-b/Makefile.include b/boards/openmote-b/Makefile.include index 8b692dc75961..19be3449093b 100644 --- a/boards/openmote-b/Makefile.include +++ b/boards/openmote-b/Makefile.include @@ -23,7 +23,7 @@ else ifeq ($(PROGRAMMER),jlink) # Special flashing and reset scripts are required due to board hardware export FLASH_ADDR = 0x200000 JLINK_DEVICE = CC2538SF53 - export JLINK_IF = JTAG + JLINK_IF = JTAG export JLINK_RESET_FILE = $(RIOTBOARD)/openmote-b/dist/hw_reset.seg include $(RIOTMAKE)/tools/jlink.inc.mk endif diff --git a/boards/openmote-cc2538/Makefile.include b/boards/openmote-cc2538/Makefile.include index 960d7edf708e..b80b73c1fb17 100644 --- a/boards/openmote-cc2538/Makefile.include +++ b/boards/openmote-cc2538/Makefile.include @@ -11,7 +11,7 @@ ifeq ($(PROGRAMMER),jlink) # setup JLink for flashing JLINK_DEVICE = cc2538sf53 export FLASH_ADDR := 0x200000 - export JLINK_IF := JTAG + JLINK_IF = JTAG export TUI := 1 include $(RIOTMAKE)/tools/jlink.inc.mk else ifeq ($(PROGRAMMER),cc2538-bsl) diff --git a/boards/pic32-wifire/Makefile.include b/boards/pic32-wifire/Makefile.include index c1ff0a5ec8ef..07387cbd491d 100644 --- a/boards/pic32-wifire/Makefile.include +++ b/boards/pic32-wifire/Makefile.include @@ -21,6 +21,6 @@ ifeq ($(PROGRAMMER),pic32prog) else ifeq ($(PROGRAMMER),jlink) FLASHFILE ?= $(HEXFILE) JLINK_DEVICE = PIC32MZ2048EFG100 - export JLINK_IF := JTAG + JLINK_IF = JTAG include $(RIOTMAKE)/tools/jlink.inc.mk endif From c586db5ae22da5e551ccc9adc392ff1f9cc40aa4 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 3 Mar 2020 16:15:43 +0100 Subject: [PATCH 06/13] ci/buildsystem_check: ensure JLINK_IF is not exported --- dist/tools/buildsystem_sanity_check/check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/tools/buildsystem_sanity_check/check.sh b/dist/tools/buildsystem_sanity_check/check.sh index 60e27ca7d5a2..7df1e24cbe49 100755 --- a/dist/tools/buildsystem_sanity_check/check.sh +++ b/dist/tools/buildsystem_sanity_check/check.sh @@ -86,7 +86,7 @@ UNEXPORTED_VARIABLES+=('OPENOCD_CONFIG') UNEXPORTED_VARIABLES+=('OPENOCD_RESET_USE_CONNECT_ASSERT_SRST') UNEXPORTED_VARIABLES+=('FLASH_TARGET_TYPE') UNEXPORTED_VARIABLES+=('PYOCD_ADAPTER_INIT') -UNEXPORTED_VARIABLES+=('JLINK_DEVICE') +UNEXPORTED_VARIABLES+=('JLINK_DEVICE' 'JLINK_IF') EXPORTED_VARIABLES_ONLY_IN_VARS=() EXPORTED_VARIABLES_ONLY_IN_VARS+=('APPDEPS') From 5458f4d400877395bb2784e6227e2f4cd5154fed Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 3 Mar 2020 16:19:15 +0100 Subject: [PATCH 07/13] makefiles/jlink: export JLINK_RESET_FILE to required targets --- makefiles/tools/jlink.inc.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/makefiles/tools/jlink.inc.mk b/makefiles/tools/jlink.inc.mk index 34a252609790..a8fb26753044 100644 --- a/makefiles/tools/jlink.inc.mk +++ b/makefiles/tools/jlink.inc.mk @@ -13,6 +13,7 @@ RESET_FLAGS ?= reset JLINK_SERIAL ?= $(DEBUG_ADAPTER_ID) JLINK_IF ?= +JLINK_RESET_FILE ?= # Export JLINK_SERIAL to required targets JLINK_TARGETS = debug% flash% reset term-rtt @@ -25,3 +26,8 @@ ifneq (,$(JLINK_IF)) # Export JLINK_IF to required targets if not empty $(call target-export-variables,$(JLINK_TARGETS),JLINK_IF) endif + +ifneq (,$(JLINK_RESET_FILE)) + # Export JLINK_RESET_FILE to required targets if not empty + $(call target-export-variables,$(JLINK_TARGETS),JLINK_RESET_FILE) +endif From 92bbe754121dee1a16132f9f3c6f9042fb068c30 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 3 Mar 2020 16:19:43 +0100 Subject: [PATCH 08/13] boards/openmote-b: don't export JLINK_RESET_FILE --- boards/openmote-b/Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/openmote-b/Makefile.include b/boards/openmote-b/Makefile.include index 19be3449093b..a3c09444c9a4 100644 --- a/boards/openmote-b/Makefile.include +++ b/boards/openmote-b/Makefile.include @@ -24,7 +24,7 @@ else ifeq ($(PROGRAMMER),jlink) export FLASH_ADDR = 0x200000 JLINK_DEVICE = CC2538SF53 JLINK_IF = JTAG - export JLINK_RESET_FILE = $(RIOTBOARD)/openmote-b/dist/hw_reset.seg + JLINK_RESET_FILE = $(RIOTBOARD)/openmote-b/dist/hw_reset.seg include $(RIOTMAKE)/tools/jlink.inc.mk endif From 5e85994abf1292c87c42996131b31ac733848ed4 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 3 Mar 2020 16:20:30 +0100 Subject: [PATCH 09/13] ci/buildsystem_check: force no export of JLINK_RESET_FILE --- dist/tools/buildsystem_sanity_check/check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/tools/buildsystem_sanity_check/check.sh b/dist/tools/buildsystem_sanity_check/check.sh index 7df1e24cbe49..cbbe7c8191aa 100755 --- a/dist/tools/buildsystem_sanity_check/check.sh +++ b/dist/tools/buildsystem_sanity_check/check.sh @@ -86,7 +86,7 @@ UNEXPORTED_VARIABLES+=('OPENOCD_CONFIG') UNEXPORTED_VARIABLES+=('OPENOCD_RESET_USE_CONNECT_ASSERT_SRST') UNEXPORTED_VARIABLES+=('FLASH_TARGET_TYPE') UNEXPORTED_VARIABLES+=('PYOCD_ADAPTER_INIT') -UNEXPORTED_VARIABLES+=('JLINK_DEVICE' 'JLINK_IF') +UNEXPORTED_VARIABLES+=('JLINK_DEVICE' 'JLINK_IF' 'JLINK_RESET_FILE') EXPORTED_VARIABLES_ONLY_IN_VARS=() EXPORTED_VARIABLES_ONLY_IN_VARS+=('APPDEPS') From 8489a0af53f8187308be6a846518a5d85ecc124a Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 3 Mar 2020 16:22:30 +0100 Subject: [PATCH 10/13] boards: don't export FLASH_ADDR This variable is already export in vars.inc.mk --- boards/common/nrf52/Makefile.include | 2 +- boards/hifive1b/Makefile.include | 2 +- boards/openmote-b/Makefile.include | 2 +- boards/openmote-cc2538/Makefile.include | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/boards/common/nrf52/Makefile.include b/boards/common/nrf52/Makefile.include index c8e0c42a7ee5..d0fa753cd2cb 100644 --- a/boards/common/nrf52/Makefile.include +++ b/boards/common/nrf52/Makefile.include @@ -19,7 +19,7 @@ ifeq (jlink,$(PROGRAMMER)) # special options when using SoftDevice ifneq (,$(filter nordic_softdevice_ble,$(USEPKG))) export JLINK_PRE_FLASH := loadfile $(BINDIR)/softdevice.hex - export FLASH_ADDR := 0x1f000 + FLASH_ADDR = 0x1f000 LINKER_SCRIPT ?= $(RIOTCPU)/$(CPU)/ldscripts/$(CPU_MODEL)_sd.ld # murdock: softdevice.hex file is used for flashing # It must be taken into account for the test input hash and diff --git a/boards/hifive1b/Makefile.include b/boards/hifive1b/Makefile.include index a91219181e0c..bf2e7c485a49 100644 --- a/boards/hifive1b/Makefile.include +++ b/boards/hifive1b/Makefile.include @@ -9,7 +9,7 @@ include $(RIOTMAKE)/tools/serial.inc.mk # export JLINK := JLink JLINK_DEVICE = FE310 JLINK_IF = JTAG -export FLASH_ADDR := 0x20010000 +FLASH_ADDR = 0x20010000 include $(RIOTMAKE)/tools/jlink.inc.mk TESTRUNNER_RESET_DELAY = 1 diff --git a/boards/openmote-b/Makefile.include b/boards/openmote-b/Makefile.include index a3c09444c9a4..c539e40b039e 100644 --- a/boards/openmote-b/Makefile.include +++ b/boards/openmote-b/Makefile.include @@ -21,7 +21,7 @@ ifeq ($(PROGRAMMER),cc2538-bsl) include $(RIOTMAKE)/tools/cc2538-bsl.inc.mk else ifeq ($(PROGRAMMER),jlink) # Special flashing and reset scripts are required due to board hardware - export FLASH_ADDR = 0x200000 + FLASH_ADDR = 0x200000 JLINK_DEVICE = CC2538SF53 JLINK_IF = JTAG JLINK_RESET_FILE = $(RIOTBOARD)/openmote-b/dist/hw_reset.seg diff --git a/boards/openmote-cc2538/Makefile.include b/boards/openmote-cc2538/Makefile.include index b80b73c1fb17..c880d0c09b8f 100644 --- a/boards/openmote-cc2538/Makefile.include +++ b/boards/openmote-cc2538/Makefile.include @@ -10,7 +10,7 @@ PROGRAMMER ?= cc2538-bsl ifeq ($(PROGRAMMER),jlink) # setup JLink for flashing JLINK_DEVICE = cc2538sf53 - export FLASH_ADDR := 0x200000 + FLASH_ADDR = 0x200000 JLINK_IF = JTAG export TUI := 1 include $(RIOTMAKE)/tools/jlink.inc.mk From 6560a1f56783d88473c935dd8d121290d5ab4eec Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 3 Mar 2020 16:42:37 +0100 Subject: [PATCH 11/13] makefiles/jlink: export JLINK_PRE_FLASH to flash targets --- makefiles/tools/jlink.inc.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/makefiles/tools/jlink.inc.mk b/makefiles/tools/jlink.inc.mk index a8fb26753044..149a6183d6ad 100644 --- a/makefiles/tools/jlink.inc.mk +++ b/makefiles/tools/jlink.inc.mk @@ -14,6 +14,7 @@ JLINK_SERIAL ?= $(DEBUG_ADAPTER_ID) JLINK_IF ?= JLINK_RESET_FILE ?= +JLINK_PRE_FLASH ?= # Export JLINK_SERIAL to required targets JLINK_TARGETS = debug% flash% reset term-rtt @@ -31,3 +32,8 @@ ifneq (,$(JLINK_RESET_FILE)) # Export JLINK_RESET_FILE to required targets if not empty $(call target-export-variables,$(JLINK_TARGETS),JLINK_RESET_FILE) endif + +# Export JLINK_PRE_FLASH to flash targets only if not empty +ifneq (,$(JLINK_PRE_FLASH)) + $(call target-export-variables,flash%,JLINK_PRE_FLASH) +endif From c49ad27499220c19eccbb78d985ad68660f3d537 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 3 Mar 2020 16:43:45 +0100 Subject: [PATCH 12/13] boards: don't export JLINK_PRE_FLASH --- boards/common/nrf52/Makefile.include | 2 +- boards/slstk3401a/Makefile.include | 2 +- boards/slstk3402a/Makefile.include | 2 +- boards/sltb001a/Makefile.include | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/boards/common/nrf52/Makefile.include b/boards/common/nrf52/Makefile.include index d0fa753cd2cb..bc9c85d14121 100644 --- a/boards/common/nrf52/Makefile.include +++ b/boards/common/nrf52/Makefile.include @@ -18,7 +18,7 @@ ifeq (jlink,$(PROGRAMMER)) # special options when using SoftDevice ifneq (,$(filter nordic_softdevice_ble,$(USEPKG))) - export JLINK_PRE_FLASH := loadfile $(BINDIR)/softdevice.hex + JLINK_PRE_FLASH = loadfile $(BINDIR)/softdevice.hex FLASH_ADDR = 0x1f000 LINKER_SCRIPT ?= $(RIOTCPU)/$(CPU)/ldscripts/$(CPU_MODEL)_sd.ld # murdock: softdevice.hex file is used for flashing diff --git a/boards/slstk3401a/Makefile.include b/boards/slstk3401a/Makefile.include index b6a443535b10..52633b1c80a7 100644 --- a/boards/slstk3401a/Makefile.include +++ b/boards/slstk3401a/Makefile.include @@ -6,7 +6,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) include $(RIOTMAKE)/tools/serial.inc.mk # setup JLink for flashing -export JLINK_PRE_FLASH = r +JLINK_PRE_FLASH = r # include board common include $(RIOTBOARD)/common/silabs/Makefile.include diff --git a/boards/slstk3402a/Makefile.include b/boards/slstk3402a/Makefile.include index b6a443535b10..52633b1c80a7 100644 --- a/boards/slstk3402a/Makefile.include +++ b/boards/slstk3402a/Makefile.include @@ -6,7 +6,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) include $(RIOTMAKE)/tools/serial.inc.mk # setup JLink for flashing -export JLINK_PRE_FLASH = r +JLINK_PRE_FLASH = r # include board common include $(RIOTBOARD)/common/silabs/Makefile.include diff --git a/boards/sltb001a/Makefile.include b/boards/sltb001a/Makefile.include index 4124f8b61fa6..49293f93e7e6 100644 --- a/boards/sltb001a/Makefile.include +++ b/boards/sltb001a/Makefile.include @@ -7,7 +7,7 @@ include $(RIOTMAKE)/tools/serial.inc.mk # setup JLink for flashing JLINK_DEVICE = EFR32MG1PxxxF256 -export JLINK_PRE_FLASH = r +JLINK_PRE_FLASH = r # include board common include $(RIOTBOARD)/common/silabs/Makefile.include From ad5b9d7faf7f4de734db4fb82730b9890cde088b Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 3 Mar 2020 16:44:45 +0100 Subject: [PATCH 13/13] ci/buildsystem_check: force no export of JLINK_PRE_FLASH --- dist/tools/buildsystem_sanity_check/check.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/tools/buildsystem_sanity_check/check.sh b/dist/tools/buildsystem_sanity_check/check.sh index cbbe7c8191aa..9c3914bcd6aa 100755 --- a/dist/tools/buildsystem_sanity_check/check.sh +++ b/dist/tools/buildsystem_sanity_check/check.sh @@ -86,7 +86,8 @@ UNEXPORTED_VARIABLES+=('OPENOCD_CONFIG') UNEXPORTED_VARIABLES+=('OPENOCD_RESET_USE_CONNECT_ASSERT_SRST') UNEXPORTED_VARIABLES+=('FLASH_TARGET_TYPE') UNEXPORTED_VARIABLES+=('PYOCD_ADAPTER_INIT') -UNEXPORTED_VARIABLES+=('JLINK_DEVICE' 'JLINK_IF' 'JLINK_RESET_FILE') +UNEXPORTED_VARIABLES+=('JLINK_DEVICE' 'JLINK_IF') +UNEXPORTED_VARIABLES+=('JLINK_PRE_FLASH' 'JLINK_RESET_FILE') EXPORTED_VARIABLES_ONLY_IN_VARS=() EXPORTED_VARIABLES_ONLY_IN_VARS+=('APPDEPS')