2015-01-06 00:22:42 +01:00
|
|
|
# define the cpu used by the phyWAVE-KW22 board
|
|
|
|
export CPU = kw2x
|
|
|
|
export CPU_MODEL = kw21d256
|
|
|
|
#export CPU_MODEL = kw21d512
|
|
|
|
#export CPU_MODEL = kw22d512
|
|
|
|
|
2015-05-27 19:02:58 +02:00
|
|
|
export MCPU = cortex-m4
|
2015-01-06 00:22:42 +01:00
|
|
|
|
2015-05-27 19:02:58 +02:00
|
|
|
# set default port depending on operating system
|
|
|
|
PORT_LINUX ?= /dev/ttyACM0
|
2015-05-22 18:18:30 +02:00
|
|
|
|
|
|
|
.PHONY: flash
|
|
|
|
flash: $(RIOTCPU)/kinetis_common/dist/wdog-disable.bin
|
|
|
|
|
|
|
|
# Reset the default goal.
|
|
|
|
.DEFAULT_GOAL :=
|
|
|
|
|
|
|
|
export TUI = 1
|
2015-05-27 19:02:58 +02:00
|
|
|
export FFLAGS = flash-elf
|
2015-05-22 18:18:30 +02:00
|
|
|
# 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)/kinetis_common/dist/wdog-disable.bin 0x20000000 bin' \
|
|
|
|
-c 'resume 0x20000000'
|
|
|
|
export OPENOCD_EXTRA_INIT
|
|
|
|
export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/kinetis_common/dist/check-fcfield-elf.sh
|
2015-01-06 00:22:42 +01:00
|
|
|
|
2015-05-17 15:21:49 +02:00
|
|
|
include $(RIOTBOARD)/$(BOARD)/Makefile.dep
|
2016-01-27 10:34:46 +01:00
|
|
|
|
2016-03-11 09:11:03 +01:00
|
|
|
# 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 = $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh $(SERIAL))
|
|
|
|
ifeq (,$(SERIAL_TTY))
|
|
|
|
$(error Did not find a device with serial $(SERIAL))
|
|
|
|
endif
|
|
|
|
PORT_LINUX := $(SERIAL_TTY)
|
|
|
|
endif
|
|
|
|
|
2015-05-27 19:02:58 +02:00
|
|
|
# setup serial terminal
|
|
|
|
include $(RIOTBOARD)/Makefile.include.serial
|
2016-01-27 10:34:46 +01:00
|
|
|
|
2015-05-27 19:02:58 +02:00
|
|
|
# this board uses openocd
|
|
|
|
include $(RIOTBOARD)/Makefile.include.openocd
|