mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
e40d569204
Keep the compiled '.bin' file to remove the need to compile it when flashing. This remove the need to have the toolchain when flashing so allow compiling and flashing with `BUILD_IN_DOCKER=1` without a local toolchain. Even if it ends up storing a binary, the file is only 34 bytes.
42 lines
1.5 KiB
Makefile
42 lines
1.5 KiB
Makefile
# define the cpu used by the phyWAVE-KW22 board
|
|
export CPU = kinetis
|
|
|
|
# the pba-d-01-kw2x board can embed either a kw21d256, kw21d512 or kw22d512 cpu.
|
|
# The default set up is kw21d256, the variable is overrideable to use the other
|
|
# cpu if needed.
|
|
export CPU_MODEL ?= mkw21d256vha5
|
|
|
|
# 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
|
|
|
|
export 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
|
|
|
|
# this board uses openocd
|
|
include $(RIOTMAKE)/tools/openocd.inc.mk
|