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

How to close uart without using the uart libararies, without app_uart_close();

Hey,

I am working on a version which is uploaded from a bootloader (DFU), the bootloader print to UART and uses the UART libraries.

I want the application to close the UART (to save power), I have done it with app_uart_close(); and so the current drop

But I do not want to include and enable the UART libareries just to shut it down, (to save memory)

Is there a way to shut the UART down without using the libarries (app_uart_fifo, nrf_drv_uart etc..),without app_uart_close()?

Thanks!

Parents
  • Why not just shutdown the UART in the bootloader before the application start? Seems silpler to me.

    Using hardware register is a bit more difficult here since the app has no idea whether the bootloader uses UART or UARTE peripherial.

    You need to look at the ENABLE register value (4= UART, 8=UARTE) and then trigger STOPTX and STOPRX tasks for the selected peripherial (and type). Once these are finished you can safely set ENABLE back to zero which should drop the operating current.

  • Hey, 

    Thanks for your help, 

    I am trying this 

    NRF_UART0->ENABLE = 0;
    NRF_UART0->TASKS_STOPRX = 1;
    NRF_UART0->TASKS_STOPTX = 1;

    And it seems to be working! I still have to do some more tests but it looks promising..

    Best regards!

Reply Children
No Data
Related