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

Can't debug LBS example, but yes HRS

Hi

Maybe this is a silly question, but I'm getting into desperation!!!

The problem is that playing with the LBS example (github.com/.../nrf51-ble-app-lbs), I've noticed I can't debug it. Every time I set a breakpoint, or I pause the execution, the next I get is a HardFault handler. I've read in the forum that this situation is possible when the SD is enabled. So everything is OK until here.

But I've noticed too that when playing with the HRS example, I'm able to set up breakpoints, and execution follows correctly after them. For example, I've setted up a breakpoint in the main loop, right after the advertising_init(), and when I resume the execution, there's no problem, and the execution stops again in my breakpoint. Doing the same operation with the LBS example, I only stop in the breakpoint the first time. The following I get is a HardFault handler.

So, what's happening? What's the difference? I'm getting crazy?

Thanks you in advance

Regards,

Elena

  • Do these two example projects come from the same SDK version? If they don't, maybe the problem comes from the version of your SOFTDEVICE. Change other versions of SOFTDEVICE and try again.

  • Hi

    False alarm. It was my fault. The difference was that the assert_nrf_callback() was empty in the LBS example, and in the HRS was filled with a NVIC_SystemReset(). So every time I was pausing the execution, the LBS example was going to a HardFault handler, and the HRS was restarting, but not resuming the execution. I didn't realize about this until now.

    Just more question: Is there any way to debug using a JTAG? I feel very disturbing this inconvenience.

    Thanks you in advance.

    Cheers,

    Elena

Related