Power Consumption Fix - Noaman-strat/nrf5 GitHub Wiki
1. Disable NRF_LOG
// <e> NRF_LOG_ENABLED - nrf_log - Logger
//==========================================================
#ifndef NRF_LOG_ENABLED
#define NRF_LOG_ENABLED 0
2. Adjust the idle_state_handle(void) function
static void idle_state_handle(void)
{
nrf_pwr_mgmt_run();
/* comment out this section
for some reason, the NRF_LOG_PROCESS is not returning false
if (NRF_LOG_PROCESS() == false)
{
nrf_pwr_mgmt_run();
}
*/
}
3. Comment out NRF LOG related statements:
int main(void)
{
// Initialize.
// log_init();
timers_init();
// leds_init();
power_management_init();
ble_stack_init();
advertising_init();
// Start execution.
// NRF_LOG_INFO("Beacon example started.");
advertising_start();
// Enter main loop.
for (;; )
{
idle_state_handle();
}
}
4. DCDC - if voltage is lower than 3.6V
#ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCEN
#define NRFX_POWER_CONFIG_DEFAULT_DCDCEN 1
#endif
// <q> NRFX_POWER_CONFIG_DEFAULT_DCDCENHV - The default configuration of High Voltage DCDC regulator
// <i> This settings means only that components for DCDC regulator are installed and it can be enabled.
#ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCENHV
#define NRFX_POWER_CONFIG_DEFAULT_DCDCENHV 0
#endif
#ifndef POWER_CONFIG_DEFAULT_DCDCEN
#define POWER_CONFIG_DEFAULT_DCDCEN 1
#endif
// <q> POWER_CONFIG_DEFAULT_DCDCENHV - The default configuration of High Voltage DCDC regulator
// <i> This settings means only that components for DCDC regulator are installed and it can be enabled.
#ifndef POWER_CONFIG_DEFAULT_DCDCENHV
#define POWER_CONFIG_DEFAULT_DCDCENHV 0
#endif
5. DCDC - If voltage is higher than 3.6V
In the above code for dcdc, POWER_CONFIG_DEFAULT_DCDCENHV 1
and NRFX_POWER_CONFIG_DEFAULT_DCDCENHV 1