Hello,
I am using nRF52832 and having a problem with the Low Power Mode. I am not sure if I am either not getting it to stay in low power mode when my UART is initialized, or if low power mode is using too much power.
When I do not even initialize the UART, my low power mode sees current usage in the 100s μA range
When I initialize my UART and then almost immediately uninitialize it, my sleep mode has a current draw of about 5-6mA. I have also disabled easy DMA to try to get the UART to use less power. Any ideas as to what is going on here? I have no other timers and am not connecting to it, so there should be no other events that wake it from this mode.
const app_uart_comm_params_t comm_params = { RX, TX, 0, 0, APP_UART_FLOW_CONTROL_DISABLED, false, UART_BAUDRATE_BAUDRATE_Baud115200 }; uint32_t err_code; APP_UART_FIFO_INIT(&comm_params, UART_RX_BUF_SIZE, UART_TX_BUF_SIZE, uart_event_handle, APP_IRQ_PRIORITY_LOW, err_code); error_code_check(err_code); APP_ERROR_CHECK(err_code); nrf_gpio_cfg(TX, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_H0D1, NRF_GPIO_PIN_NOSENSE); nrf_gpio_cfg(RX, NRF_GPIO_PIN_DIR_INPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_H0D1, NRF_GPIO_PIN_NOSENSE); //configure UART signal interrupt err_code = nrf_drv_gpiote_init(); APP_ERROR_CHECK(err_code); nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(true); in_config.pull = NRF_GPIO_PIN_PULLDOWN; APP_ERROR_CHECK(err_code); err_code = nrf_drv_gpiote_in_init(UART_ALERT, &in_config, uart_alert_handler); APP_ERROR_CHECK(err_code); nrf_drv_gpiote_in_event_enable(UART_ALERT, true); while(true) { nrf_drv_uart_rx_disable(&app_uart_inst); app_uart_close(); nrf_drv_gpiote_in_event_disable(UART_ALERT); nrf_drv_gpiote_in_uninit(UART_ALERT); NRF_UART0->EVENTS_RXDRDY = 0; //need this delay to let it go to sleep nrf_delay_ms(1000); //NVIC_ClearPendingIRQ(UART1_IRQn); //NVIC_ClearPendingIRQ(GPIO_ODD_IRQn); sd_app_evt_wait(); }
I have confirmed that the GPIOTE is not the issue in a separate isolated test. It seems to be something with the UART either causing a much higher current draw or not allowing the board to remain asleep