Skip to content

Commit

Permalink
boards/frdm: use a more reliable reset_config
Browse files Browse the repository at this point in the history
TODO THIS SHOULD BE TESTED AND JUSTIFIED

I checked the 'target/klx.cfg' and 'target/kx.cfg' and they both set
'reset_config srst_nogate' so re-add it in the common file.

Also enable 'connect_assert_srst' to allow flashing when the cpu does
not answer anymore.
I added the command DBG handling when using `connect_assert_srst`.
  • Loading branch information
cladmi committed Mar 14, 2019
1 parent 737e889 commit 754139c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions boards/common/frdm/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ endif
# Configuration for OpenOCD v0.10.0 and newer
export OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/openocd-$(CPU_FAMILY).cfg

# call a 'reset halt' command before starting the debugger
# it is required as `connect_assert_srst` is set
export OPENOCD_DBG_START_CMD = -c 'reset halt'

# Check the flash configuration field before flashing
export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield-elf.sh

Expand Down
2 changes: 1 addition & 1 deletion boards/common/frdm/dist/old-openocd-kx.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size 0x1000 -work-a
flash bank $_CHIPNAME.flash kinetis 0 0 0 0 $_TARGETNAME

cortex_m reset_config sysresetreq
#reset_config srst_only srst_nogate connect_assert_srst
reset_config srst_only srst_nogate connect_assert_srst

adapter_khz 1000

Expand Down
2 changes: 1 addition & 1 deletion boards/common/frdm/dist/openocd-klx.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ transport select swd
# Kinetis L series CPUs
source [find target/klx.cfg]

reset_config srst_only
reset_config srst_only srst_nogate connect_assert_srst

$_TARGETNAME configure -event gdb-attach {
halt
Expand Down
2 changes: 1 addition & 1 deletion boards/common/frdm/dist/openocd-kx.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Kinetis K series CPUs
source [find target/kx.cfg]

reset_config srst_only
reset_config srst_only srst_nogate connect_assert_srst

$_TARGETNAME configure -event gdb-attach {
halt
Expand Down

0 comments on commit 754139c

Please sign in to comment.