Re: Debugging NRF51822 (OpenOCD + GDB)

Scott Nelson <scott@...>

On Aug 22, 2017, at 3:27 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...> wrote:


I wrote into the list about an issue I was having with an NRF51822 board a couple days ago. It’s occasionally ending up in _SysFatalErrorHandler but I’m still not sure why (though I suspect it may be something BLE related).
I can help you if its an issue with BLE, can you give details of the application you are using and the symptoms of the issue?
My hunch that it’s BLE related is very anecdotal (I did not notice the issue before adding the BLE component). Probably not worth pursuing this hunch too far until I can figure out what code is causing the fatal error. My code configures a single BLE peripheral and periodically calls bt_gatt_notify.

I’m trying to attach a debugger with the ultimate goal of printing a stack trace when the code ends up in the error handler. First I’m starting an OpenOCD server:

$ openocd -f interface/stlink-v2.cfg -f target/nrf51.cfg

And then trying to connect GDB:

$ arm-none-eabi-gdb outdir/nrf51_blenano/zephyr.elf
(gdb) set verbose on
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.
Reading in symbols for /Users/scott/Code/bms/zephyr/lib/libc/minimal/source/stdout/fprintf.c...done.
fprintf (F=<optimized out>, Abort trap: 6

The OpenOCD logs show:

accepting 'gdb' connection on tcp/3333
dropped 'gdb' connection

Any idea why I’m getting this error? I’m new to OpenOCD and GDB so I’m not sure if this is an issue with my toolchain setup or if it is something related to Zephyr. Any help would be much appreciated!
I have no experience myself with OpenOCD, I always have used our DK boards with JLinkGDBServer or pyocd-gdbserver (mbed debugger host firmware).

Zephyr-users mailing list

Join to automatically receive all group messages.