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

Wakeup Interrupt Controller

Hi, we are seeing subtle timing differences in code execution between when we have a debugger attached or not (same build of code). 

Does the nRF52832 implement the optional wakeup interrupt controller https://developer.arm.com/docs/dui0553/a/the-cortex-m4-processor/power-management/the-optional-wakeup-interrupt-controller as this may explain the issues we see?

  • The debugger actually disables "deep sleep" entirely when connecting.

    Without the debugger, HFINT (or HFCLK) is stopped during sleep (WFE/WFI) and thus must be restarted before wakeup. With a debugger connected, HFINT (or HFCLK) runs all the time.

    Since Systick is fed from the HF clock, it can be used to "measure" how long the HF oscillator actually runs. Just configure it for 100 ints/sec, count the actual occuring interrupts and you have a "usage percent" value once per second. And yes, with a debugger you'd get full 100ints/sec.

Related