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

Simple nRF51822 sleep example

Is there an example for sleeping? I just want to put this thing to sleep drawing minimum current and have it wake up on a RTC timeout, but do not seem to be able to achieve anything less than 3.4mA.

Parents
  • Hi

    Also a more recent version of the powerdown examples is available here on Nordic's Github page

    There is also a current consumption guide availale here

  • Thanks Stefan. That's exactly what I was looking for. I took the main.c from your system-on-wakeup-on-rtc example, removed the GPIO LED and buttons stuff and compiled it in our build environment (Ubuntu build machine/GCC) in place of our main.c. When I run it on the PCA1004 board though, it doesn't appear to be waiting for the RTC interrupt. I am using GDB and the J-Link Lite and I've set breakpoints in the ISR as well as after the __WFE(). Occationally (randomly) it hits the ISR breakpoint, but mostly it doesn't go to sleep and just skips over the WFE hiting my breakpoint straight after. The weirdest thing though is that if I remove that breakpoint to see what the current draw is and then hit pause, it ends up in a hardfault condition.

    EDIT: On further testing, it looks like the hardfault is occurring on return from the ISR.

Reply
  • Thanks Stefan. That's exactly what I was looking for. I took the main.c from your system-on-wakeup-on-rtc example, removed the GPIO LED and buttons stuff and compiled it in our build environment (Ubuntu build machine/GCC) in place of our main.c. When I run it on the PCA1004 board though, it doesn't appear to be waiting for the RTC interrupt. I am using GDB and the J-Link Lite and I've set breakpoints in the ISR as well as after the __WFE(). Occationally (randomly) it hits the ISR breakpoint, but mostly it doesn't go to sleep and just skips over the WFE hiting my breakpoint straight after. The weirdest thing though is that if I remove that breakpoint to see what the current draw is and then hit pause, it ends up in a hardfault condition.

    EDIT: On further testing, it looks like the hardfault is occurring on return from the ISR.

Children
No Data
Related