This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Power save - UART disable

nrf52833, custom application based BLE Central Uart Project.

s140_nrf52_7.2.0

Our average Power use in the application is 1.5mAmps.  What is the proper way to manage the power

to the UART entering  power save(idle) mode?  And to restart the UART on wakeUp event?

Thanks,

Dan

void nrf_pwr_mgmt_run(void)
{
PWR_MGMT_FPU_SLEEP_PREPARE();
PWR_MGMT_SLEEP_LOCK_ACQUIRE();
PWR_MGMT_CPU_USAGE_MONITOR_SECTION_ENTER();
PWR_MGMT_DEBUG_PIN_SET();

// stop UART, and prepare IO for low power
// nrf_drv_uart_t tmp = NRF_DRV_UART_INSTANCE(0);
// nrf_drv_uart_uninit(&tmp);

// Wait for an event.
#ifdef SOFTDEVICE_PRESENT
if (nrf_sdh_is_enabled())
{
ret_code_t ret_code = sd_app_evt_wait();
ASSERT((ret_code == NRF_SUCCESS) || (ret_code == NRF_ERROR_SOFTDEVICE_NOT_ENABLED));
UNUSED_VARIABLE(ret_code);
}
else
#endif // SOFTDEVICE_PRESENT
{
// Wait for an event.
__WFE();
// Clear the internal event register.
__SEV();
__WFE();
}

// restart UART
uart_init();
PWR_MGMT_DEBUG_PIN_CLEAR();
PWR_MGMT_CPU_USAGE_MONITOR_SECTION_EXIT();
PWR_MGMT_SLEEP_LOCK_RELEASE();
}

Parents
  • Hi,

    If you're doing it that way then I would move the un initializing and re- initializing of the peripheral right outside of where nrf_pwr_mgtmt_run() is called, something like this:

    nrf_drv_uart_t tmp = NRF_DRV_UART_INSTANCE(0);
    nrf_drv_uart_uninit(&tmp);
    
    nrf_pwr_mgmt_run();
    
    uart_init();

    You might have to call the STOP task before un-initializing the module.

    regards

    Jared 

Reply
  • Hi,

    If you're doing it that way then I would move the un initializing and re- initializing of the peripheral right outside of where nrf_pwr_mgtmt_run() is called, something like this:

    nrf_drv_uart_t tmp = NRF_DRV_UART_INSTANCE(0);
    nrf_drv_uart_uninit(&tmp);
    
    nrf_pwr_mgmt_run();
    
    uart_init();

    You might have to call the STOP task before un-initializing the module.

    regards

    Jared 

Children
No Data
Related