My program doesn't use SoftDevice.
In Reference Manual 3.0 page 52: "A HFCLKSTOP task will stop the HFCLK oscillator. However the HFCLKSTOP task can only be sent after the STATE field in the HFCLKSTAT register indicates a 'HFCLK running' state." Does it mean the stop task can only be triggered when XOSC is running, or either of XOSC and RC is running?
- If the former is TRUE (that is, XOSC must be running before triggering a stop task), what will happen if it is stopped, or it is starting but before started?
- If the latter is TRUE, I think either of the TWO sources must be running when CPU is running, so there is nothing to check before stopping XOSC.
- For "HFCLKRUN", I think it is set immediately after XOSC start task is triggered. And event "HFCLKSTARTED" means the XOSC is stable. Do I understand them correctly?
I want my program to do this:
- After powerup, turn on XOSC HFCLK, but don't wait until it is started (event HFCLKSTARTED).
- Before WFI, stop HFCLK.
- Next thing of WFI is start XOSC again, but still don't wait for its being ready.
- In other part of the program where XOSC HFCLK is mandatory (such as Radio), check and wait XOSC to be ready.
- In this way, I don't have to wait for XOSC to be ready every time an interrupt is issued, and thus a lot of time could be saved.
So it is possible stop task is triggered while XOSC is starting but before it is ready. And I would like to know if it is safe to do so.