<?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>NRF5340 UART completely turn off and turn on dynamically in app program</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89221/nrf5340-uart-completely-turn-off-and-turn-on-dynamically-in-app-program</link><description>Hello 
 I am using NRF5340 as Soc in my project. In application program I have used uart0 for data transfer. At the same time the power consumption is really important for me 
 because the board is battery powered. So in idle times I turn off the uart0</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 Jun 2022 14:44:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89221/nrf5340-uart-completely-turn-off-and-turn-on-dynamically-in-app-program" /><item><title>RE: NRF5340 UART completely turn off and turn on dynamically in app program</title><link>https://devzone.nordicsemi.com/thread/373751?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 14:44:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee677a6a-84c5-4b5d-aacd-c4627ac9446e</guid><dc:creator>Simon</dc:creator><description>[quote user="saeed mahvis"]So I will try my own program by v1.9.1 and inform you[/quote]
&lt;p&gt;Sounds good&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f44d.svg" title="Thumbsup"&gt;&amp;#x1f44d;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF5340 UART completely turn off and turn on dynamically in app program</title><link>https://devzone.nordicsemi.com/thread/373726?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 13:46:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ad69b97-33d4-4822-a1f9-93579360af6f</guid><dc:creator>saeed mahvis</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Your hello_world_disable_uart_runtime was compiled with no errors in NCS v1.9.1 but in version&lt;/p&gt;
&lt;p&gt;v1.8.0 it couldn&amp;#39;t be compiled. So I will try my own program by v1.9.1 and inform you&lt;/p&gt;
&lt;p&gt;B.S&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF5340 UART completely turn off and turn on dynamically in app program</title><link>https://devzone.nordicsemi.com/thread/373709?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 13:18:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0290a3d-02df-4a55-8db3-b768a3d2e89e</guid><dc:creator>saeed mahvis</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;Yes I have added&amp;nbsp;&lt;span&gt;#include&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;lt;pm/device.h&amp;gt; at the top. But the NCS version I am using is v1.8.0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I will install your version and try it again and inform you. Thank you for your response&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF5340 UART completely turn off and turn on dynamically in app program</title><link>https://devzone.nordicsemi.com/thread/373708?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 13:11:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dbbe01d-4898-4ced-a3be-eb48abb3cd41</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Did you add&amp;nbsp;&lt;span&gt;#include&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;pm/device.h&amp;gt; at the top? What version of NCS are you using?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here I added pm_device_action_run to the hello world sample in NCS v1.9.1 and it built anbd ran successfully:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hello_5F00_world_5F00_disable_5F00_uart_5F00_runtime.zip"&gt;devzone.nordicsemi.com/.../hello_5F00_world_5F00_disable_5F00_uart_5F00_runtime.zip&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Here I used a delay between the calls, but that may cause some issues as mentioned in this ticket:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/88715/ncs-uart-console-suspend-before-log-outpput"&gt;NCS Uart Console Suspend Before Log Outpput&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF5340 UART completely turn off and turn on dynamically in app program</title><link>https://devzone.nordicsemi.com/thread/373690?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 12:37:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f092c0a-129a-450a-b3e6-1124a11eaf92</guid><dc:creator>saeed mahvis</dc:creator><description>&lt;p&gt;Hi Simon&lt;/p&gt;
&lt;p&gt;I have added&amp;nbsp;&lt;span&gt;CONFIG_PM_DEVICE=y in the prj.config and also added the modem shell sample code in my program.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;I only used the code for uart0. But the sdk can not recognize&amp;nbsp;pm_device_action_run() function and issued&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;(undefined reference to `pm_device_action_run&amp;#39;)&lt;pre class="ui-code" data-mode="text"&gt;static void uart0_set_enable(bool enable)
{
	const struct device *uart_dev = DEVICE_DT_GET(DT_NODELABEL(uart0));

	if (!device_is_ready(uart_dev)) {
		return;
	}

	pm_device_action_run(uart_dev, enable ? PM_DEVICE_ACTION_RESUME : PM_DEVICE_ACTION_SUSPEND);
}
void disable_uarts(void)
{
	uart0_set_enable(false);
	//uart1_set_enable(false);
}

void enable_uarts(void)
{
	uart0_set_enable(true);
	//uart1_set_enable(true);
}
&lt;/pre&gt; error.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF5340 UART completely turn off and turn on dynamically in app program</title><link>https://devzone.nordicsemi.com/thread/373653?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 11:36:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d11ea90-fac9-4b30-9412-bfdab7930bf8</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;To enable/disable UART dynamically in your program you can set&amp;nbsp;CONFIG_PM_DEVICE=y and use&amp;nbsp;pm_device_action_run().&amp;nbsp;Check out the &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.0.0/samples/nrf9160/modem_shell/src/uart/uart.c#L53"&gt;modem shell sample&lt;/a&gt; to see how to use this function.&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>