diff --git a/boards/calliope-mini/Makefile.include b/boards/calliope-mini/Makefile.include index 5a78964016..f119139994 100644 --- a/boards/calliope-mini/Makefile.include +++ b/boards/calliope-mini/Makefile.include @@ -6,7 +6,7 @@ ifeq (openocd,$(PROGRAMMER)) else ifeq (pyocd,$(PROGRAMMER)) # PyOCD doesn't recognize automatically the board ID, so target type has to # be passed explicitly - FLASH_TARGET_TYPE ?= -t nrf51 + PYOCD_FLASH_TARGET_TYPE ?= -t nrf51 endif # include nrf51 boards common configuration diff --git a/boards/common/particle-mesh/Makefile.include b/boards/common/particle-mesh/Makefile.include index 24799c202f..d9ad7eb1cb 100644 --- a/boards/common/particle-mesh/Makefile.include +++ b/boards/common/particle-mesh/Makefile.include @@ -26,7 +26,7 @@ else ifeq (pyocd,$(PROGRAMMER)) # The board is not recognized automatically by pyocd, so the CPU target # option is passed explicitly - FLASH_TARGET_TYPE ?= -t nrf52840 + PYOCD_FLASH_TARGET_TYPE ?= -t nrf52840 else ifeq (openocd,$(PROGRAMMER)) OPENOCD_DEBUG_ADAPTER ?= dap endif diff --git a/boards/microbit-v2/Makefile.include b/boards/microbit-v2/Makefile.include index 817c16b926..2b0afee20a 100644 --- a/boards/microbit-v2/Makefile.include +++ b/boards/microbit-v2/Makefile.include @@ -3,7 +3,7 @@ PROGRAMMER ?= openocd ifeq (pyocd,$(PROGRAMMER)) # The board is not recognized automatically by pyocd, so the CPU target # option is passed explicitly - FLASH_TARGET_TYPE ?= -t $(CPU) + PYOCD_FLASH_TARGET_TYPE ?= -t $(CPU) else ifeq (openocd,$(PROGRAMMER)) OPENOCD_DEBUG_ADAPTER = dap endif diff --git a/boards/nrf52832-mdk/Makefile.include b/boards/nrf52832-mdk/Makefile.include index 6bead94ad4..31d573cb34 100644 --- a/boards/nrf52832-mdk/Makefile.include +++ b/boards/nrf52832-mdk/Makefile.include @@ -6,7 +6,7 @@ PROGRAMMER ?= pyocd ifeq (pyocd,$(PROGRAMMER)) # The board is not recognized automatically by pyocd, so the CPU target # option is passed explicitly - FLASH_TARGET_TYPE ?= -t $(CPU) + PYOCD_FLASH_TARGET_TYPE ?= -t $(CPU) else ifeq (openocd,$(PROGRAMMER)) OPENOCD_DEBUG_ADAPTER = dap endif diff --git a/boards/nrf52840-mdk/Makefile.include b/boards/nrf52840-mdk/Makefile.include index f5d2d4c030..faf922bc83 100644 --- a/boards/nrf52840-mdk/Makefile.include +++ b/boards/nrf52840-mdk/Makefile.include @@ -6,7 +6,7 @@ PROGRAMMER ?= pyocd ifeq (pyocd,$(PROGRAMMER)) # The board is not recognized automatically by pyocd, so the CPU target # option is passed explicitly - FLASH_TARGET_TYPE ?= -t nrf52840 + PYOCD_FLASH_TARGET_TYPE ?= -t nrf52840 else ifeq (openocd,$(PROGRAMMER)) OPENOCD_DEBUG_ADAPTER = dap endif diff --git a/boards/pinetime/Makefile.include b/boards/pinetime/Makefile.include index 2ce2c5e203..7702f36a50 100644 --- a/boards/pinetime/Makefile.include +++ b/boards/pinetime/Makefile.include @@ -3,7 +3,7 @@ RIOT_TERMINAL ?= jlink # define pyocd as programmer to program with stlink ifeq (pyocd,$(PROGRAMMER)) - FLASH_TARGET_TYPE ?= -t $(CPU) + PYOCD_FLASH_TARGET_TYPE ?= -t $(CPU) endif # use shared Makefile.include diff --git a/dist/tools/buildsystem_sanity_check/check.sh b/dist/tools/buildsystem_sanity_check/check.sh index 36b91f7d62..4d0802ea6a 100755 --- a/dist/tools/buildsystem_sanity_check/check.sh +++ b/dist/tools/buildsystem_sanity_check/check.sh @@ -121,7 +121,7 @@ UNEXPORTED_VARIABLES+=('OPENOCD_RESET_USE_CONNECT_ASSERT_SRST') UNEXPORTED_VARIABLES+=('OPENOCD_CMD_RESET_RUN') UNEXPORTED_VARIABLES+=('OPENOCD_PRE_FLASH_CMDS' 'OPENOCD_PRE_VERIFY_CMDS') UNEXPORTED_VARIABLES+=('PRE_FLASH_CHECK_SCRIPT') -UNEXPORTED_VARIABLES+=('FLASH_TARGET_TYPE') +UNEXPORTED_VARIABLES+=('PYOCD_FLASH_TARGET_TYPE') UNEXPORTED_VARIABLES+=('PYOCD_ADAPTER_INIT') UNEXPORTED_VARIABLES+=('JLINK_DEVICE' 'JLINK_IF') UNEXPORTED_VARIABLES+=('JLINK_PRE_FLASH' 'JLINK_RESET_FILE') diff --git a/dist/tools/pyocd/pyocd.sh b/dist/tools/pyocd/pyocd.sh index 174cd601fb..346cec8b6e 100755 --- a/dist/tools/pyocd/pyocd.sh +++ b/dist/tools/pyocd/pyocd.sh @@ -12,7 +12,7 @@ # # options: # : Filename of the hex file that will be flashed -# FLASH_TARGET_TYPE: CPU target type (nrf52, nrf51, etc) +# PYOCD_FLASH_TARGET_TYPE: CPU target type (nrf52, nrf51, etc) # # debug: debug # starts pyocd-gdbserver as GDB server in the background and @@ -71,7 +71,7 @@ : ${DBG_FLAGS:=${DBG_DEFAULT_FLAGS} ${DBG_EXTRA_FLAGS}} # CPU Target type. # Use `-t` followed by value. Example: -t nrf51 -: ${FLASH_TARGET_TYPE:=} +: ${PYOCD_FLASH_TARGET_TYPE:=} # This is an optional offset to the base address that can be used to flash an # image in a different location than it is linked at. This feature can be useful # when flashing images for firmware swapping/remapping boot loaders. @@ -126,7 +126,7 @@ do_flash() { fi # flash device - sh -c "${PYOCD_FLASH} ${FLASH_TARGET_TYPE} ${PYOCD_ADAPTER_INIT} -a ${IMAGE_OFFSET} \"${HEX_FILE}\"" && + sh -c "${PYOCD_FLASH} ${PYOCD_FLASH_TARGET_TYPE} ${PYOCD_ADAPTER_INIT} -a ${IMAGE_OFFSET} \"${HEX_FILE}\"" && echo 'Done flashing' } @@ -148,7 +148,7 @@ do_debug() { trap '' INT # start PyOCD as GDB server ${SETSID} sh -c "${PYOCD_GDBSERVER} \ - ${FLASH_TARGET_TYPE} \ + ${PYOCD_FLASH_TARGET_TYPE} \ ${PYOCD_ADAPTER_INIT} \ -p ${GDB_PORT} \ -T ${TELNET_PORT} & \ @@ -166,7 +166,7 @@ do_debug() { do_debugserver() { # start PyOCD as GDB server sh -c "${PYOCD_GDBSERVER} \ - ${FLASH_TARGET_TYPE} \ + ${PYOCD_FLASH_TARGET_TYPE} \ ${PYOCD_ADAPTER_INIT} \ -p ${GDB_PORT} \ -T ${TELNET_PORT}" @@ -174,7 +174,7 @@ do_debugserver() { do_reset() { # start PyOCD and invoke board reset - sh -c "${PYOCD_CMD} cmd -c reset ${FLASH_TARGET_TYPE} ${PYOCD_ADAPTER_INIT}" + sh -c "${PYOCD_CMD} cmd -c reset ${PYOCD_FLASH_TARGET_TYPE} ${PYOCD_ADAPTER_INIT}" } # diff --git a/makefiles/tools/pyocd.inc.mk b/makefiles/tools/pyocd.inc.mk index 087ab9b118..4d38b1f909 100644 --- a/makefiles/tools/pyocd.inc.mk +++ b/makefiles/tools/pyocd.inc.mk @@ -3,7 +3,7 @@ DEBUGGER ?= $(RIOTBASE)/dist/tools/pyocd/pyocd.sh DEBUGSERVER ?= $(RIOTBASE)/dist/tools/pyocd/pyocd.sh RESET ?= $(RIOTBASE)/dist/tools/pyocd/pyocd.sh -FLASH_TARGET_TYPE ?= +PYOCD_FLASH_TARGET_TYPE ?= FLASHFILE ?= $(HEXFILE) FFLAGS ?= flash $(FLASHFILE) DEBUGGER_FLAGS ?= debug $(ELFFILE) @@ -12,9 +12,9 @@ RESET_FLAGS ?= reset PYOCD_TARGETS = debug% flash% reset -# Export FLASH_TARGET_TYPE to required targets only if not empty -ifneq (,$(FLASH_TARGET_TYPE)) - $(call target-export-variables,$(PYOCD_TARGETS),FLASH_TARGET_TYPE) +# Export PYOCD_FLASH_TARGET_TYPE to required targets only if not empty +ifneq (,$(PYOCD_FLASH_TARGET_TYPE)) + $(call target-export-variables,$(PYOCD_TARGETS),PYOCD_FLASH_TARGET_TYPE) endif # Add serial matching command, only if DEBUG_ADAPTER_ID was specified