mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
c6b8cbea00
With the canned recipe for flashing, flash dependencies should be added to FLASHDEPS, instead of writing `flash: dependencies`. This ensures that both flash and flash-only depend on the same prerequisites.
42 lines
1.6 KiB
Makefile
42 lines
1.6 KiB
Makefile
# set default port depending on operating system
|
|
PORT_LINUX ?= /dev/ttyACM0
|
|
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
|
|
|
# Use the shared OpenOCD configuration
|
|
# Using dap or jlink depends on which firmware the OpenSDA debugger is running
|
|
export DEBUG_ADAPTER ?= dap
|
|
#export DEBUG_ADAPTER ?= jlink
|
|
|
|
# OpenOCD v0.10.0 and newer have built-in support for disabling the Kinetis
|
|
# 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
|
|
|
|
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 += \
|
|
-c 'load_image $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin 0x20000000 bin' \
|
|
-c 'resume 0x20000000'
|
|
export OPENOCD_EXTRA_INIT
|
|
|
|
FLASHDEPS += $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin
|
|
|
|
export OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/old-openocd-$(CPU_FAMILY).cfg
|
|
endif
|
|
|
|
# Configuration for OpenOCD v0.10.0 and newer
|
|
export OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/openocd-$(CPU_FAMILY).cfg
|
|
|
|
# Check the flash configuration field before flashing
|
|
export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield-elf.sh
|
|
|
|
# setup serial terminal
|
|
include $(RIOTMAKE)/tools/serial.inc.mk
|
|
|
|
# this board uses openocd
|
|
include $(RIOTMAKE)/tools/openocd.inc.mk
|