2017-05-01 11:18:00 +02:00
|
|
|
# set default port depending on operating system
|
|
|
|
PORT_LINUX ?= /dev/ttyACM0
|
2017-05-01 11:47:06 +02:00
|
|
|
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
2017-05-01 11:18:00 +02:00
|
|
|
|
|
|
|
# Use the shared OpenOCD configuration
|
|
|
|
# Using dap or jlink depends on which firmware the OpenSDA debugger is running
|
2019-05-31 11:43:47 +02:00
|
|
|
DEBUG_ADAPTER ?= dap
|
|
|
|
#DEBUG_ADAPTER ?= jlink
|
2017-05-01 11:18:00 +02:00
|
|
|
|
|
|
|
# OpenOCD v0.10.0 and newer have built-in support for disabling the Kinetis
|
2018-11-27 15:18:16 +01:00
|
|
|
# watchdog automatically. Some older releases of Ubuntu and Debian have only
|
|
|
|
# version 0.9.0 or earlier OpenOCD packages (Ubuntu 17.04, Debian Jessie)
|
|
|
|
# Set this to 1 if you are using one of these older releases.
|
|
|
|
USE_OLD_OPENOCD ?= 0
|
2017-05-01 11:18:00 +02:00
|
|
|
|
|
|
|
ifeq (1,$(USE_OLD_OPENOCD))
|
|
|
|
# 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 += \
|
2017-10-27 01:26:26 +02:00
|
|
|
-c 'load_image $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin 0x20000000 bin' \
|
2017-05-01 11:18:00 +02:00
|
|
|
-c 'resume 0x20000000'
|
2017-11-21 16:32:29 +01:00
|
|
|
export OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/old-openocd-$(CPU_FAMILY).cfg
|
2017-05-01 11:18:00 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Configuration for OpenOCD v0.10.0 and newer
|
2017-11-21 16:32:29 +01:00
|
|
|
export OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/openocd-$(CPU_FAMILY).cfg
|
2017-05-01 11:18:00 +02:00
|
|
|
|
|
|
|
# Check the flash configuration field before flashing
|
2019-05-27 17:38:46 +02:00
|
|
|
export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield.sh
|
2017-05-01 11:18:00 +02:00
|
|
|
|
|
|
|
# setup serial terminal
|
|
|
|
include $(RIOTMAKE)/tools/serial.inc.mk
|
|
|
|
|
2019-03-04 14:31:41 +01:00
|
|
|
# The board can become un-flashable after some execution,
|
|
|
|
# use connect_assert_srst to always be able to flash or reset the board.
|
|
|
|
export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1
|
|
|
|
|
2017-05-01 11:18:00 +02:00
|
|
|
# this board uses openocd
|
|
|
|
include $(RIOTMAKE)/tools/openocd.inc.mk
|