bare-metal program to enter low-power IDLE

my minimal main() does the following, after coming out of reset with the MCU in its default state:

NRF_P1_S->DIRSET = 1;  // LED0 output
NRF_P1_S->OUTSET = 1l  // LED0 on
/* busy wait for 1 second */
NRF_P1_S->OUTCLR = 1l  // LED0 off
NRF_P1_S->PIN_CFG[14] = GPIO_PIN_CNF_INPUT_Msk;   // LED0 input, disconnected
__WFI();

according to my Joulescope, i drawing about 600 uA once i'm idle....  active current is as expected...

again, this is a completely bare-metal program -- no zephyr....

do i need to explicitly enable/disable some clock???

and do i need to set the core's SBC->SCR to 'deep-sleep' before the WFI???

Parents Reply
  • i'm using a joulescope js220 power analyzer for my measurements....  my nordic PPK-2 should arrive soon, which i'll use as well....

    my target board is the DK....   my test program is <200 bytes....  once it reaches main(), it does what the issue above noted....

    to make things even simpler, ALL i did was call __WFI()....  i didn't even configure a GPIO....

    this is essentially a HW question....  after the chip comes out of reset, what's the minimal amount of code required to enter IDLE (with current consumption in the 1-5 uA range)....  

Children
Related