Hello to all,
We have developed our application & the following platform we are using:
In our application we have used ble_app_uart example with SAADC because our sensor is analog. We also made custom PCB using nRF52840 and it working well not an issue. But our problem is very too much high current consumption is sleep mode means system OFF mode.
Here is below measured analysis with the help of Nordic Power Profile kit:
We have disabled all used peripheral before enter device into sleep mode as like below:
void sleep_mode_enter() { uint32_t err_code; NRF_LOG_INFO("Sleep mode Enter"); flash_data_sending = false; start_measurement = false; nrf_gpio_pin_clear(SENSOR_PIN); // OFF Sensor nrf_gpio_pin_set(GREEN_LED_PIN); // OFF Green LED nrf_gpio_pin_set(BLUE_LED_PIN); // OFF BLUE LED stop_adc(); err_code = app_uart_close(); APP_ERROR_CHECK(err_code); NRF_LOG_INFO("UART close: %d", err_code); } void stop_adc() { nrf_drv_timer_disable(&m_timer); nrf_drv_timer_uninit(&m_timer); nrf_drv_ppi_channel_disable(m_ppi_channel); nrf_drv_ppi_uninit(); NRF_SAADC->TASKS_STOP = 1; nrf_drv_saadc_uninit(); }
We have tested our hardware and sure this not hardware problem because when our device enter into deep sleep mode system OFF that time the current consumption near about 0.7uA to 1uA. Even when our designed firmware upload into nRF52840 DK and measured consumption using PPK that time got same results.
Questions:
Will you please suggest any solution, We should need to optimize this consumption to increase battery life because our sensor devices is battery operated.
Looking forward your response..!!
Thanks in advanced..!!
Hi Simonr,
I have resolved this issue by calling sleep mode enter in main function by proper way as below:
for (;;) { if (sleep_mode_enable == true) { sleep_mode_enter(); sleep_mode_enable…
Sorry my mistake got it for nRF52840 the workaround was:
void disabled_uart(void) { uint32_t err_code = app_uart_close(); /* Workaround by disabling the UART peripherals due to Nordic SDK15.0 issue…
Hi Vishal
When using this workaround to power down the UARTE, you have to reconfigure and reinitialize UARTE when turning it on again (when waking up).
Best regards,
Simon
Hi
Do you call a sleep mode function after disabling all your functions, because I can't see that you set sd_power_system_off() anywhere in the attached code snippet. If not, your device will still be on, just not do anything. See this sleep mode enter function for reference:
/**@brief Function for putting the chip into sleep mode. * * @note This function will not return. */ static void sleep_mode_enter(void) { ret_code_t err_code; err_code = bsp_indication_set(BSP_INDICATE_IDLE); APP_ERROR_CHECK(err_code); // Prepare wakeup buttons. err_code = bsp_btn_ble_sleep_mode_prepare(); APP_ERROR_CHECK(err_code); // Go to system-off mode (this function will not return; wakeup will cause a reset). err_code = sd_power_system_off(); APP_ERROR_CHECK(err_code); }
Thanks for fast reply...
Yes this function has for enter device into deep sleep mode like same as you provided:
void deep_sleep_mode_enter(void) { NRF_LOG_INFO("Deep Sleep mode Enter"); deep_sleep_enter = false; nrf_gpio_pin_clear(SENSOR_PIN); // OFF Sensor nrf_gpio_pin_set(BLUE_LED_PIN); // OFF BLUE LED nrf_gpio_pin_set(GREEN_LED_PIN); // OFF Green LED nrf_gpio_pin_set(RED_LED_PIN); // OFF Red LED uint32_t err_code = bsp_indication_set(BSP_INDICATE_IDLE); APP_ERROR_CHECK(err_code); // Prepare wakeup buttons. err_code = bsp_btn_ble_sleep_mode_prepare(); APP_ERROR_CHECK(err_code); // Go to system-off mode (this function will not return; wakeup will cause a reset). err_code = sd_power_system_off(); // ALl internal system clock functionality turn OFF APP_ERROR_CHECK(err_code); }
But our sensor device not goes into deep sleep mode (System OFF) it will go into sleep mode (System ON) keep RTC running and wake up as per time configured and take measurement.
When device is not using we put device into deep sleep and got current consumption = 1 - 5 uA which is acceptable for us.
But when device working after taking sensor data it will go into sleep mode and will wake up as per configured time. In this mode the current consumption = 500 - 600 uA. Which is very high.
We are trying to reduced this consumption got one issue for enabled and disabled UART peripheral. When i comment uart_init() function from my main. Then measured consumption with PPK got 31uA.
Whats going wrong with UART module enabled or disable, Will you please suggest correct way for nRF52840 with SDK 15.0 version.
Thanks...
Ok, sorry for the misunderstanding, I didn't get that you wanted system ON mode. I think what is wrong is that you are just closing UART and not disabling it, these are two different functions. Please try using the nrf_uart_disable function before going to sleep, and the nrf_uart_enable when during wake-up.
I have used this for disable UART peripheral:
void disabled_Uart(void) { NRF_UARTE0->TASKS_STOPTX = 1; NRF_UARTE0->TASKS_STOPRX = 1; NRF_UARTE0->ENABLE = 0; }
But still get same consumption. Will you please tell me How i use nrf_uart_disable function with pass few arguments.
Hi Simon,
After read some questions on developer zone regarding nRF52840 UART, In that got 2 question that says SDK issue to disabled UART for nRF52840. Here is that two questions link Link-1 and Link-2
Is this issues in SDK correct, If yes will please suggest me where should i need to change in my current using SDK that will fix that issue. Because still we are facing problem for disabled UART module.