<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Suspending uart with Zephyr console</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/128771/suspending-uart-with-zephyr-console</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Aug 2026 10:25:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/128771/suspending-uart-with-zephyr-console" /><item><title>RE: Suspending uart with Zephyr console</title><link>https://devzone.nordicsemi.com/thread/570326?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2026 10:25:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55259240-9f77-43cd-ad09-af4cba7ffc61</guid><dc:creator>Nick_RA</dc:creator><description>[quote userid="77782" url="~/f/nordic-q-a/128771/suspending-uart-with-zephyr-console/570274"]Why is an adapter used instead of native async support in the UART driver? Our R&amp;amp;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.[/quote]
&lt;p&gt;Simply that when originally moving over to Zephyr I used&amp;nbsp;&lt;span&gt;&lt;em&gt;Nordic UART Bridge Service (NUS) sample&lt;/em&gt; (&lt;/span&gt;peripheral_uart) as a template app to get started, and the code is from that app. It&amp;#39;s worked so there has been no reason to change it - until now.&lt;/p&gt;
&lt;p&gt;In the period&amp;nbsp;waiting for a reply I decided to review the uart code anyway and have changed it to using&amp;nbsp; IRQ handlers which works OK now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Suspending uart with Zephyr console</title><link>https://devzone.nordicsemi.com/thread/570274?ContentTypeID=1</link><pubDate>Fri, 14 Aug 2026 13:06:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:995f586d-5c44-41d5-a1f7-a2007aeb9e00</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;&lt;span&gt;Why is an adapter used instead of native async support in the UART driver? Our R&amp;amp;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.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Suspending uart with Zephyr console</title><link>https://devzone.nordicsemi.com/thread/569419?ContentTypeID=1</link><pubDate>Thu, 23 Jul 2026 14:17:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c04bc11c-9c8c-48da-81b7-552e805436f6</guid><dc:creator>Nick_RA</dc:creator><description>&lt;p&gt;Thanks, this works OK&amp;nbsp;for me.&lt;/p&gt;
&lt;p&gt;Back to my project, it seems it is because I am using Async. After a bit of hacking around this is the offending code in my uart_init, culled from your peripheral_uart example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;		/* Implement API adapter */
		uart_async_adapter_init(async_adapter, uart);
		uart = async_adapter;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Removing it my CLI no longer works of course, but uart suspend/resume now does. (Note the CLI is my own using a uart callback rather than Zephyr&amp;#39;s, because the Zephyr CLI doesn&amp;#39;t support the format required for this app)&lt;/p&gt;
&lt;p&gt;Given this, any ideas how to suspend the uart?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Suspending uart with Zephyr console</title><link>https://devzone.nordicsemi.com/thread/569401?ContentTypeID=1</link><pubDate>Thu, 23 Jul 2026 12:31:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4da5530-8756-4883-853e-b34b55ee342a</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Here is the test code:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;	if (device_is_ready(uart_dev))
    {
		printk(&amp;quot;Put the peripheral into suspended state.\n&amp;quot;);
		err = pm_device_action_run(uart_dev, PM_DEVICE_ACTION_SUSPEND);
		if (err) {
			printk(&amp;quot;UART suspend failed. (err %d)\n&amp;quot;, err);
		}
	
		k_sleep(K_MSEC(1000));
	
		err = pm_device_action_run(uart_dev, PM_DEVICE_ACTION_RESUME);
		if (err) {
			printk(&amp;quot;UART resume failed. (err %d)\n&amp;quot;, err);
		} else {
			printk(&amp;quot;Resume the peripheral from the suspended state.\n&amp;quot;);
		}
	} else {
		printk(&amp;quot;UART device not ready.\n&amp;quot;);
	}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;My test project:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hello_5F00_world_5F00_361858.7z"&gt;devzone.nordicsemi.com/.../hello_5F00_world_5F00_361858.7z&lt;/a&gt;&lt;br /&gt;Expect outlog:&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-2026_2D00_07_2D00_23-073050.png" /&gt;&lt;br /&gt;&lt;em&gt;“Beware that this code/configuration is not fully tested or qualified and should be considered provided “as-is”. Please test it with your application and let me know if you find any issues.”&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Suspending uart with Zephyr console</title><link>https://devzone.nordicsemi.com/thread/569388?ContentTypeID=1</link><pubDate>Thu, 23 Jul 2026 09:01:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90685af6-0f63-4dad-a723-2563a2a9b8e0</guid><dc:creator>Nick_RA</dc:creator><description>&lt;p&gt;Would you include relevant code snippets in your message please? All you&amp;#39;ve done is link to is a generic documentation page.&lt;/p&gt;
&lt;p&gt;if you&amp;#39;re referring to the flash sleep code my modified version here returns&amp;nbsp;UART suspend failed. (err -88)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (device_is_ready(uart)) {
  uint32_t err = pm_device_action_run(uart, PM_DEVICE_ACTION_SUSPEND);
  if (err) {
    printk(&amp;quot;UART suspend failed. (err %d)\n&amp;quot;, err);
  }
} else
  printk(&amp;quot;UART is not ready\n&amp;quot;);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I can actually kill the uart using&amp;nbsp;&lt;span&gt;nrf_uarte_disable&lt;/span&gt;&lt;span&gt;(NRF_UARTE00) (thank you ChatGPT). But I need to handle this within Zephyr as this code needs to be hardware agnostic; currently it&amp;#39;s running on 54L10 and 52832 with different uarts.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I know for a fact the uart isn&amp;#39;t actually sending when I&amp;#39;m trying to suspend it - it&amp;#39;s an inactivity timeout after all!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Suspending uart with Zephyr console</title><link>https://devzone.nordicsemi.com/thread/569366?ContentTypeID=1</link><pubDate>Wed, 22 Jul 2026 18:23:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c219134c-0ac8-4cd5-a148-1f9cd1f119f3</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Sorry, I mean the&amp;nbsp;&lt;span&gt;UART.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Suspending uart with Zephyr console</title><link>https://devzone.nordicsemi.com/thread/569359?ContentTypeID=1</link><pubDate>Wed, 22 Jul 2026 16:08:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba7f81e5-dce4-4c0c-a048-1c52c8e65554</guid><dc:creator>Nick_RA</dc:creator><description>&lt;p&gt;The device is active and advertising, shutting down the uart is independent to the state of the system.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Suspending uart with Zephyr console</title><link>https://devzone.nordicsemi.com/thread/569358?ContentTypeID=1</link><pubDate>Wed, 22 Jul 2026 16:03:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0c5947b-cf34-4f67-a6b4-840f0dda9ea7</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Did you check whether the &lt;span&gt;UART&lt;/span&gt; is active? Check out the example code in&amp;nbsp;&lt;a href="https://nrfconnectdocs.nordicsemi.com/ncs/latest/nrf/test_and_optimize/optimizing/power_general.html#put-the-external-flash-into-sleep-mode-in-inactivity-periods"&gt;https://nrfconnectdocs.nordicsemi.com/ncs/latest/nrf/test_and_optimize/optimizing/power_general.html#put-the-external-flash-into-sleep-mode-in-inactivity-periods&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>