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

How to reach nRF52840 UARTE current supply specification ?

Hi, I work on the nRF52840-Preview-DK board. I try to make a ble to uart bridge and I start with the nRF5 SDK 14.0.0 ble_app_uart example.

I compare the current supply of the example and the same code without the uart initialization. The current supply is 0.8mA greater with the uart initialization. In the "nRF52840 Objective Product Specification v0.5" the electrical specification indicate 55uA.

If I call the function "app_uart_close()" after "uart_init()" the current supply is always 0.8mA greater than the code without uart initialization.

Parents
  • First of all, 0.8 mA (on nRF52840, no DCDC. 0.35 mA with DCDC enabled @3V) is the expected run current for the UARTE in RX or TX mode since HF clock is needed and the DMA bus is active.

    When you call app_uart_close() basically what happens is that the peripheral is disabled by writing 0 to the NRF_UARTE0->ENABLE register. Unfortunately, this seems to not stop the HF clk and close the DMA bus, which could be a bug. However, if you power cycle the peripheral after calling app_uart_close() the current consumption goes down. You can do that with this code:

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

    If you are using UARTE1 the base address is 0x40028000. infocenter.nordicsemi.com/.../uarte.html

    EDIT:

    Just adding that the UARTE TX has to be stopped explicitly when it's finished. If you just close the UART without stopping the transactions the UART will continue to keep the clocks running, as described above.

    This can be done through the nrfx_uarte_tx/rx_abort() functions, or the TASKS_STOPRX/TX registers directly.

    If you do this before disabling the UART the above workaround is not needed.

  • Hi Stian, I am also experiencing this issue with the nRF UARTE Drivers in SDK 16 with the nRF52840.

    My code is as follows. The uarte_uninit manages to stop the TX because if nrfx_uarte_rx is not used, a low current consumption is achieved once again. Power cycling the UARTE through the registers seems to fix the issue when nrfx_uarte_rx is used. The tx/rx abort do not seem to have any affect ...

    Moreover could you provide a link to the documentation where FFC from UARTE0 offset 0x40002 is mentioned? Because I could not find this register which power cycles the UARTE0.

    // Stop any reception on UARTE0
    nrfx_uarte_tx_abort(&uarte0_inst);
    nrfx_uarte_rx_abort(&uarte0_inst);
    
    // Stop any reception on UARTE1
    nrfx_uarte_tx_abort(&uarte1_inst);
    nrfx_uarte_rx_abort(&uarte1_inst);
    
    // Switch Off both UARTEs to reduce current consumption
    nrfx_uarte_uninit(&uarte0_inst);
    nrfx_uarte_uninit(&uarte1_inst);
    
    // Power cycle the UARTE0 - Fix or Workaround since UARTE0 is not getting turned Off if RX is enabled
    *(volatile uint32_t *)0x40002FFC = 0;
    *(volatile uint32_t *)0x40002FFC;
    *(volatile uint32_t *)0x40002FFC = 1;

Reply
  • Hi Stian, I am also experiencing this issue with the nRF UARTE Drivers in SDK 16 with the nRF52840.

    My code is as follows. The uarte_uninit manages to stop the TX because if nrfx_uarte_rx is not used, a low current consumption is achieved once again. Power cycling the UARTE through the registers seems to fix the issue when nrfx_uarte_rx is used. The tx/rx abort do not seem to have any affect ...

    Moreover could you provide a link to the documentation where FFC from UARTE0 offset 0x40002 is mentioned? Because I could not find this register which power cycles the UARTE0.

    // Stop any reception on UARTE0
    nrfx_uarte_tx_abort(&uarte0_inst);
    nrfx_uarte_rx_abort(&uarte0_inst);
    
    // Stop any reception on UARTE1
    nrfx_uarte_tx_abort(&uarte1_inst);
    nrfx_uarte_rx_abort(&uarte1_inst);
    
    // Switch Off both UARTEs to reduce current consumption
    nrfx_uarte_uninit(&uarte0_inst);
    nrfx_uarte_uninit(&uarte1_inst);
    
    // Power cycle the UARTE0 - Fix or Workaround since UARTE0 is not getting turned Off if RX is enabled
    *(volatile uint32_t *)0x40002FFC = 0;
    *(volatile uint32_t *)0x40002FFC;
    *(volatile uint32_t *)0x40002FFC = 1;

Children
No Data
Related