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

No hard fault with SoftDevice and RAM off after WFI

Hi Folks,

i have implementet a sleep mode by using only the RTC timer with the 32KHz OSC and the WFI instruction. The current consumtion is around 1.7µA (all peripherals including the RAM and HSXOSC is turned off). On timeout, the chip wake up and a hard fault interrupt is generated. In the Hard_Fault() handler the NVIC_SystemReset() is called and the controller will restart. The wakeup / restart reason is detected with the "NRF_POWER->GPREGRET" register. I have assigned a special value to the register before go to sleep mode. This works fine without SoftDevice. But if i use the SoftDevice (SD310 in this case) the controller hangs after wake up. The SD is disabled before power down the peripherals. It seems to be there is no hard fault condition generated in this case. Why?

Parents
  • If the controller awake (from WFI), the next statement from flash is executed or the interrupt handler address, in this case the RTC1 interrupt vector, is fetched from the vector table. In this moment, you are right, there is no (stack-) RAM to save the PC. So i think the hard fault is the last way out and is called without saving any data on stack. I think, the problem is the changed vector table when soft device is flashed on the chip.

Reply
  • If the controller awake (from WFI), the next statement from flash is executed or the interrupt handler address, in this case the RTC1 interrupt vector, is fetched from the vector table. In this moment, you are right, there is no (stack-) RAM to save the PC. So i think the hard fault is the last way out and is called without saving any data on stack. I think, the problem is the changed vector table when soft device is flashed on the chip.

Children
No Data
Related