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

NRF52840 Consumption SDK15.2

Hi,

We have many projects based on nRF52832 SDK 12 and we are porting them to nRF52840 SDK15.2 to take advantage of the new BLE5 features.

The problem is that we are having troubles with the nRF52840 consumption. When idle, our old projects in SDK12 consumed a current of about 2-3 uA. The best we can do with SDK15.2 in 52840 is about 180 uA.

I think the problem is in the configuration, since the SDK15.2 is pretty confusing and not as simple as SDK12. We have many erratic behaviors, specially with the clocks modules. For example, if i don't init the timer module with app_timer_init() the consumption raises about 500uA. 

For reference, our projects use the advertising and scan modules, app_timer and the SPI.

Do you have a good template that is proven to consume 2 or 3 uA when idle, to start with? Do you have any tip of what are we probably doing wrong in the configuration?

Thanks in advance.

  • Hi,

    Most of the BLE examples in the will consume about 2-3 μA out of the box as long as you disable UART logging (enabled by default). We need to look more detailed at your application in order to see what you have such a high idle current consumption. Can you elaborate? also, have you attempted to strip out/disable parts of your application to narrow down what could cause the high current consumption?

  • I verified the code further and it seems that the high consumption is due to the SPI. In the code, i configure the SPI, do some task and then shutdown it with NRF_SPI0->ENABLE = 0, but the consumption does not decrease. If i don't initialize the SPI then the iddle current is 3uA as expected. Is something missing?

  • Hi,

    What else do you do in your code when you use SPI? You should not see a high current consumption after a SPI transaction. You can verify this by for instance taking the SPI SDK example, disabling UART logging and modifying it so it looks like this (doing a single transaction before going to sleep). There you should get a current is a few micro amps (verified on my side using a nRF52840 DK):

    int main(void)
    {
        bsp_board_init(BSP_INIT_LEDS);
    
        APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
        NRF_LOG_DEFAULT_BACKENDS_INIT();
    
        nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
        spi_config.ss_pin   = SPI_SS_PIN;
        spi_config.miso_pin = SPI_MISO_PIN;
        spi_config.mosi_pin = SPI_MOSI_PIN;
        spi_config.sck_pin  = SPI_SCK_PIN;
        APP_ERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, spi_event_handler, NULL));
    
        NRF_LOG_INFO("SPI example started.");
    
        // Reset rx buffer and transfer done flag
        memset(m_rx_buf, 0, m_length);
        spi_xfer_done = false;
        APP_ERROR_CHECK(nrf_drv_spi_transfer(&spi, m_tx_buf, m_length, m_rx_buf, m_length));
    
        while (!spi_xfer_done)
        {
            __WFE();
        }
    
        nrf_drv_spi_uninit(&spi);
    
        NRF_LOG_FLUSH();
    
        while (1)
        {
            __WFE();
        }
    }
    

  • Hi Einar,

    Using the nrf_drv_spi_uninit function the consumption decrease to 3uA, so the problem seems to be that NRF_SPI0->ENABLE=0 is not enough to shutdown the SPI.

    The only drawback is that our application is relatively time and consumption constraint, we are periodically enabling and disabling the SPI to lower the current and save battery. Already the nrf_drv_spi_uninit adds overhead compared to NRF_SPI0->ENABLE; in addition to this i have to reinitialize the entire SPI when re-enabling it? In the SDK12 NRF_SPI0->ENABLE=0 and NRF_SPI0->ENABLE=1 were enough to enable and disable SPI and get the lowest consumption.

  • Hi,

    You do not even need to call nrf_drv_spi_uninit(). If you comment it out in the code from the previous post you should still see good power consumption numbers. Can you say more about how you use SPI? Is it SPI or SPIM (with DMA), how is the driver configured, how does you SPI code look like?

Related