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

nRF52840 SDK16 - "app_uart_close()" cannot low current

Hi

I am now working on a project which I use ble_app_uart_c as a reference.

SDK 16 and used softdevice s140.

In the project I need to disable the UART before it enters into System ON sleep mode.

After terminating UART, use "app_uart_close" to keep current consumption unchanged.

ret_code_t err_code;
app_uart_comm_params_t const comm_params =
{
.rx_pin_no = RX_PIN_NUMBER,
.tx_pin_no = TX_PIN_NUMBER,
.rts_pin_no = UART_PIN_DISCONNECTED,
.cts_pin_no = UART_PIN_DISCONNECTED,
.flow_control = APP_UART_FLOW_CONTROL_DISABLED,
.use_parity = false,
#if defined (UART_PRESENT)
.baud_rate = NRF_UART_BAUDRATE_115200
#else
.baud_rate = NRF_UARTE_BAUDRATE_115200
#endif
};

APP_UART_FIFO_INIT(&comm_params,
UART_RX_BUF_SIZE,
UART_TX_BUF_SIZE,
uart_event_handle,
APP_IRQ_PRIORITY_LOWEST,
err_code);

...

...

app_uart_close();

The app_uart_close was temporarily called directly to check the quiescent current and check its behavior. Once the quiescent current is confirmed to be lowered, the call will be made to the UART FIFO EMPTY.

What's the reason for this. Is there any more else to do to disable UART totally? Really needs your help. Thanks.

Parents Reply
  • Hi Simon,

    Thanks for your help and suggestion.

    I checked with the next code.

    void uart_deinit(void)

    {

     app_uart_close();

     NRF_UART0->TASKS_STOPTX = 1;

     NRF_UART0->TASKS_STOPRX = 1;

     NRF_UART0->ENABLE = 0;

     *(volatile uint32_t *)0x40002FFC = 0;

     *(volatile uint32_t *)0x40002FFC;

     *(volatile uint32_t *)0x40002FFC = 1;

    }

    However, after using app_uart_put(), the app_uart_close() function was used through the APP_UART_TX_REMITY event but failed to perform nrf_pwr_mgmt_run(). What's the reason?

    Best regards,

    Chu

Children
No Data
Related