I had a project that worked just fine with the default power management settings.
Once I turned on the POWER_SAVING flag, the device started getting stuck when sleeping from the main loop.
Specifically, This behavior is presented in void halSleep( uint32 osal_timeout ) in hal_sleep.c, in line 344:
// check if radio allows sleep, and if so, preps system for shutdown
if ( LL_PowerOffReq(halPwrMgtMode) == LL_SLEEP_REQUEST_ALLOWED )
When stepping over the call to LL_PowerOffReq, the debugger stops responding and the device probably does too, for no good reason. When manually pressing the "break" button in the workbench, I reach llStopTimer2(), but never leaves there.
I can't step-in to the function because it has no source. When stepping through the assembly it's difficult to determine when exactly it gets stuck, since it does all sorts of banked-code trickery, various jumps etc, and the debugger responds VERY slowly to single-instruction stepping (don't understand why).
This happens right on the first sleep the device encounters. I'm working without any optimizations. Using CC-Debugger.
Any help will be appreciated.