Help! Need the correct openocd configuration for KEAZ128.

cancel
Showing results for 
Search instead for 
Did you mean: 

Help! Need the correct openocd configuration for KEAZ128.

2,053 Views
millerlowe
Contributor II

Hi Folks,

I posted this in a boot-loader group yesterday by mistake and only 11 people saw it.  I apologize those 11 who are probably now seeing it twice.  But my problem still exists.

We're using a KEAZ128 processor on a new project and I am currently trying to bring tool up with gdb on openocd using a CMSIS_DAP SWD adapter.  We use these tools for several other K and LPC series targets.

 

The info page says:

 

  • GDB debugger with support for the following debug interface hardware:
    • SEGGER J-Link (w/SEGGER GDB Server, Windows, Linux, Mac)
    • P&E Multilink (w/P&E GDB Server, Windows, Linux)
    • CMSIS-DAP (w/OpenOCD GDB and OpenSDA embedded circuit,Windows, Linux)
    • Command Line (CL) debugging with GDB and OpenOCD TCL

 

But I can't get a working configuration.  Does anyone know the target config file to use or have a working custom one?

Using the klx.cfg file I was able to initially connect to the processor and examine all the registers and memory but when I tried to flash with GDB it errord immediately and now the processor is acting like it's security bits are set.

#openocd #keaz128 #arm-none-eabi-gdb

4 Replies

707 Views
millerlowe
Contributor II

Hi Folks,

Using a late debug version of openocd I am now able to flash and debug my KEAZ128 processor with a IBDAP CMSIS-DAP probe and openocd.  GDB seems to work for debugging and flashing fine.   I'm not sure what the issues were that caused other folks to yield.

$ openocd -d2 -f interface/cmsis-dap.cfg -f target/ke0x.cfg -c "init" -c"reset halt" -c "flash write_image erase debug/kea.bin 0"
Open On-Chip Debugger 0.10.0+dev-00173-g496fcfd (2017-09-25-11:01)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : add flash_bank kinetis_ke ke.flash
adapter speed: 1000 kHz
none separate
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 1.0
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x0bc11477
Info : ke.cpu: hardware has 2 breakpoints, 2 watchpoints
Info : MDM: Chip is unsecured. Continuing.
Info : MDM: Chip is unsecured. Continuing.
target halted due to debug-request, current mode: Thread
xPSR: 0x41000000 pc: 0x000004e8 msp: 0x1ffff598
auto erase enabled
Info : KE06 sub-family
Info : Flash clock ready
Warn : flash configuration field erased, please reset the device
Info : Watchdog stopped
Info : Flash clock ready
Info : Kinetis KE: FLASH Write ...
wrote 2048 bytes from file debug/kea.bin in 0.510015s (3.921 KiB/s)

can also make/reload/and debug with gdb

$ arm-none-eabi-gdb debug/kea.elf
GNU gdb (GNU Tools for ARM Embedded Processors) 7.10.1.20160616-cvs
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from debug/kea.elf...done.
Reset_Handler () at /home/miller/src/keaz128/startup_SKEAZ1284.S:137
137 cpsid i /* Mask interrupts */
MDM: Chip is unsecured. Continuing.
target halted due to debug-request, current mode: Thread
xPSR: 0x41000000 pc: 0x000004e8 msp: 0x1ffff598
Loading section .interrupts, size 0xc0 lma 0x0
Loading section .flash_config, size 0x10 lma 0x400
Loading section .text, size 0x1f4 lma 0x410
Loading section .ARM, size 0x8 lma 0x604
Loading section .init_array, size 0x4 lma 0x60c
Loading section .fini_array, size 0x4 lma 0x610
Loading section .data, size 0x64 lma 0x614
Loading section .romp, size 0x18 lma 0x678
Start address 0x4e8, load size 848
Transfer rate: 830 bytes/sec, 106 bytes/write.
MDM: Chip is unsecured. Continuing.
target halted due to debug-request, current mode: Thread
xPSR: 0x41000000 pc: 0x000004e8 msp: 0x1ffff598
(gdb) make
/usr/bin/cmake -H/home/miller/src/keaz128 -B/home/miller/src/keaz128/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/miller/src/keaz128/build/CMakeFiles /home/miller/src/keaz128/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/miller/src/keaz128/build'
make -f CMakeFiles/FreeRTOS_lib.dir/build.make CMakeFiles/FreeRTOS_lib.dir/depend
make[2]: Entering directory '/home/miller/src/keaz128/build'
cd /home/miller/src/keaz128/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/miller/src/keaz128 /home/miller/src/keaz128 /home/miller/src/keaz128/build /home/miller/src/keaz128/build /home/miller/src/keaz128/build/CMakeFiles/FreeRTOS_lib.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/miller/src/keaz128/build'
make -f CMakeFiles/FreeRTOS_lib.dir/build.make CMakeFiles/FreeRTOS_lib.dir/build
make[2]: Entering directory '/home/miller/src/keaz128/build'
make[2]: Nothing to be done for 'CMakeFiles/FreeRTOS_lib.dir/build'.
make[2]: Leaving directory '/home/miller/src/keaz128/build'
[ 58%] Built target FreeRTOS_lib
make -f CMakeFiles/kea.dir/build.make CMakeFiles/kea.dir/depend
make[2]: Entering directory '/home/miller/src/keaz128/build'
cd /home/miller/src/keaz128/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/miller/src/keaz128 /home/miller/src/keaz128 /home/miller/src/keaz128/build /home/miller/src/keaz128/build /home/miller/src/keaz128/build/CMakeFiles/kea.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/miller/src/keaz128/build'
make -f CMakeFiles/kea.dir/build.make CMakeFiles/kea.dir/build
make[2]: Entering directory '/home/miller/src/keaz128/build'
make[2]: Nothing to be done for 'CMakeFiles/kea.dir/build'.
make[2]: Leaving directory '/home/miller/src/keaz128/build'
[100%] Built target kea
make[1]: Leaving directory '/home/miller/src/keaz128/build'
/usr/bin/cmake -E cmake_progress_start /home/miller/src/keaz128/build/CMakeFiles 0
(gdb) reload
MDM: Chip is unsecured. Continuing.
target halted due to debug-request, current mode: Thread
xPSR: 0x41000000 pc: 0x000004e8 msp: 0x1ffff598
Loading section .interrupts, size 0xc0 lma 0x0
Loading section .flash_config, size 0x10 lma 0x400
Loading section .text, size 0x1f4 lma 0x410
Loading section .ARM, size 0x8 lma 0x604
Loading section .init_array, size 0x4 lma 0x60c
Loading section .fini_array, size 0x4 lma 0x610
Loading section .data, size 0x64 lma 0x614
Loading section .romp, size 0x18 lma 0x678
Start address 0x4e8, load size 848
Transfer rate: 756 bytes/sec, 106 bytes/write.
MDM: Chip is unsecured. Continuing.
target halted due to debug-request, current mode: Thread
xPSR: 0x41000000 pc: 0x000004e8 msp: 0x1ffff598
(gdb) i b
No breakpoints or watchpoints.
(gdb) b main
Breakpoint 1 at 0x526: file /home/miller/src/keaz128/main.c, line 6.
(gdb) c
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.

Breakpoint 1, main (argc=0, argv=0x0 <__isr_vector>) at /home/miller/src/keaz128/main.c:6
6 int i=0;
(gdb) i r
r0 0x0 0
r1 0x0 0
r2 0x1ffff080 536866944
r3 0x0 0
r4 0x0 0
r5 0x0 0
r6 0x0 0
r7 0x1ffff580 536868224
r8 0x42100040 1108344896
r9 0x2000400 33555456
r10 0x1ffef598 536802712
r11 0x0 0
r12 0x200808 2099208
sp 0x1ffff580 0x1ffff580
lr 0x4c3 1219
pc 0x526 0x526 <main+10>
xPSR 0x61000000 1627389952
(gdb)

My gdb startup and some commands are using this .gdbinit file

$ cat .gdbinit
define reload
       monitor reset halt
       load
       monitor reset init
end

target extended-remote :3333
reload

0 Kudos

707 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Miller Lowe,

   I am afraid the openOCD can't support the KEA128, I also try it on my TRK-KEA128 with CMSIS DAP, and use KDS openocd, it can't download the code.

  You can check the openocd release note, whether it can support the KEA128 or not.

   I suggest you can choose JLINK or P&E micro debugger to download the code, or you also can use IAR or MDK with CMSIS DAP debugger.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

707 Views
vigneshbalaji
Senior Contributor I

Hi Kerry,

               What is the difference between CMSIS-DAP and JLink debugger?

0 Kudos

707 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi VIGNESH BALAJI,

   Just different debugger, both CMSIS-DAP and JLINK can download code and debug. Just from different 3rd part, then same function. But to the IDE, it may have different support situation. From example, to KEA128 CMSIS DAP in KDS, it can't work, but to JLINK, it works, P&E tool also works.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos