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

How to identify reset reason

hello,

I'm using S132/nRF52/SDK11.

I start a firmware development based on Nordic UART example, I kept the BLE NUS part (I loop back the data received over BLE) and removed the usage of the UART peripheral. I observe a strange behaviour.

I have cleaned the code, made some modules so that the main file is minimalistic (I mainly moved the example code into C modules).

The main() function does nothing else but initializing the BLE NUS service and start advertising. The endless for() loop is empty. A breakpoint which I set before the endless loop shows me that it is periodically reached, this means that the execution is periodically restarted.

Could someone inform me how I can identify the source of this restart? For sure I made something wrong when I moved/cleaned the example project but I am unable to fin what.

Without breakpoint and using RTT_WriteString() function, it appears that there is no restart => the use of the debugger make the execution restart.

Thanks in advance for your help.

Parents
  • Hi

    Softdevice asserts are normal when you use breakpoints. You usually can step through the code until you have a call to the softdevice, then the softdevice will assert. You also can not step into softdevice code. So the way to debug with softdevice is to set a breakpoint and step to the next softdevice call. If you want to debug beond the next softdevice call, then set a breakpoint after the softdevice call and restart program execution.

Reply
  • Hi

    Softdevice asserts are normal when you use breakpoints. You usually can step through the code until you have a call to the softdevice, then the softdevice will assert. You also can not step into softdevice code. So the way to debug with softdevice is to set a breakpoint and step to the next softdevice call. If you want to debug beond the next softdevice call, then set a breakpoint after the softdevice call and restart program execution.

Children
No Data
Related