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?

Parents
  • 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

Reply
  • 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

Children
  • 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)
    }
Related