mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-27 07:21:18 +01:00
Merge pull request #16049 from aabadie/pr/make/namespace_programmer_vars
make: namespace programmer specific variables
This commit is contained in:
commit
bf7b727c4a
@ -3,7 +3,7 @@ PORT_LINUX ?= /dev/ttyUSB0
|
||||
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
|
||||
|
||||
# this board uses an ST-Link v2 debug adapter
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
STLINK_VERSION ?= 2
|
||||
|
||||
PROGRAMMER = openocd
|
||||
|
||||
@ -3,7 +3,7 @@ INCLUDES += -I$(RIOTBOARD)/common/stm32/include
|
||||
|
||||
# this board has an on-board ST-link adapter
|
||||
PROGRAMMER ?= openocd
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
|
||||
# this board can become un-flashable after a hardfault,
|
||||
# use connect_assert_srst to always be able to flash or reset the board.
|
||||
|
||||
@ -3,7 +3,7 @@ INCLUDES += -I$(RIOTBOARD)/common/stm32/include
|
||||
|
||||
# this board has an on-board ST-link adapter
|
||||
PROGRAMMER ?= openocd
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
|
||||
# The board can become un-flashable after some execution,
|
||||
# use connect_assert_srst to always be able to flash or reset the board.
|
||||
|
||||
@ -1,13 +1,10 @@
|
||||
# for this board we support flashing via openocd or pyocd
|
||||
PROGRAMMER ?= openocd
|
||||
|
||||
ifeq (openocd,$(PROGRAMMER))
|
||||
DEBUG_ADAPTER = dap
|
||||
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
|
||||
endif
|
||||
OPENOCD_DEBUG_ADAPTER = dap
|
||||
# PyOCD doesn't recognize automatically the board ID, so target type has to
|
||||
# be passed explicitly
|
||||
PYOCD_FLASH_TARGET_TYPE ?= -t nrf51
|
||||
|
||||
# include nrf51 boards common configuration
|
||||
include $(RIOTBOARD)/common/nrf51/Makefile.include
|
||||
|
||||
@ -1,26 +1,27 @@
|
||||
INCLUDES += -I$(RIOTBOARD)/common/stm32/include
|
||||
INCLUDES += -I$(RIOTBOARD)/common/blxxxpill/include
|
||||
|
||||
# DFU programmer specific variables
|
||||
# For older versions of the DFU bootloader, set DFU_USB_ID to 1d50:6017
|
||||
DFU_USB_ID ?= 1eaf:0003
|
||||
DFU_ALT ?= 2
|
||||
DFU_USE_DFUSE = 1
|
||||
# If using STM32duino bootloader, this change is necessary.
|
||||
# Bootloader available at
|
||||
# github.com/rogerclarkmelbourne/STM32duino-bootloader/tree/master/binaries
|
||||
ifeq (stm32duino,$(BOOTLOADER))
|
||||
# Flashing may be easier if using a software USB reset.
|
||||
# Future updates may provide USB support for stm32f1 which benefits
|
||||
# from this software reset.
|
||||
DFU_UTIL_FLAGS_OPTS += --reset
|
||||
endif
|
||||
|
||||
ifeq (dfu-util,$(PROGRAMMER))
|
||||
# For older versions of the DFU bootloader, set DFU_USB_ID to 1d50:6017
|
||||
DFU_USB_ID ?= 1eaf:0003
|
||||
DFU_ALT ?= 2
|
||||
DFU_USE_DFUSE = 1
|
||||
# Leave some space at the beginning of the flash for the bootloader
|
||||
ROM_OFFSET ?= 0x2000
|
||||
# If using STM32duino bootloader, this change is necessary.
|
||||
# Bootloader available at
|
||||
# github.com/rogerclarkmelbourne/STM32duino-bootloader/tree/master/binaries
|
||||
ifeq (stm32duino,$(BOOTLOADER))
|
||||
# Flashing may be easier if using a software USB reset.
|
||||
# Future updates may provide USB support for stm32f1 which benefits
|
||||
# from this software reset.
|
||||
FFLAGS_OPTS += --reset
|
||||
endif
|
||||
|
||||
else ifeq (openocd,$(PROGRAMMER))
|
||||
STLINK_VERSION ?= 2
|
||||
endif
|
||||
|
||||
STLINK_VERSION ?= 2
|
||||
|
||||
# Setup of programmer and serial is shared between STM32 based boards
|
||||
include $(RIOTMAKE)/boards/stm32.inc.mk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
# external programmer required
|
||||
DEBUG_ADAPTER ?= jlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= jlink
|
||||
|
||||
INCLUDES += -I$(RIOTBOARD)/common/e104-bt50xxa-tb/include
|
||||
|
||||
|
||||
@ -3,8 +3,8 @@ PROGRAMMER ?= openocd
|
||||
|
||||
# Use the shared OpenOCD configuration
|
||||
# Using dap or jlink depends on which firmware the OpenSDA debugger is running
|
||||
DEBUG_ADAPTER ?= dap
|
||||
#DEBUG_ADAPTER ?= jlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= dap
|
||||
#OPENOCD_DEBUG_ADAPTER ?= jlink
|
||||
|
||||
# Configuration for OpenOCD v0.10.0 and newer
|
||||
# For KW41Z, an OpenOCD version built from source is required. The support for
|
||||
@ -19,7 +19,7 @@ endif
|
||||
OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/openocd-$(OPENOCD_KINETIS_FAMILY).cfg
|
||||
|
||||
# Check the flash configuration field before flashing
|
||||
PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield.sh
|
||||
OPENOCD_PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield.sh
|
||||
|
||||
# The board can become un-flashable after some execution,
|
||||
# use connect_assert_srst to always be able to flash or reset the board.
|
||||
|
||||
@ -11,7 +11,7 @@ PROGRAMMER ?= openocd
|
||||
# Using connect_assert_srst removes errors on flash from invalid state
|
||||
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
|
||||
|
||||
DEBUG_ADAPTER ?= iotlab
|
||||
OPENOCD_DEBUG_ADAPTER ?= iotlab
|
||||
|
||||
OPENOCD_CONFIG ?= $(RIOTBOARD)/common/iotlab/dist/openocd.cfg
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
INCLUDES += -I$(RIOTBOARD)/common/kw41z/include
|
||||
|
||||
# This board comes with OpenSDA configured for JLink compatibility
|
||||
DEBUG_ADAPTER ?= jlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= jlink
|
||||
|
||||
# Include default FRDM board config
|
||||
include $(RIOTBOARD)/common/frdm/Makefile.include
|
||||
|
||||
@ -9,17 +9,17 @@ ifeq (bmp,$(PROGRAMMER))
|
||||
endif
|
||||
|
||||
PROGRAMMER ?= jlink
|
||||
ifeq (jlink,$(PROGRAMMER))
|
||||
# setup JLink for flashing
|
||||
JLINK_DEVICE = nrf52
|
||||
else ifeq (openocd,$(PROGRAMMER))
|
||||
ifneq (,$(filter $(BOARD),ruuvitag thingy52))
|
||||
# openocd doesn't fully work with ruuvitag and thingy52
|
||||
# setup JLink for flashing
|
||||
JLINK_DEVICE = nrf52
|
||||
# setup OpenOCD for flashing. Version 0.10 of OpenOCD doesn't contain support
|
||||
# for nrf52dk and nrf52840dk boards. To use OpenOCD with these a version
|
||||
# build from source (master > 2018, August the 13rd) is required.
|
||||
OPENOCD_DEBUG_ADAPTER ?= jlink
|
||||
OPENOCD_CONFIG = $(RIOTBOARD)/common/nrf52/dist/openocd.cfg
|
||||
|
||||
ifneq (,$(filter $(BOARD),ruuvitag thingy52))
|
||||
# openocd doesn't fully work with ruuvitag and thingy52
|
||||
ifeq (openocd,$(PROGRAMMER))
|
||||
$(error Cannot use OpenOCD with $(BOARD) board)
|
||||
endif
|
||||
# setup OpenOCD for flashing. Version 0.10 of OpenOCD doesn't contain support
|
||||
# for nrf52dk and nrf52840dk boards. To use OpenOCD with these a version
|
||||
# build from source (master > 2018, August the 13rd) is required.
|
||||
DEBUG_ADAPTER ?= jlink
|
||||
OPENOCD_CONFIG = $(RIOTBOARD)/common/nrf52/dist/openocd.cfg
|
||||
endif
|
||||
|
||||
@ -28,7 +28,7 @@ To flash the board with OpenOCD, use the `PROGRAMMER` variable:
|
||||
It is also possible to use the SWD interface of a ST-LINK/V2 in-circuit
|
||||
debugger/programmer with OpenOCD to flash a nrf52 board:
|
||||
```
|
||||
PROGRAMMER=openocd DEBUG_ADAPTER=stlink make BOARD=<nrf52 board> -C examples/hello-world flash
|
||||
PROGRAMMER=openocd OPENOCD_DEBUG_ADAPTER=stlink make BOARD=<nrf52 board> -C examples/hello-world flash
|
||||
```
|
||||
|
||||
*/
|
||||
|
||||
@ -23,13 +23,10 @@ else
|
||||
# For openocd, a version built against the development branch and containing
|
||||
# the support for nrf52 cpu is required.
|
||||
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
|
||||
else ifeq (openocd,$(PROGRAMMER))
|
||||
DEBUG_ADAPTER ?= dap
|
||||
endif
|
||||
# The board is not recognized automatically by pyocd, so the CPU target
|
||||
# option is passed explicitly
|
||||
PYOCD_FLASH_TARGET_TYPE ?= -t nrf52840
|
||||
OPENOCD_DEBUG_ADAPTER ?= dap
|
||||
endif
|
||||
|
||||
MONOFIRMWARETOOL = ${RIOTBOARD}/common/particle-mesh/monofirmware-tool.py
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
PROGRAMMER ?= openocd
|
||||
|
||||
# Using dap or jlink depends on which firmware the OpenSDA debugger is running
|
||||
#DEBUG_ADAPTER ?= dap
|
||||
DEBUG_ADAPTER ?= jlink
|
||||
#OPENOCD_DEBUG_ADAPTER ?= dap
|
||||
OPENOCD_DEBUG_ADAPTER ?= jlink
|
||||
|
||||
# Use the shared OpenOCD configuration
|
||||
OPENOCD_CONFIG ?= $(RIOTBOARD)/common/qn908x/dist/openocd.cfg
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
# which we do not have any support for. Update your OpenSDA firmware with
|
||||
# the latest CMSIS-DAP firmware for your board from
|
||||
# https://www.nxp.com/support/developer-resources/run-time-software/kinetis-developer-resources/ides-for-kinetis-mcus/opensda-serial-and-debug-adapter:OPENSDA
|
||||
DEBUG_ADAPTER ?= dap
|
||||
OPENOCD_DEBUG_ADAPTER ?= dap
|
||||
|
||||
# Include default FRDM board config
|
||||
include $(RIOTBOARD)/common/frdm/Makefile.include
|
||||
|
||||
6
boards/hifive1/dist/flasher.sh
vendored
6
boards/hifive1/dist/flasher.sh
vendored
@ -24,7 +24,7 @@
|
||||
#
|
||||
# options:
|
||||
# <image_file>: Filename of the file that will be flashed
|
||||
# PRE_FLASH_CHECK_SCRIPT: a command to run before flashing to
|
||||
# OPENOCD_PRE_FLASH_CHECK_SCRIPT: a command to run before flashing to
|
||||
# verify the integrity of the image to be flashed. <image_file> is
|
||||
# passed as a command line argument to this command.
|
||||
#
|
||||
@ -84,8 +84,8 @@ do_flash() {
|
||||
IMAGE_FILE=$1
|
||||
test_config
|
||||
test_imagefile
|
||||
if [ -n "${PRE_FLASH_CHECK_SCRIPT}" ]; then
|
||||
sh -c "${PRE_FLASH_CHECK_SCRIPT} '${IMAGE_FILE}'"
|
||||
if [ -n "${OPENOCD_PRE_FLASH_CHECK_SCRIPT}" ]; then
|
||||
sh -c "${OPENOCD_PRE_FLASH_CHECK_SCRIPT} '${IMAGE_FILE}'"
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -ne 0 ]; then
|
||||
echo "pre-flash checks failed, status=$RETVAL"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
PROGRAMMER ?= jlink
|
||||
|
||||
ifeq (openocd,$(PROGRAMMER))
|
||||
DEBUG_ADAPTER = jlink
|
||||
OPENOCD_DEBUG_ADAPTER = jlink
|
||||
OPENOCD_TRANSPORT = jtag
|
||||
OPENOCD_PRE_FLASH_CMDS += "-c flash protect 0 1 last off"
|
||||
else ifeq (jlink,$(PROGRAMMER))
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
INCLUDES += -I$(RIOTBOARD)/common/stm32/include
|
||||
|
||||
# to flash this board, use an ST-link adapter
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
|
||||
# this board can become un-flashable after a hardfault,
|
||||
# use connect_assert_srst to always be able to flash or reset the boards.
|
||||
|
||||
@ -10,4 +10,4 @@ CFLAGS+=-DSX127X_RX_SWITCH
|
||||
|
||||
# this board uses openocd
|
||||
PROGRAMMER ?= openocd
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
|
||||
@ -7,5 +7,5 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
|
||||
|
||||
# this board uses openocd with st-link
|
||||
PROGRAMMER ?= openocd
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
STLINK_VERSION ?= 2
|
||||
|
||||
@ -7,4 +7,4 @@ PROGRAMMER ?= openocd
|
||||
# use connect_assert_srst to always be able to flash or reset the boards.
|
||||
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
|
||||
# By default, flash this board using an ST-link adapter
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
|
||||
@ -3,4 +3,4 @@ INCLUDES += -I$(RIOTBOARD)/common/stm32/include
|
||||
|
||||
# this board uses openocd with st-link
|
||||
PROGRAMMER ?= openocd
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
# FLASHER will be lpc2k_pgm still
|
||||
DEBUG_ADAPTER ?= dap
|
||||
OPENOCD_DEBUG_ADAPTER ?= dap
|
||||
JLINK_DEVICE := LPC2388
|
||||
OPENOCD_TRANSPORT := jtag
|
||||
|
||||
|
||||
@ -1,12 +1,9 @@
|
||||
# for this board, flash with OpenOCD by default. PyOCD is also supported.
|
||||
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)
|
||||
else ifeq (openocd,$(PROGRAMMER))
|
||||
DEBUG_ADAPTER = dap
|
||||
endif
|
||||
# The board is not recognized automatically by pyocd, so the CPU target
|
||||
# option is passed explicitly
|
||||
PYOCD_FLASH_TARGET_TYPE ?= -t $(CPU)
|
||||
OPENOCD_DEBUG_ADAPTER = dap
|
||||
|
||||
ifneq (,$(filter microbit,$(USEMODULE)))
|
||||
INCLUDES += -I$(RIOTBOARD)/common/microbit/include
|
||||
|
||||
@ -4,9 +4,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
|
||||
# for this board we support flashing via openocd or pyocd
|
||||
PROGRAMMER ?= openocd
|
||||
|
||||
ifeq (openocd,$(PROGRAMMER))
|
||||
DEBUG_ADAPTER = dap
|
||||
endif
|
||||
OPENOCD_DEBUG_ADAPTER = dap
|
||||
|
||||
# QEMU 4.0 added microbit system emulation.
|
||||
RIOT_EMULATOR ?= qemu
|
||||
|
||||
@ -3,9 +3,10 @@ INCLUDES += -I$(RIOTBOARD)/common/stm32/include
|
||||
|
||||
PROGRAMMER ?= openocd
|
||||
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
STLINK_VERSION ?= 2
|
||||
|
||||
ifeq (openocd,$(PROGRAMMER))
|
||||
STLINK_VERSION ?= 2
|
||||
PORT_LINUX ?= /dev/ttyUSB0
|
||||
endif
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ endif
|
||||
PROGRAMMER ?= openocd
|
||||
|
||||
# Default debug adapter choice is to use the Mulle programmer board
|
||||
DEBUG_ADAPTER ?= mulle
|
||||
OPENOCD_DEBUG_ADAPTER ?= mulle
|
||||
|
||||
# We need special handling of the watchdog if we want to speed up the flash
|
||||
# verification by using the MCU to compute the image checksum after flashing.
|
||||
@ -16,7 +16,7 @@ DEBUG_ADAPTER ?= mulle
|
||||
OPENOCD_PRE_VERIFY_CMDS += \
|
||||
-c 'load_image $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin 0x20000000 bin' \
|
||||
-c 'resume 0x20000000'
|
||||
PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield.sh
|
||||
OPENOCD_PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield.sh
|
||||
|
||||
# Fall back to PROGRAMMER_SERIAL for backwards compatibility
|
||||
DEBUG_ADAPTER_ID ?= $(PROGRAMMER_SERIAL)
|
||||
|
||||
@ -5,9 +5,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
|
||||
PROGRAMMER ?= openocd
|
||||
|
||||
# dap debug adapter is required for openocd
|
||||
ifeq (openocd,$(PROGRAMMER))
|
||||
DEBUG_ADAPTER = dap
|
||||
endif
|
||||
OPENOCD_DEBUG_ADAPTER = dap
|
||||
|
||||
# include nrf51 boards common configuration
|
||||
include $(RIOTBOARD)/common/nrf51/Makefile.include
|
||||
|
||||
@ -5,9 +5,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
|
||||
PROGRAMMER ?= jlink
|
||||
|
||||
# set required jlink debug adapter for openocd if it's used
|
||||
ifeq (openocd,$(PROGRAMMER))
|
||||
DEBUG_ADAPTER = jlink
|
||||
endif
|
||||
OPENOCD_DEBUG_ADAPTER = jlink
|
||||
|
||||
# include nrf51 boards common configuration
|
||||
include $(RIOTBOARD)/common/nrf51/Makefile.include
|
||||
|
||||
@ -3,12 +3,9 @@
|
||||
# For openocd, a version built against the development branch and containing
|
||||
# the support for nrf52 cpu is required.
|
||||
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)
|
||||
else ifeq (openocd,$(PROGRAMMER))
|
||||
DEBUG_ADAPTER = dap
|
||||
endif
|
||||
# The board is not recognized automatically by pyocd, so the CPU target
|
||||
# option is passed explicitly
|
||||
PYOCD_FLASH_TARGET_TYPE ?= -t $(CPU)
|
||||
OPENOCD_DEBUG_ADAPTER = dap
|
||||
|
||||
include $(RIOTBOARD)/common/nrf52/Makefile.include
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
PROGRAMMER ?= uf2conv
|
||||
|
||||
UF2CONV_FLAGS = -f 0xADA52840
|
||||
ifeq (uf2conv,$(PROGRAMMER))
|
||||
|
||||
# Using uf2conv implies using the UF2 bootloader
|
||||
@ -12,7 +13,6 @@ ifeq (uf2conv,$(PROGRAMMER))
|
||||
ROM_OFFSET = 0x1000
|
||||
ROM_LEN = 0xf3000
|
||||
|
||||
FFLAGS_OPTS = -f 0xADA52840
|
||||
include $(RIOTMAKE)/tools/usb_board_reset.mk
|
||||
endif
|
||||
|
||||
|
||||
@ -3,12 +3,9 @@
|
||||
# For openocd, a version built against the development branch and containing
|
||||
# the support for nrf52 cpu is required.
|
||||
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
|
||||
else ifeq (openocd,$(PROGRAMMER))
|
||||
DEBUG_ADAPTER = dap
|
||||
endif
|
||||
# The board is not recognized automatically by pyocd, so the CPU target
|
||||
# option is passed explicitly
|
||||
PYOCD_FLASH_TARGET_TYPE ?= -t nrf52840
|
||||
OPENOCD_DEBUG_ADAPTER = dap
|
||||
|
||||
include $(RIOTBOARD)/common/nrf52/Makefile.include
|
||||
|
||||
@ -6,9 +6,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
|
||||
PROGRAMMER ?= jlink
|
||||
|
||||
# set required debug adapter for openocd if it's used
|
||||
ifeq (openocd,$(PROGRAMMER))
|
||||
DEBUG_ADAPTER = jlink
|
||||
endif
|
||||
OPENOCD_DEBUG_ADAPTER = jlink
|
||||
|
||||
# include nrf51 boards common configuration
|
||||
include $(RIOTBOARD)/common/nrf51/Makefile.include
|
||||
|
||||
@ -7,8 +7,8 @@ SLOT1_LEN ?= $(SLOT0_LEN)
|
||||
# support SWD and UART via Pi GPIO header
|
||||
PORT_LINUX ?= /dev/serial0
|
||||
# TODO change to bcm2835gpio after it's merged as it's faster
|
||||
# DEBUG_ADAPTER ?= bcm2835gpio
|
||||
DEBUG_ADAPTER ?= sysfs_gpio
|
||||
# OPENOCD_DEBUG_ADAPTER ?= bcm2835gpio
|
||||
OPENOCD_DEBUG_ADAPTER ?= sysfs_gpio
|
||||
SRST_PIN ?= 16
|
||||
SWCLK_PIN ?= 20
|
||||
SWDIO_PIN ?= 21
|
||||
|
||||
@ -4,9 +4,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
|
||||
|
||||
PROGRAMMER ?= cc2538-bsl
|
||||
|
||||
ifeq ($(PROGRAMMER),cc2538-bsl)
|
||||
FLASHFILE ?= $(HEXFILE)
|
||||
FFLAGS_OPTS ?= --bootloader-invert-lines
|
||||
endif
|
||||
CC2538_BSL_FLAGS_OPTS ?= --bootloader-invert-lines
|
||||
CC2538_BSL_FLASHFILE ?= $(HEXFILE)
|
||||
|
||||
include $(RIOTBOARD)/common/cc2538/Makefile.include
|
||||
|
||||
@ -3,9 +3,6 @@ PORT_LINUX ?= /dev/ttyUSB0
|
||||
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
|
||||
|
||||
PROGRAMMER ?= cc2538-bsl
|
||||
|
||||
ifeq ($(PROGRAMMER),cc2538-bsl)
|
||||
FLASHFILE ?= $(HEXFILE)
|
||||
endif
|
||||
CC2538_BSL_FLASHFILE ?= $(HEXFILE)
|
||||
|
||||
include $(RIOTBOARD)/common/cc2538/Makefile.include
|
||||
|
||||
@ -3,4 +3,4 @@ INCLUDES += -I$(RIOTBOARD)/common/stm32/include
|
||||
|
||||
# this board uses openocd with st-link
|
||||
PROGRAMMER ?= openocd
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
|
||||
@ -21,9 +21,9 @@ PROGRAMMER ?= openocd
|
||||
OPENOCD_PRE_VERIFY_CMDS += \
|
||||
-c 'load_image $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin 0x20000000 bin' \
|
||||
-c 'resume 0x20000000'
|
||||
PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield.sh
|
||||
OPENOCD_PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield.sh
|
||||
|
||||
DEBUG_ADAPTER ?= dap
|
||||
OPENOCD_DEBUG_ADAPTER ?= dap
|
||||
|
||||
# The board can become un-flashable after some firmware, use connect_assert_srst
|
||||
# to always be able to flash or reset the board.
|
||||
|
||||
@ -2,9 +2,7 @@
|
||||
PROGRAMMER ?= openocd
|
||||
|
||||
# dap debug adapter is required for openocd
|
||||
ifeq (openocd,$(PROGRAMMER))
|
||||
DEBUG_ADAPTER = dap
|
||||
endif
|
||||
OPENOCD_DEBUG_ADAPTER = dap
|
||||
|
||||
# Enable direct write to FCF (required for setting FOPT byte).
|
||||
OPENOCD_PRE_FLASH_CMDS += "-c kinetis fcf_source write"
|
||||
|
||||
@ -2,9 +2,7 @@
|
||||
RIOT_TERMINAL ?= jlink
|
||||
|
||||
# define pyocd as programmer to program with stlink
|
||||
ifeq (pyocd,$(PROGRAMMER))
|
||||
FLASH_TARGET_TYPE ?= -t $(CPU)
|
||||
endif
|
||||
PYOCD_FLASH_TARGET_TYPE ?= -t $(CPU)
|
||||
|
||||
# use shared Makefile.include
|
||||
include $(RIOTBOARD)/common/nrf52/Makefile.include
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
# set programming environment
|
||||
DEBUG_ADAPTER ?= dap
|
||||
OPENOCD_DEBUG_ADAPTER ?= dap
|
||||
PROGRAMMER ?= openocd
|
||||
|
||||
# use the common nrf52 config for the rest
|
||||
|
||||
@ -5,10 +5,10 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
|
||||
# this board uses openocd with an HEXFILE
|
||||
PROGRAMMER ?= openocd
|
||||
FLASHFILE ?= $(HEXFILE)
|
||||
DEBUG_ADAPTER ?= dap
|
||||
OPENOCD_DEBUG_ADAPTER ?= dap
|
||||
|
||||
# generate image checksum from hex file
|
||||
PRE_FLASH_CHECK_SCRIPT = lpc_checksum --format hex
|
||||
OPENOCD_PRE_FLASH_CHECK_SCRIPT = lpc_checksum --format hex
|
||||
|
||||
# remap flash to address 0x0, otherwise it verifies the rom bootloader
|
||||
OPENOCD_PRE_VERIFY_CMDS += '-c reset init'
|
||||
|
||||
@ -7,5 +7,5 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
|
||||
|
||||
# this board uses openocd
|
||||
PROGRAMMER ?= openocd
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
STLINK_VERSION ?= 2
|
||||
|
||||
@ -7,7 +7,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
|
||||
|
||||
# this board uses openocd
|
||||
PROGRAMMER ?= openocd
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
STLINK_VERSION ?= 2
|
||||
|
||||
# The board can become un-flashable after some execution,
|
||||
|
||||
@ -4,4 +4,4 @@ INCLUDES += -I$(RIOTBOARD)/common/stm32/include
|
||||
# this board uses openocd
|
||||
PROGRAMMER ?= openocd
|
||||
# this board has an on-board ST-link adapter
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
|
||||
@ -7,7 +7,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
|
||||
|
||||
# this board uses openocd with st-link
|
||||
PROGRAMMER ?= openocd
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
STLINK_VERSION ?= 2
|
||||
|
||||
# Tell renode on which UART stdio is available
|
||||
|
||||
@ -5,4 +5,4 @@ INCLUDES += -I$(RIOTBOARD)/common/stm32/include
|
||||
PROGRAMMER ?= openocd
|
||||
|
||||
# this board has an on-board ST-link adapter
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
|
||||
@ -5,4 +5,4 @@ INCLUDES += -I$(RIOTBOARD)/common/stm32/include
|
||||
PROGRAMMER ?= openocd
|
||||
|
||||
# this board has an on-board ST-link adapter
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
|
||||
@ -8,4 +8,4 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
|
||||
# this board uses openocd with st-link
|
||||
PROGRAMMER ?= openocd
|
||||
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
|
||||
@ -3,7 +3,7 @@ INCLUDES += -I$(RIOTBOARD)/common/stm32/include
|
||||
|
||||
# this board uses openocd with st-link
|
||||
PROGRAMMER ?= openocd
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
|
||||
# This board can become un-flashable after a hardfault,
|
||||
# use connect_assert_srst to always be able to flash or reset the board.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
INCLUDES += -I$(RIOTBOARD)/common/stm32/include
|
||||
|
||||
# this board has an on-board ST-link adapter
|
||||
DEBUG_ADAPTER = stlink-dap
|
||||
OPENOCD_DEBUG_ADAPTER = stlink-dap
|
||||
OPENOCD_CORE = stm32mp15x.cm4
|
||||
GDB_PORT_CORE_OFFSET = 1
|
||||
|
||||
|
||||
@ -4,5 +4,5 @@ INCLUDES += -I$(RIOTBOARD)/common/stm32/include
|
||||
# this board uses openocd with st-link
|
||||
PROGRAMMER ?= openocd
|
||||
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
STLINK_VERSION ?= 2-1
|
||||
|
||||
@ -3,7 +3,7 @@ PORT_LINUX ?= /dev/ttyUSB0
|
||||
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
|
||||
|
||||
# This board uses an ST-Link v2 debug adapter
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
STLINK_VERSION ?= 2
|
||||
|
||||
# import nrf51 boards common configuration
|
||||
|
||||
6
dist/tools/buildsystem_sanity_check/check.sh
vendored
6
dist/tools/buildsystem_sanity_check/check.sh
vendored
@ -108,7 +108,7 @@ UNEXPORTED_VARIABLES+=('RESET' 'RESETFLAGS')
|
||||
UNEXPORTED_VARIABLES+=('DEBUGGER' 'DEBUGGER_FLAGS')
|
||||
UNEXPORTED_VARIABLES+=('DEBUGSERVER' 'DEBUGSERVER_FLAGS')
|
||||
UNEXPORTED_VARIABLES+=('PREFLASHER' 'PREFFLAGS' 'FLASHDEPS')
|
||||
UNEXPORTED_VARIABLES+=('DEBUG_ADAPTER' 'DEBUG_ADAPTER_ID')
|
||||
UNEXPORTED_VARIABLES+=('OPENOCD_DEBUG_ADAPTER' 'DEBUG_ADAPTER_ID')
|
||||
UNEXPORTED_VARIABLES+=('PROGRAMMER_SERIAL')
|
||||
UNEXPORTED_VARIABLES+=('STLINK_VERSION')
|
||||
UNEXPORTED_VARIABLES+=('PORT_LINUX' 'PORT_DARWIN')
|
||||
@ -120,8 +120,8 @@ UNEXPORTED_VARIABLES+=('OPENOCD_CONFIG')
|
||||
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+=('OPENOCD_PRE_FLASH_CHECK_SCRIPT')
|
||||
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')
|
||||
|
||||
10
dist/tools/openocd/openocd.sh
vendored
10
dist/tools/openocd/openocd.sh
vendored
@ -28,7 +28,7 @@
|
||||
#
|
||||
# options:
|
||||
# <image_file>: Filename of the file that will be flashed
|
||||
# PRE_FLASH_CHECK_SCRIPT: a command to run before flashing to
|
||||
# OPENOCD_PRE_FLASH_CHECK_SCRIPT: a command to run before flashing to
|
||||
# verify the integrity of the image to be flashed. <image_file> is
|
||||
# passed as a command line argument to this command.
|
||||
#
|
||||
@ -271,8 +271,8 @@ do_flashr() {
|
||||
IMAGE_FILE=$1
|
||||
test_config
|
||||
test_imagefile
|
||||
if [ -n "${PRE_FLASH_CHECK_SCRIPT}" ]; then
|
||||
sh -c "${PRE_FLASH_CHECK_SCRIPT} '${IMAGE_FILE}'"
|
||||
if [ -n "${OPENOCD_PRE_FLASH_CHECK_SCRIPT}" ]; then
|
||||
sh -c "${OPENOCD_PRE_FLASH_CHECK_SCRIPT} '${IMAGE_FILE}'"
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -ne 0 ]; then
|
||||
echo "pre-flash checks failed, status=$RETVAL"
|
||||
@ -320,8 +320,8 @@ do_flash() {
|
||||
IMAGE_FILE=$1
|
||||
test_config
|
||||
test_imagefile
|
||||
if [ -n "${PRE_FLASH_CHECK_SCRIPT}" ]; then
|
||||
sh -c "${PRE_FLASH_CHECK_SCRIPT} '${IMAGE_FILE}'"
|
||||
if [ -n "${OPENOCD_PRE_FLASH_CHECK_SCRIPT}" ]; then
|
||||
sh -c "${OPENOCD_PRE_FLASH_CHECK_SCRIPT} '${IMAGE_FILE}'"
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -ne 0 ]; then
|
||||
echo "pre-flash checks failed, status=$RETVAL"
|
||||
|
||||
12
dist/tools/pyocd/pyocd.sh
vendored
12
dist/tools/pyocd/pyocd.sh
vendored
@ -12,7 +12,7 @@
|
||||
#
|
||||
# options:
|
||||
# <hex_file>: 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 <elfile>
|
||||
# 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}"
|
||||
}
|
||||
|
||||
#
|
||||
|
||||
@ -16,15 +16,15 @@ ifneq (,$(filter debug% flash% %term test,$(MAKECMDGOALS)))
|
||||
endif
|
||||
|
||||
# Default for these boards is to use a CMSIS-DAP programmer
|
||||
DEBUG_ADAPTER ?= dap
|
||||
OPENOCD_DEBUG_ADAPTER ?= dap
|
||||
|
||||
# If no programmer is set, select a default programmer
|
||||
ifeq ($(PROGRAMMER),)
|
||||
# EDBG can only be used with a compatible Atmel programmer
|
||||
ifeq ($(DEBUG_ADAPTER),dap)
|
||||
ifeq ($(OPENOCD_DEBUG_ADAPTER),dap)
|
||||
# set this to either openocd, jlink or edbg
|
||||
PROGRAMMER ?= edbg
|
||||
else ifeq ($(DEBUG_ADAPTER),jlink)
|
||||
else ifeq ($(OPENOCD_DEBUG_ADAPTER),jlink)
|
||||
# only use JLinkExe if it's installed
|
||||
ifneq (,$(shell which JLinkExe))
|
||||
PROGRAMMER ?= jlink
|
||||
|
||||
@ -13,19 +13,15 @@ ifeq (bmp,$(PROGRAMMER))
|
||||
PORT_DARWIN ?= $(wordlist 2, 2, $(sort $(wildcard /dev/tty.usbmodem*)))
|
||||
endif
|
||||
|
||||
ifeq (openocd,$(PROGRAMMER))
|
||||
# STM32 boards can become un-flashable after a hardfault,
|
||||
# use connect_assert_srst to always be able to flash or reset the boards.
|
||||
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
|
||||
# STM32 boards can become un-flashable after a hardfault,
|
||||
# use connect_assert_srst to always be able to flash or reset the boards.
|
||||
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
|
||||
|
||||
# For STM32 boards the ST-link adapter is the default adapter, e.g. all
|
||||
# Nucleo boards have an on-board ST-link adapter
|
||||
DEBUG_ADAPTER ?= stlink
|
||||
endif
|
||||
# For STM32 boards the ST-link adapter is the default adapter, e.g. all
|
||||
# Nucleo boards have an on-board ST-link adapter
|
||||
OPENOCD_DEBUG_ADAPTER ?= stlink
|
||||
|
||||
ifeq (jlink,$(PROGRAMMER))
|
||||
JLINK_DEVICE ?= $(CPU_MODEL)
|
||||
endif
|
||||
JLINK_DEVICE ?= $(CPU_MODEL)
|
||||
|
||||
ifeq (dfu-util,$(PROGRAMMER))
|
||||
# optionally, use dfu-util to flash via usb
|
||||
|
||||
@ -1,14 +1,21 @@
|
||||
BOSSA_VERSION ?= 1.9
|
||||
FLASHFILE ?= $(BINFILE)
|
||||
FLASHER ?= $(RIOTTOOLS)/bossa-$(BOSSA_VERSION)/bossac
|
||||
FFLAGS_OPTS ?=
|
||||
|
||||
# Warn about deprecated variables
|
||||
ifneq (,$(FFLAGS_OPTS))
|
||||
$(warning Warning! FFLAGS_OPTS is deprecated use BOSSA_FLAGS_OPTS)
|
||||
BOSSA_FLAGS_OPTS ?= $(FFLAGS_OPTS)
|
||||
endif
|
||||
|
||||
BOSSA_FLAGS_OPTS ?=
|
||||
|
||||
# Only use ROM_OFFSET with Bossa version 1.9
|
||||
ifeq (1.9,$(BOSSA_VERSION))
|
||||
FFLAGS_OPTS += -o $(ROM_OFFSET)
|
||||
BOSSA_FLAGS_OPTS += -o $(ROM_OFFSET)
|
||||
endif
|
||||
|
||||
FFLAGS ?= -p $(PROG_DEV) $(FFLAGS_OPTS) -e -i -w -v -b -R $(FLASHFILE)
|
||||
FFLAGS ?= -p $(PROG_DEV) $(BOSSA_FLAGS_OPTS) -e -i -w -v -b -R $(FLASHFILE)
|
||||
|
||||
# some arduino boards need to toggle the serial interface a little bit to get
|
||||
# them ready for flashing...
|
||||
|
||||
@ -1,15 +1,22 @@
|
||||
FLASHFILE ?= $(BINFILE)
|
||||
CC2538_BSL_FLASHFILE ?= $(BINFILE)
|
||||
FLASHFILE ?= $(CC2538_BSL_FLASHFILE)
|
||||
CC2538_BSL ?= $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py
|
||||
FFLAGS_OPTS ?=
|
||||
PROG_BAUD ?= 500000 # default value in cc2538-bsl
|
||||
|
||||
# Warn about deprecated variables
|
||||
ifneq (,$(FFLAGS_OPTS))
|
||||
$(warning Warning! FFLAGS_OPTS is deprecated use CC2538_BSL_FLAGS_OPTS)
|
||||
CC2538_BSL_FLAGS_OPTS ?= $(FFLAGS_OPTS)
|
||||
endif
|
||||
|
||||
CC2538_BSL_FLAGS_OPTS ?=
|
||||
CC2538_BSL_FLAGS = $(if $(IMAGE_OFFSET), -a $(shell printf "0x%08x" $$(($(IMAGE_OFFSET) + $(ROM_START_ADDR)))))
|
||||
CC2538_BSL_FLAGS += -p "$(PROG_DEV)" $(FFLAGS_OPTS) --write-erase -v -b $(PROG_BAUD) $(FLASHFILE)
|
||||
CC2538_BSL_FLAGS += -p "$(PROG_DEV)" $(CC2538_BSL_FLAGS_OPTS) --write-erase -v -b $(PROG_BAUD) $(FLASHFILE)
|
||||
|
||||
FLASHER ?= $(CC2538_BSL)
|
||||
FFLAGS ?= $(CC2538_BSL_FLAGS)
|
||||
|
||||
RESET ?= $(FLASHER) -p "$(PROG_DEV)" $(FFLAGS_OPTS) -b $(PROG_BAUD)
|
||||
RESET ?= $(FLASHER) -p "$(PROG_DEV)" $(CC2538_BSL_FLAGS_OPTS) -b $(PROG_BAUD)
|
||||
|
||||
ifeq ($(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py,$(FLASHER))
|
||||
FLASHDEPS += $(FLASHER)
|
||||
|
||||
@ -9,13 +9,20 @@ ROM_OFFSET ?= 0
|
||||
_ROM_ADDR_WITH_OFFSET ?= $(shell printf "0x%x" $$(($(ROM_START_ADDR) + $(ROM_OFFSET))))
|
||||
FLASH_ADDR ?= $(if $(ROM_OFFSET),$(_ROM_ADDR_WITH_OFFSET),$(ROM_START_ADDR))
|
||||
DFU_USE_DFUSE ?= 0
|
||||
|
||||
# Warn about deprecated variables
|
||||
ifneq (,$(FFLAGS_OPTS))
|
||||
$(warning Warning! FFLAGS_OPTS is deprecated use DFU_UTIL_FLAGS_OPTS)
|
||||
DFU_UTIL_FLAGS_OPTS ?= $(FFLAGS_OPTS)
|
||||
endif
|
||||
|
||||
# Optional flasher flags
|
||||
FFLAGS_OPTS ?=
|
||||
DFU_UTIL_FLAGS_OPTS ?=
|
||||
|
||||
FFLAGS ?= --device $(DFU_USB_ID) \
|
||||
--alt $(DFU_ALT) \
|
||||
--download $(FLASHFILE) \
|
||||
$(FFLAGS_OPTS)
|
||||
$(DFU_UTIL_FLAGS_OPTS)
|
||||
|
||||
ifeq ($(DFU_USE_DFUSE),1)
|
||||
FFLAGS += --dfuse-address $(FLASH_ADDR):leave
|
||||
|
||||
@ -9,8 +9,19 @@ DEBUGGER_FLAGS ?= debug $(ELFFILE)
|
||||
DEBUGSERVER_FLAGS ?= debug-server
|
||||
RESET_FLAGS ?= reset
|
||||
|
||||
# Warn about deprecated variables
|
||||
ifneq (,$(DEBUG_ADAPTER))
|
||||
include $(RIOTMAKE)/tools/openocd-adapters/$(DEBUG_ADAPTER).inc.mk
|
||||
$(warning Warning! DEBUG_ADAPTER is deprecated use OPENOCD_DEBUG_ADAPTER)
|
||||
OPENOCD_DEBUG_ADAPTER ?= $(DEBUG_ADAPTER)
|
||||
endif
|
||||
|
||||
ifneq (,$(PRE_FLASH_CHECK_SCRIPT))
|
||||
$(warning Warning! PRE_FLASH_CHECK_SCRIPT is deprecated use OPENOCD_PRE_FLASH_CHECK_SCRIPT)
|
||||
OPENOCD_PRE_FLASH_CHECK_SCRIPT ?= $(PRE_FLASH_CHECK_SCRIPT)
|
||||
endif
|
||||
|
||||
ifneq (,$(OPENOCD_DEBUG_ADAPTER))
|
||||
include $(RIOTMAKE)/tools/openocd-adapters/$(OPENOCD_DEBUG_ADAPTER).inc.mk
|
||||
OPENOCD_ADAPTER_INIT += -c 'transport select $(OPENOCD_TRANSPORT)'
|
||||
endif
|
||||
|
||||
@ -50,7 +61,7 @@ ifneq (,$(OPENOCD_PRE_FLASH_CMDS))
|
||||
$(call target-export-variables,$(OPENOCD_FLASH_TARGETS),OPENOCD_PRE_FLASH_CMDS)
|
||||
endif
|
||||
|
||||
ifneq (,$(PRE_FLASH_CHECK_SCRIPT))
|
||||
# Export PRE_FLASH_CHECK_SCRIPT only to the flash/flash-only targets
|
||||
$(call target-export-variables,$(OPENOCD_FLASH_TARGETS),PRE_FLASH_CHECK_SCRIPT)
|
||||
ifneq (,$(OPENOCD_PRE_FLASH_CHECK_SCRIPT))
|
||||
# Export OPENOCD_PRE_FLASH_CHECK_SCRIPT only to the flash/flash-only targets
|
||||
$(call target-export-variables,$(OPENOCD_FLASH_TARGETS),OPENOCD_PRE_FLASH_CHECK_SCRIPT)
|
||||
endif
|
||||
|
||||
@ -3,7 +3,13 @@ DEBUGGER ?= $(RIOTBASE)/dist/tools/pyocd/pyocd.sh
|
||||
DEBUGSERVER ?= $(RIOTBASE)/dist/tools/pyocd/pyocd.sh
|
||||
RESET ?= $(RIOTBASE)/dist/tools/pyocd/pyocd.sh
|
||||
|
||||
FLASH_TARGET_TYPE ?=
|
||||
# Warn about deprecated variables
|
||||
ifneq (,$(FLASH_TARGET_TYPE))
|
||||
$(warning Warning! FLASH_TARGET_TYPE is deprecated use PYOCD_FLASH_TARGET_TYPE)
|
||||
PYOCD_FLASH_TARGET_TYPE ?= $(FLASH_TARGET_TYPE)
|
||||
endif
|
||||
|
||||
PYOCD_FLASH_TARGET_TYPE ?=
|
||||
FLASHFILE ?= $(HEXFILE)
|
||||
FFLAGS ?= flash $(FLASHFILE)
|
||||
DEBUGGER_FLAGS ?= debug $(ELFFILE)
|
||||
@ -12,9 +18,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
|
||||
|
||||
@ -1,7 +1,13 @@
|
||||
FLASHFILE ?= $(HEXFILE)
|
||||
|
||||
# Warn about deprecated variables
|
||||
ifneq (,$(FFLAGS_OPTS))
|
||||
$(warning Warning! FFLAGS_OPTS is deprecated use UF2CONV_FLAGS)
|
||||
UF2CONV_FLAGS ?= $(FFLAGS_OPTS)
|
||||
endif
|
||||
|
||||
FLASHER ?= $(RIOTTOOLS)/uf2/uf2conv.py
|
||||
FFLAGS ?= $(FFLAGS_OPTS) $(FLASHFILE)
|
||||
FFLAGS ?= $(UF2CONV_FLAGS) $(FLASHFILE)
|
||||
|
||||
PREFLASH_DELAY ?= 2
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user