Code: Select all
$ cat /usr/share/openocd/scripts/board/myboard.cfg
source [find interface/jlink.cfg]
transport select swd
source [find target/stm32f0x.cfg]
telnet_port 4444
gdb_port 3333
adapter_khz 10
init
reset halt
I can run openocd, and according to the log below, it seems to work fine:
Code: Select all
# openocd -f /usr/share/openocd/scripts/board/myboard.cfg
Open On-Chip Debugger 0.9.0-dev-00156-gc0b8e60 (2016-05-18-09:19)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : JLink SWD mode enabled
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
adapter speed: 10 kHz
Info : J-Link V9 compiled Aug 23 2018 09:45:44
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 93000
Info : J-Link hw type J-Link
Info : J-Link max mem block 69416
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0xffffffff
Info : Vref = 3.320 TCK = 0 TDI = 0 TDO = 0 TMS = 1 SRST = 1 TRST = 0
Info : J-Link JTAG Interface ready
Info : clock speed 10 kHz
Info : SWD IDCODE 0x0bb11477
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0x080000c0 msp: 0x20000400
In a second console I execute gdb debugger:
Code: Select all
# arm-none-eabi-gdb
(gdb) target remote localhost:3333
(gdb) symbol-file /path/to/myproject.elf
(gdb) b myfunction
(gdb) cont
After very few instructions stepped with some dificulty, some errors appear on the openocd console:
Code: Select all
Error: SWD ack not OK: 4 FAULT
Error: Failed to read memory at 0xfffffff1
Error: SWD ack not OK: 4 FAULT
Error: Failed to read memory at 0xfffffff1
Error: SWD ack not OK: 4 FAULT
Error: Failed to read memory at 0xfffffff2
And the gdb console completely hangs.
Does some of you have some experience with this JTAG debugger? Can it be configured to be completely stable and functional?
Thanks in advance!