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

Is critical section needed for glitch-less implementation of CPU sleep?

Hello,

I have the same question as mentioned in this article:

https://devzone.nordicsemi.com/f/nordic-q-a/19252/how-to-avoid-interrupt-handling-is-not-missed-with-sd_app_evt_wait

Additional question, just to make sure: For a glitch-free implementation,  do I need the second code part including the "sd_nvic_critical_region_enter(...);"?

Or does it also work (glitch free) with the first implementation without the critical section? I just want to make sure, if I am missing something. In my opinion, I need the critical section absolutely.

Thank you,
Regards

Parents Reply
  • Sorry for asking more deeply:

    You said, the event register will be set AFTER the ISR is serviced. Does that mean, if I use the enter critical section function before calling sd_app_evt_wait() then the CPU will go to sleep and never wake up due to disabled ISR's and never setted event register?

    Or is it more likely that the event register is ALWAYS set, regardles if ISR is called or not?

    Thank you!

Children
Related