NRF52 Low Power Issue

21 Aug 2018

I am developing a project using nRF52832 and PAH8011ET heart rate sensor.

I am using this library https://os.mbed.com/users/pixus_mbed/code/PixArt_PAH8011_HeartRate_nRF52/

The heart rate sensor is working but the problem is that the controller doesn't go into low power with this library.

There is a file, pixart_heart_rate.cpp file, and in that a deque is being used. If I comment out that deque.push_back line, the controller does go into low power, but with that line uncommented, the controller doesn't go into low power.

The same thing happens if I use the fopen and fclose functions. If these functions are present in the code, the controller won't go into low power. I have found a workaround for this and now using the open and close functions, with these the controller does go in low power.

I am using mBed CLI with ARM v5 compiler and the release profile.

Does anyone has any idea why this is happening?

Thank you

17 Sep 2018

Hi Allan,

What version of Mbed OS are you using?

We think you are possibly observing this GitHub issue related to a 1MHz counter:

https://github.com/ARMmbed/mbed-os/issues/7763

We've had a look at that source file but it isn't obvious how the deque method is having an impact.

Are you removing all serial/print statements? We had one nRF user disable the UART directly and this resulted in lower power consumption. If you think this might be a problem, you should be able to use the following:

    NRF_UARTE0->ENABLE = 0;

-Ralph, Team Mbed

08 Oct 2018

Hello Ralph

I'm having the same issue and NRF_UARTE0->ENABLE = 0; certainly resolves it.

However, how can I then setup uart for use again!? NRF_UARTE0->ENABLE = 1; does not seem to work, i cannot use the serial port , the thread just hangs whenever I printf.

Basic code example im trying below NRF52832, MBED-0S 5.10

#include "mbed.h"

Serial pc(USBTX, USBRX, 115200); //2.133 ma impact on power, prevents deep sleep

int main() {
   
    while(1) {
        NRF_UART0->ENABLE        = 1;
        NRF_UART0->TASKS_STARTTX = 1;
        NRF_UART0->TASKS_STARTRX = 1;
    
        pc.printf("blah blah blah");
        
        NRF_UART0->TASKS_STOPTX = 1;
        NRF_UART0->TASKS_STOPRX = 1;
        NRF_UART0->ENABLE = 0;
        
        Thread::wait(5000); // only way to get 1.7ua sleep
    }
}

any help would be greatly appreciated.

15 Oct 2018

bump - this is causing big problems not being able use UART and then sleep

15 Oct 2018

Hi Ben, Could you please try this NRF fix that's in the works? https://github.com/ARMmbed/mbed-os/pull/8366

With this fix, you shouldn't have to directly modify NRF_UART0's members.

Thanks,

Naveen,

team mbed

16 Oct 2018

Thanks Naveen, is it possible to use this fix in the online compiler?

16 Oct 2018

Hi Ben, Unfortunately you can't pull it using online compiler. You need to do it with git and hence possible to do it with the Command Line Interface. https://github.com/ARMmbed/mbed-cli

Also, the change is going through the review and merge process. Once it is merged to mbed mainline, you can use Online compiler.

Thanks,

Naveen

Team mbed.

17 Oct 2018

Thanks, ok will give that a go and feedback