Hello all,
I've been playing around with some FRDM-KL02 boards, as I want to use the MCU in a board design of my own, but I wanted to make sure I could program it. I can build and compile fine from the KSDK. With CMSIS-DAP on the OpenSDA interface, I am able to program and debug the board correctly through Eclipse (Mars.1) or the KDS (3.1.0) using OpenOCD (0.9.0). However, it is very slow. I have an Olimex ARM-USB-OCD-H that I would like to use, through a JTAG-SWD adapter, and I have bodged together some configuration files for it (I don't really understand the ins and outs of it). From the command line, I can load a .elf onto the board fine, and step through it. If I handle the loading in the .cfg file, disable 'Load executable' in eclipse, and run the .cfg file from eclipse, it will load and allow me to debug exactly as I want (and is much faster than the OpenSDA interface). If I let eclipse handle the loading of the binary however, it reliably ends up in 'UART0_IRQHandler() at startup, before reaching main(), and won't do anything else. This means I have to hard code the path to the binary in the OCD .cfg file for every project, which isn't ideal.
I'm very new to the world of embedded, I've only played around with arduinos a little before, so if anyone has any suggestions on what to try next I would be all ears. Ideally, I'd like to get Eclipse loading the binaries, but I don't know where to start looking to resolve this. Is there any way to see what the settings in Eclipse translate to in terms of OpenOCD commands?
Alternatively, is there any way to pass the binary path to the .cfg file, so I don't have to go manually hard coding the paths in the .cfgs for every project?
Many thanks,
George
P.S. the current configuration script, a conglomerate of different snippets I found across the internet that seems to work, but I don't know why:
source [find /opt/IDE/openocd/olimex-arm-usb-ocd-h.cfg]
source [find /opt/IDE/openocd/olimex-arm-jtag-swd.cfg]
source [find /opt/IDE/openocd/frdm-kl02z.cfg]
adapter_nsrst_assert_width 10
adapter_nsrst_delay 2
reset_config srst_only
adapter_khz 500
init
reset halt
wait_halt
mww 0x00000000 0x01
sleep 200
flash write_image erase /home/ubo/workspace/blink/Debug/blink.elf
verify_image /home/ubo/workspace/blink/Debug/blink.elf
reset run
mdw 0x00000000
sleep 200
$_TARGETNAME configure -event gdb-attach {
halt
}
reset run