That is probably an old topic, but after doing some research I could figure it out: calling sd_app_evt_wait()
on my nRF5832 + nRF5 v11.0.0 SDK + s132 causes my chip to reset. That is, it enters the sleep mode (I guess it does) and when it wakes up I get main()
called again and all the memory contents are lost. I wonder if that is expected behaviour or, else, the PC should resume from the same point it was after calling sd_app_evt_wait()
.
Also, I thought RAM retention was enabled by default so it is strange to me that my RAM changed after the wake up.
I am testing all that with the Debugger, in Keil 5.0.