Power consumption on UART

Hello,

I'm trying to reduce the power conception of my custom board with a nrf52840 and a 4g modem on uart.

For this test, I reduce the code to a loop (modem is off)


        k_msleep(5000);
        pm_device_action_run(modem_uart, PM_DEVICE_ACTION_RESUME);
        k_msleep(5000);
        pm_device_action_run(modem_uart, PM_DEVICE_ACTION_SUSPEND);
 
If I disable the rx to the uart on modem pins with disable-rx; on dts file:
Current is  30µA on suspend, 1.5mA on resume -> this is what I expect but I need RX 
 
If I put the uart on others pins(unconnected) with RX enable:
Current is  30µA on suspend, 1.5mA on resume -> it's OK
 
If I put the uart on the modem pin.
Current is  500µA on suspend, 1.5mA on resume.
 
I assume modem have a ON lvl on its TX even when off and draws current.
But I can't explain why it is not disconnected when the suspend happens. This is the purpose of "low-power-enable": disconnect the pin and put it as a input.
Why I have a difference between disable-rx and low-power-enable options?
 
uart pins in DTS file:
 uart1_default: uart1_default {
         group1 {
             psels = <NRF_PSEL(UART_TX, 1, 7)>,
                        <NRF_PSEL(UART_RX, 1, 4)>;
         };
     };
     
uart1_sleep: uart1_sleep {
        group1 {
            psels = <NRF_PSEL(UART_TX, 1,7)>,<NRF_PSEL (UART_RX, 1,4)>;
            low-power-enable;
        };
    };
 
I tried async uart, with uart_rx_disable before suspend but idle current is now 3mA! I tried the low power uart but current is 500µ too.
How can I have a low current of 30uA  with the suspend mechanism ( or other solution)
Thanks you
Parents
  • Hi Sylvain,

    If I put the uart on the modem pin.
    Current is  500µA on suspend, 1.5mA on resume.

    Which modem pin are you using? Are you sure that P1.04 is not used for anything else?

    Can you post me your zephyr.dts file from your build\zephyr  folder?

  • Rx is on Uart Tx of the modem  and TX is on Uart Rx.

    I don't understand why disable-rx option has a different power consumption than low-power enable.

    Find my zephyr.dts below, thanks

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /dts-v1/;
    / {
    · · #address-cells = < 0x1 >;
    · · #size-cells = < 0x1 >;
    · · model = "Custom Plank Board";
    · · compatible = "vendor,custom-plank";
    · · chosen {
    · · · · zephyr,entropy = &cryptocell;
    · · · · zephyr,flash-controller = &flash_controller;
    · · · · zephyr,console = &cdc_acm_uart0;
    · · · · zephyr,sram = &sram0;
    · · · · zephyr,flash = &flash0;
    · · · · zephyr,user = &gpio0;
    · · · · zephyr,shell-uart = &cdc_acm_uart0;
    · · · · zephyr,uart-mcumgr = &cdc_acm_uart0;
    · · · · zephyr,code_partition = &slot0_partition;
    · · };
    · · aliases {
    · · · · pwm-led0 = &pwm_led0;
    · · · · modem = &modem;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hmm, 

    Looking at the driver file zephyr\drivers\serial\uart_nrfx_uart.c, it looks like it has implemented the support for disable_rx but nothing for low_power_enable. You can see that the low-power-enable is not even extracted from the device node. 

    So in short, I think it looks like low-power-enable is not yet supported in nRF driver. 

Reply
  • Hmm, 

    Looking at the driver file zephyr\drivers\serial\uart_nrfx_uart.c, it looks like it has implemented the support for disable_rx but nothing for low_power_enable. You can see that the low-power-enable is not even extracted from the device node. 

    So in short, I think it looks like low-power-enable is not yet supported in nRF driver. 

Children
  • Ok, did you have a workaround to disable rx or uart dynamically?

  • No, we do not seem to support it. The workaround is to implement it in the driver. Will be a feature request.

  • I've succeed to have the desired power consumption when I reset the RXD EasyDMA register.

    Can the DMA force the input connexion buffer?

  • Syl20D said:
    I've succeed to have the desired power consumption when I reset the RXD EasyDMA register.

    can you show me some code snippets on how you did that?

  • For suspend:

        NRF_UARTE1->RXD.MAXCNT = 0;
        pm_device_action_run(modem_uart, PM_DEVICE_ACTION_SUSPEND);
        pm_device_action_run(modem_uart,PM_DEVICE_ACTION_RESUME);
        NRF_UARTE1->RXD.MAXCNT = 0;
        pm_device_action_run(modem_uart, PM_DEVICE_ACTION_SUSPEND);
    For resume:
        pm_device_action_run(modem_uart, PM_DEVICE_ACTION_RESUME);
        NRF_UARTE1->RXD.MAXCNT = 1;
    The double suspend is needed to have the drop in the power consumption