This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf51822 debug HardFault Blinky project with openocd

Hi, I am trying to debug the blinky project with Eclipse, openocd and st-link. No softdevice. This is the output I am using. nrf51822_xxaa.out

I am finally able to see the leds blinking in a custom board but if I try to debug the application I always get hardfault.

So, the application runs without debugging but I get hardfault when debugging. 

This is my .cfg


source [find interface/stlink-v2.cfg]
set WORKAREASIZE 0x4000
transport select "hla_swd"
source [find target/nrf51.cfg]

These are some screenshots of the debug output.

I am able to step until this point:

Then...

I think that's all from my side. Thank you very much in advance.

Regards

Parents
  • What is your application? is it using some RTOS ? I am not expert in OpenOCD, but I think based on the hardfault address we should be able to figure out what is going on inside your application.

    Normally when you see signal handler at 0xffffff9, then it means that your PC tried to execute some code from the end of the stack. Normally happens when

    • you have a stack overflow 
    • or when you are trying to derefer some pointers that are not properly initialized.
Reply
  • What is your application? is it using some RTOS ? I am not expert in OpenOCD, but I think based on the hardfault address we should be able to figure out what is going on inside your application.

    Normally when you see signal handler at 0xffffff9, then it means that your PC tried to execute some code from the end of the stack. Normally happens when

    • you have a stack overflow 
    • or when you are trying to derefer some pointers that are not properly initialized.
Children
Related