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

Low power mode running MyNewt on nrf52832 DK

Hi,

    I'm working on putting our system into low power idle mode. We use MyNewt to build our application. In order to get to the lowest power, I disabled BLE and all our drivers except UART for console and debug messages. We have a command that can shut off a bunch of stuff and call __WFE and __SEV(). The code is tested on a nrf52DK(PCA10040 1.2.4, 2018.23). I checked the current on P22 on the board and the measurement was 270uA @ 3.8V from external power supply. This is far away from what your data sheet described. I have checked the setting everywhere and can not figure out what else I need to turn off. Can you please provide some suggestion where I should check? 

Thank you,

Min-Ching

Parents
  • Hi,

    except UART for console and debug messages.

    UART peripheral requires HFCLK and if you run HFCLK with the 64MHz crystal current consumption will be ~250uA.

  • Hi Siguard, 

        Thanks for the info. It looks like my HFCLK is still up and running. One thing I didn't mentioned in my original post is I did disable UART before WFE. Is there a way to check which peripheral is still using HFCLK? 

    Thank you,

    Min-Ching

  • Could you try to stop the UART transmitter/receiver, before disabling it ?

    NRF_UARTE0->TASKS_STOPRX = 1;
    NRF_UARTE0->TASKS_STOPTX = 1;

  • Hi Siguard,

        Sorry for late reply. I was out of office. I already tried this. It didn't work. I still see the current is >270uA. 

    Any other suggestions?

    Min-Ching

  • I would like to share my test code here. FYI.

    enter_sleep_mode_cb(struct os_event *ev)

    {

        power_mode_e state = *(power_mode_e *)ev->ev_arg;

        if(state == POWER_STATE_NONE)

        {

            // overwrite the power state

            ;

        }

        // call hal power API

        hal_bsp_power_state(state);

        //1. put peripheral into sleep

        // excluded all driver code for test

        // Turn off UART/SPI/I2C

        hal_uart_stop_tx(0);

        hal_uart_stop_rx(0);

        // uart is turned off here by os_dev_suspend_all

        os_dev_suspend_all(0xFFFFFFFF, 1);

        // turn off timer

        hal_timer_deinit(0);

        hal_timer_deinit(1);

        hal_timer_deinit(2);

        hal_timer_deinit(3);

        hal_timer_deinit(4);

        //disable i2c

        hal_i2c_disable(0);

        //disable spi

        hal_spi_disable(1);

        // turn off GPIOE

        //something new from mynewt

        NRF_CLOCK->TASKS_HFCLKSTOP = 1;

        //2. put CPU into wait for event mode

        // Wait for an event

        __WFI();

        // clear the internal event register

        __SEV();

        __WFI();

        //3. wake up process

        // enable UART/SPI/I2C

        //4. wake up complete

        //console_printf("System awake\r\n");

    }

Reply
  • I would like to share my test code here. FYI.

    enter_sleep_mode_cb(struct os_event *ev)

    {

        power_mode_e state = *(power_mode_e *)ev->ev_arg;

        if(state == POWER_STATE_NONE)

        {

            // overwrite the power state

            ;

        }

        // call hal power API

        hal_bsp_power_state(state);

        //1. put peripheral into sleep

        // excluded all driver code for test

        // Turn off UART/SPI/I2C

        hal_uart_stop_tx(0);

        hal_uart_stop_rx(0);

        // uart is turned off here by os_dev_suspend_all

        os_dev_suspend_all(0xFFFFFFFF, 1);

        // turn off timer

        hal_timer_deinit(0);

        hal_timer_deinit(1);

        hal_timer_deinit(2);

        hal_timer_deinit(3);

        hal_timer_deinit(4);

        //disable i2c

        hal_i2c_disable(0);

        //disable spi

        hal_spi_disable(1);

        // turn off GPIOE

        //something new from mynewt

        NRF_CLOCK->TASKS_HFCLKSTOP = 1;

        //2. put CPU into wait for event mode

        // Wait for an event

        __WFI();

        // clear the internal event register

        __SEV();

        __WFI();

        //3. wake up process

        // enable UART/SPI/I2C

        //4. wake up complete

        //console_printf("System awake\r\n");

    }

Children
Related