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

Blink an LED in Emulated System OFF ??

Hi, I would like to be able to provide a visual indicator such as a blinking LED when the chip is in the Emulated System OFF mode. Note that if the chip is in DEBUG mode and a System OFF command is issued, then the chip will go into emulated System OFF mode. In the reference manual, it recommends putting an infinite loop right after the System OFF instruction so that "normal" code will not be accidentally be executed. Well, instead of a loop that does nothing I would like to put code there to blink an LED. But I tried using my normal application timers and it did not seem to work. I also tried using nrf_delay_ms() but that did not work either. I hoped it would work because the reference manual says that the following subsystems are still active during Emulated System OFF: DIF, CLOCK, POWER, NVMC, MPU, CPU, CODE, and RAM. So my question: is it possible to do this, and if so what which type of timer is still functional in the emulated System OFF mode (a pointer to some sample code would be great!)? I am not using any soft device. Thanks!

  • Hi Jorn, I am using nrf51822, and SDK version 9 with armgcc, not an IDE. Your link does not seem to be the same problem because I am using nrf_delay_ms() in other parts of the code and it works fine in those.

  • Hello Kmoto

    I apologize for the late reply, we had holidays here all of last week.

    I have dug further into this, and it seems it is related to the same problem as in the link I provided you earlier.

    I have tested with both the old nrf_delay.h file that comes with SDK9, and the new one supplied in the link I provided. With the old file the chip will eventually enter a hardfault, but with the new file I have successfully blinked a led while in emulated system off, using both nrf_delay_ms and nrf_delay_us.

    Best regards

    Jørn Frøysa

Related