1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #12470 from aabadie/pr/boards/kw41z_openocd

boards/frdm: update openocd version requirements
This commit is contained in:
Alexandre Abadie 2019-10-21 13:30:54 +02:00 committed by GitHub
commit 4b06a11b93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 63 deletions

View File

@ -7,24 +7,10 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
DEBUG_ADAPTER ?= dap
#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_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/old-openocd-$(CPU_FAMILY).cfg
endif
# Configuration for OpenOCD v0.10.0 and newer
# For KW41Z, an OpenOCD version built from source is required. The support for
# kw41z was introduced in
# https://github.com/ntfreak/openocd/2c8602ed9f084d6680cec7d0ca1d5dc71c865a5f
export OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/openocd-$(CPU_FAMILY).cfg
# Check the flash configuration field before flashing

View File

@ -1,46 +0,0 @@
#
# Freescale Kinetis Kxx devices when using old OpenOCD versions (<0.10.0)
#
source [find target/swj-dp.tcl]
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME kx
}
if { [info exists CPUTAPID] } {
set _CPUTAPID $CPUTAPID
} else {
set _CPUTAPID 0x2ba01477
}
set _TARGETNAME $_CHIPNAME.cpu
swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID
target create $_TARGETNAME cortex_m -chain-position $_CHIPNAME.cpu
$_CHIPNAME.cpu configure -event examine-start { puts "START..." ; }
# It is important that "kinetis mdm check_security" is called for
# 'examine-end' event and not 'eximine-start'. Calling it in 'examine-start'
# causes "kinetis mdm check_security" to fail the first time openocd
# calls it when it tries to connect after the CPU has been power-cycled.
$_CHIPNAME.cpu configure -event examine-end {
kinetis mdm check_security
}
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size 0x1000 -work-area-backup 0
flash bank $_CHIPNAME.flash kinetis 0 0 0 0 $_TARGETNAME
cortex_m reset_config sysresetreq
#reset_config srst_only srst_nogate connect_assert_srst
adapter_khz 1000
$_TARGETNAME configure -event gdb-attach {
halt
}
$_TARGETNAME configure -rtos auto