<?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>NCS Uart Console Suspend Before Log Outpput</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/88715/ncs-uart-console-suspend-before-log-outpput</link><description>Hi Nordic: 
 Test with board nrf5340-dk ncs v1.9.1 
 prj.conf 
 
 # Console 
 CONFIG_LOG = y 
 CONFIG_LOG_PRINTK = y 
 CONFIG_LOG_DEFAULT_LEVEL = 3 
 # UartConsole 
 CONFIG_UART_CONSOLE = y 
 CONFIG_LOG_BACKEND_UART = y 
 # RttConsole 
 CONFIG_RTT_CONSOLE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 Jun 2022 01:54:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/88715/ncs-uart-console-suspend-before-log-outpput" /><item><title>RE: NCS Uart Console Suspend Before Log Outpput</title><link>https://devzone.nordicsemi.com/thread/371996?ContentTypeID=1</link><pubDate>Mon, 13 Jun 2022 01:54:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ca0037a-c2ff-4209-a977-d3e242c1eeb3</guid><dc:creator>kyozc</dc:creator><description>&lt;p&gt;Hi Simon:&lt;/p&gt;
&lt;p&gt;Thanks .&lt;/p&gt;
&lt;p&gt;And we found that there was a API That can make the consle output without delay.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;logging/log_ctrl.h&amp;gt;

printk(&amp;quot;disable_console\n&amp;quot;);
while(log_process(false));
pm_device_action_run(console_dev, PM_DEVICE_ACTION_SUSPEND);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS Uart Console Suspend Before Log Outpput</title><link>https://devzone.nordicsemi.com/thread/371684?ContentTypeID=1</link><pubDate>Thu, 09 Jun 2022 13:08:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36142a2a-21d5-4b0e-beeb-3f39f2816ef9</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Try setting CONFIG_LOG_PRINTK=n, then your sample should work with a delay of 500ms.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/disable_5F00_console_5F00_v2.zip"&gt;devzone.nordicsemi.com/.../disable_5F00_console_5F00_v2.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Is this an acceptable fix for you?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS Uart Console Suspend Before Log Outpput</title><link>https://devzone.nordicsemi.com/thread/371520?ContentTypeID=1</link><pubDate>Thu, 09 Jun 2022 01:13:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b6b0c11-bbcc-4745-937d-b8d96117ad5f</guid><dc:creator>kyozc</dc:creator><description>&lt;p&gt;Hi Simon:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the quick reply. I test your case and the console output was OK.&lt;/p&gt;
&lt;p&gt;But if i keep Suspend &amp;amp; Resume the console device. The&amp;nbsp;consle will have no output.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Below is my change on the main.c of your code.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;sys/printk.h&amp;gt;
#include &amp;lt;pm/device.h&amp;gt;

#define TEST_DELAY 500

#define UART_DEVICE_NAME DT_LABEL(DT_CHOSEN(zephyr_console))

void main(void)
{
	const struct device *console_dev;
	console_dev = device_get_binding(UART_DEVICE_NAME);
    printk(&amp;quot;output1\n&amp;quot;);
    k_sleep(K_MSEC(TEST_DELAY));
    pm_device_action_run(console_dev, PM_DEVICE_ACTION_SUSPEND);
    k_sleep(K_MSEC(TEST_DELAY));
    pm_device_action_run(console_dev, PM_DEVICE_ACTION_RESUME);
    printk(&amp;quot;output2\n&amp;quot;);
    k_sleep(K_MSEC(TEST_DELAY));
    pm_device_action_run(console_dev, PM_DEVICE_ACTION_SUSPEND);
    k_sleep(K_MSEC(TEST_DELAY));
    pm_device_action_run(console_dev, PM_DEVICE_ACTION_RESUME);
    printk(&amp;quot;output3\n&amp;quot;);
    k_sleep(K_MSEC(TEST_DELAY));
    pm_device_action_run(console_dev, PM_DEVICE_ACTION_SUSPEND);
    k_sleep(K_MSEC(TEST_DELAY));
    pm_device_action_run(console_dev, PM_DEVICE_ACTION_RESUME);
    printk(&amp;quot;output4\n&amp;quot;);
    k_sleep(K_MSEC(TEST_DELAY));
    pm_device_action_run(console_dev, PM_DEVICE_ACTION_SUSPEND);
    k_sleep(K_MSEC(TEST_DELAY));
    pm_device_action_run(console_dev, PM_DEVICE_ACTION_RESUME);
    printk(&amp;quot;output5\n&amp;quot;);
    k_sleep(K_MSEC(TEST_DELAY));
    pm_device_action_run(console_dev, PM_DEVICE_ACTION_SUSPEND);
    k_sleep(K_MSEC(TEST_DELAY));
    pm_device_action_run(console_dev, PM_DEVICE_ACTION_RESUME);
    printk(&amp;quot;output6\n&amp;quot;);
    k_sleep(K_MSEC(TEST_DELAY));
    pm_device_action_run(console_dev, PM_DEVICE_ACTION_SUSPEND);
    k_sleep(K_MSEC(TEST_DELAY));
    pm_device_action_run(console_dev, PM_DEVICE_ACTION_RESUME);
	printk(&amp;quot;disable_console\n&amp;quot;);
	k_sleep(K_MSEC(TEST_DELAY));
	pm_device_action_run(console_dev, PM_DEVICE_ACTION_SUSPEND);
    printk(&amp;quot;console disabled\n&amp;quot;);
    k_sleep(K_MSEC(TEST_DELAY));
}

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If i increase the TEST_DELAY to 2000ms , The Console Output will be Normal.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Chen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS Uart Console Suspend Before Log Outpput</title><link>https://devzone.nordicsemi.com/thread/371430?ContentTypeID=1</link><pubDate>Wed, 08 Jun 2022 13:22:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a06b6e2-07ed-4077-bad8-c8e48e772ec8</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I tested this myself with NCS v1.9.1 and the nRF5340 DK, and was not able to reproduce. Test it yourself with the same sample:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/disable_5F00_console.zip"&gt;devzone.nordicsemi.com/.../disable_5F00_console.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>