How to use low-power UART demos other than lpuart

Hi all,

  I want to use UART periodically, but because I need to communicate with other standard UART, I cannot use LPUART

I saw that Zephyr's demos all use CONF_SERIAL=y, which has an impact on power consumption

I saw the demo of tx_rx_non-blocking, but there is no option for nrf54l15. I'm not sure if it can be used.

Do you have any simple low-power demos?

  • Hi

    I recommend that you suspend the UART peripheral when it isn't used as that will decrease the current consumption a lot.

    Set the following configs =y in your prj.conf file:

    CONFIG_PM_DEVICE=y and CONFIG_UART_ASYNC_API=y and add the following to your project to make the application suspend the UART when not in use:

    #include <zephyr/pm/device.h>
    static const struct device* uart_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
    err = pm_device_action_run(uart_dev, PM_DEVICE_ACTION_SUSPEND);

    Best regards,

    Simon

  • HI Simon

        On the basis of the above, the power consumption has returned to normal, around 3uA. At this point, I set the RX pin to interrupt and wait for the interrupt to trigger the wake-up UART. However, the power consumption has reached around 16uA, which seems a bit high. Do you have any suggestions to reduce the power consumption?

    static void pin_irq(nrfx_gpiote_pin_t     pin,
                                  nrfx_gpiote_trigger_t trigger,
                                  void *                p_context)
    {
     
        nrfx_gpiote_trigger_disable(&gpiote, 37);
        const struct device *uart = DEVICE_DT_GET(DT_NODELABEL(uart20));
        async(uart); //wake-up UART
    }

    int main()

    {

     const struct device *uart = DEVICE_DT_GET(DT_NODELABEL(uart20));
        pm_device_action_run(uart, PM_DEVICE_ACTION_SUSPEND);  //3uA
        #if defined(__ZEPHYR__)
        IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_GPIOTE_INST_GET(20)), IRQ_PRIO_LOWEST,
                    NRFX_GPIOTE_INST_HANDLER_GET(20), 0, 0);
    #endif
        nrfx_gpiote_init(&gpiote, NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY);
         nrfx_gpiote_channel_alloc(&gpiote, &in_channel);
       
        static const nrf_gpio_pin_pull_t pull_config = NRF_GPIO_PIN_PULLUP;
        nrfx_gpiote_trigger_config_t trigger_config = {
            .trigger = NRFX_GPIOTE_TRIGGER_TOGGLE,
            .p_in_channel = &in_channel,
        };
        static const nrfx_gpiote_handler_config_t handler_config = {
            .handler = pin_irq,
        };
        nrfx_gpiote_input_pin_config_t input_config = {
            .p_pull_config = &pull_config,
            .p_trigger_config = &trigger_config,
            .p_handler_config = &handler_config
        };

        nrfx_gpiote_input_configure(&gpiote, 37, &input_config);

        nrfx_gpiote_trigger_enable(&gpiote, 37, true);//16uA,too hight.(RX:37)
    }
  • Hi

    I don't think this is outside expectations. We don't have the measurements done yet for the nRF54L15, but if you refer to the "wake on GPIOTE input sleep mode from I.E. the nRF52840 we can see that the typical current consumption here is 17.37µA. Note that this is just a comparison from previous devices, so the nRF54L15 numbers might be different. But for those we can only wait for the numbers to be added to a future revision of the nRF54L15 datasheet.

    One thing worth noting here, is that if you need the lowest possible GPIOTE current consumption, you should use the GPIOTE30 instance that is drawn from the low power domain and uses pins on P0, as that should be lower on current usage than GPIOTE20 from the peripheral domain.

    Best regards,

    Simon

  • Let me know if you have any follow-up questions or if we can close this ticket now.

    Best regards,

    Simon

Related