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

nrf_serial.h Power Consumption issue

Hi,

I have a custom board in which i am using nRF52840 with SDK version is 16.0.0.

I have tested app_uart library its working Ok and current consumption is 6 uA in deep sleep. but i cant use two serial port in app_uart library so i have to go for nrf_serial.h

i am using following two Function for uart init and uninit.

void usart0_init()
{
	NRF_SERIAL_DRV_UART_CONFIG_DEF(m_uarte0_drv_config,UART0RX_PIN,UART0TX_PIN,RTS_PIN_NUMBER,CTS_PIN_NUMBER,NRF_UART_HWFC_DISABLED,NRF_UART_PARITY_EXCLUDED,NRF_UART_BAUDRATE_9600,UART_DEFAULT_CONFIG_IRQ_PRIORITY);
	
	ret_code_t ret;
	ret = nrf_serial_init(&serial0_uarte, &m_uarte0_drv_config, &serial0_config);
	NRF_LOG_INFO("usart0_init_err_code = %d",ret);
	APP_ERROR_CHECK(ret);
}

void usart0_uninit()
{
	ret_code_t err_code=0;
	nrf_serial_tx_abort(&serial0_uarte);
	nrf_serial_rx_drain(&serial0_uarte);
    err_code = nrf_serial_uninit(&serial0_uarte);
	NRF_LOG_INFO("usart0_uninit err_code = %d",err_code);
	APP_ERROR_CHECK(err_code);
	nrf_delay_ms(50);
}

without use of Uart init and uninit function Power consumption is 6 micro amps.

but when i use usart0_init() and once the work completion with uart peripheral, i make device into deep sleep and before go into sleep i am using usart0_uninit().

but power consumption in deep sleep is remains high upto 1200 micro amps.

So without usart0_init() and usart0_uninit() in code power consumption is 6 micro amps in deep sleep and with usart0_init() and usart0_uninit() in code power consumption is 1200 micro amps. 

So Please help me to how i can reduce power consumption using init and uninit function of nrf_serial library.

Thanks in advance for your kind support. 

Parents
  • Hi

    Can you try power cycling the UARTE0 (and UARTE1 if it is implemented) peripheral altogether after uninitializing it, to see if that reduces the current consumption for you. There was an issue with the app_uart_close() function not stopping the HF clock and closing the DMA bus correctly previously, and if you have implemented these init/uninit functions yourself (seeing as they're not part of the original SDK) the issue might have resurfaced. Please try power cycling the UARTE0 peripheral like this:

    *(volatile uint32_t *)0x40002FFC = 0;
    *(volatile uint32_t *)0x40002FFC;
    *(volatile uint32_t *)0x40002FFC = 1;

    If you're using UARTE1, the base address is 0x40028000.

    Best regards,

    Simon

  • Hi Simonr,

    Thanks you so much for your kind support.

    I try Power Cycling the UARTE0 peripheral and its solve my problem. now current consumption in sleep is around 6uA.

Reply Children
No Data
Related