1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/boards/pba-d-01-kw2x/Makefile.include
Gaëtan Harter 94dfc4dd94
boards/pba-d-01-kw2x: fix flashing from invalid state
When in an invalid state, the board could not flash anymore.
Like for example after flashing `tests/driver_adt7310` this makes it
flash again.

I used `reset_config srst_only` as the other kinetis boards are also
configured that way.
2019-09-02 15:56:14 +02:00

38 lines
1.4 KiB
Makefile

# set default port depending on operating system
PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
# 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.
# wdog-disable.bin is a precompiled binary which will disable the watchdog and
# return control to the debugger (OpenOCD)
export OPENOCD_PRE_VERIFY_CMDS += \
-c 'load_image $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin 0x20000000 bin' \
-c 'resume 0x20000000'
export OPENOCD_EXTRA_INIT
export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield.sh
DEBUG_ADAPTER ?= dap
# Add board selector (USB serial) to OpenOCD options if specified.
# Use /dist/tools/usb-serial/list-ttys.sh to find out serial number.
# Usage: SERIAL="0200..." BOARD="pba-d-01-kw2x" make flash
ifneq (,$(SERIAL))
export OPENOCD_EXTRA_INIT += "-c cmsis_dap_serial $(SERIAL)"
SERIAL_TTY = $(firstword $(shell $(RIOTTOOLS)/usb-serial/find-tty.sh $(SERIAL)))
ifeq (,$(SERIAL_TTY))
$(error Did not find a device with serial $(SERIAL))
endif
PORT_LINUX := $(SERIAL_TTY)
endif
# setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk
# The board can become un-flashable after some firmware, use connect_assert_srst
# to always be able to flash or reset the board.
export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk