Re: NRF51822 hanging


Carles Cufi
 

-----Original Message-----
From: Boie, Andrew P [mailto:andrew.p.boie@intel.com]
Sent: 14 August 2017 21:03
To: Scott Nelson <scott@scottnelson.co>; Cufi, Carles
<Carles.Cufi@nordicsemi.no>
Cc: zephyr-users@lists.zephyrproject.org

-----Original Message-----
From: zephyr-users-bounces@lists.zephyrproject.org
[mailto:zephyr-users- bounces@lists.zephyrproject.org] On Behalf Of
Scott Nelson
Sent: Monday, August 14, 2017 11:06 AM

The board is one of these:
http://www.waveshare.com/nrf51822-eval-kit.htm I have been flashing
it with STLink + OpenOCD and I’m trying to figure out how I can debug
the chip with that setup + GDB. I am not using the Nordic dev kit.
Let me know if there’s any additional info I can provide and thanks for
you help!

Is there a way I can override the Zephyr fault hander so that I could,
for example, flash an LED or repeatedly log something to the serial
output?

Yes. _SysFatalErrorHandler is declared __weak just for this purpose.

In your application, implement:

void _SysFatalErrorHandler(unsigned int reason, const NANO_ESF *pEsf)

And implement whatever policy you would like for fatal errors.
The default implementation for ARM is in
arch/arm/core/sys_fatal_error_handler.c
Thanks for the clarification Andrew, I actually always set the breakpoint in _NanoFatalErrorHandler() but it's really good to know that there's the user version declared weak.

Carles

Join users@lists.zephyrproject.org to automatically receive all group messages.