Suspending uart with Zephyr console

NCS 3.02 54L10

I am using uart0 in async mode for printk and user input (my own callback not zephyr CLI). I need to be able to put the uart into suspend after an inactivity timeout to reduce current consumption.

Based on advice from ticket 344896 I am using rc = pm_device_action_run(uart_dev, PM_DEVICE_ACTION_SUSPEND) gets me an error -88 Not Implemented.

These are my config options:

CONFIG_SERIAL=y
CONFIG_PM_DEVICE=y
CONFIG_UART_ASYNC_API=y
CONFIG_UART_ASYNC_ADAPTER=y
CONFIG_UART_CONSOLE=y
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y
CONFIG_CONSOLE=y

I get a feeling this might be because the console is using the driver? In any case, how can I force a shutdown of the uart? It doesn't matter if there is no way of restarting it outside of a reboot.

Parents Reply
  • Why is an adapter used instead of native async support in the UART driver? Our R&D thinks the adapter was mainly added to emulate the UART async API on devices that do not support it (primarily for USB CDC ACM). When using UART0, I would not use the adapter at all.

    Simply that when originally moving over to Zephyr I used Nordic UART Bridge Service (NUS) sample (peripheral_uart) as a template app to get started, and the code is from that app. It's worked so there has been no reason to change it - until now.

    In the period waiting for a reply I decided to review the uart code anyway and have changed it to using  IRQ handlers which works OK now.

Children
No Data
Related