<?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>Unable to disable UART at runtime NCS v2.2.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95843/unable-to-disable-uart-at-runtime-ncs-v2-2-0</link><description>Hi, 
 I have the following minimal example: 
 main.c 
 
 proj.conf: 
 
 Now, when setting CONFIG_SERIAL=n my nRF52840DK drains about 3-4 &amp;#181;A, when setting CONFIG_SERIAL=y it drains about 520 &amp;#181;A. That seems reasonable. Now I want to disable the UART at</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 31 May 2024 06:15:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95843/unable-to-disable-uart-at-runtime-ncs-v2-2-0" /><item><title>RE: Unable to disable UART at runtime NCS v2.2.0</title><link>https://devzone.nordicsemi.com/thread/486774?ContentTypeID=1</link><pubDate>Fri, 31 May 2024 06:15:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a213d3b-38c3-4e60-b251-ee6fb0d614e2</guid><dc:creator>allenyang</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I want to let the current of nrf5340(now is 580ua) be much lower in hello world sample,&lt;/p&gt;
&lt;p&gt;I tried to disable UART using the code in the sample but&amp;nbsp;there is&amp;nbsp;a build error.&lt;/p&gt;
&lt;p&gt;it says &amp;quot;undefined reference to `__device_dts_ord_142&amp;#39;&amp;quot;&lt;/p&gt;
&lt;p&gt;How can I solve this?&lt;/p&gt;
&lt;p&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/5428.Untitled9.png" /&gt;&lt;/p&gt;
&lt;p&gt;prj.conf&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y

#config RTT
CONFIG_LOG=n
CONFIG_LOG_PRINTK=n
# CONFIG_LOG_MODE_DEFERRED=y
CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n
CONFIG_RTT_CONSOLE=n
CONFIG_LOG_BACKEND_RTT=n
CONFIG_LOG_BACKEND_UART=n

# CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096
# CONFIG_LOG_BUFFER_SIZE=4096

# Disable internal DCDC
CONFIG_BOARD_ENABLE_DCDC_APP=n
CONFIG_BOARD_ENABLE_DCDC_NET=n
CONFIG_BOARD_ENABLE_DCDC_HV=n

# Use internal capacitor for 32M xtal and set capacitor value to 8.5pF 
# (ranging from 7.0 pF to 20.0 pF in 0.5 pF steps
# can be enabled on pins XC1 and XC2. This option specifies doubled
# capacitance value for the two capacitors. Set it to 14 to get 7.0 pF
# for each capacitor, 15 to get 7.5 pF, and so on.
# )
CONFIG_SOC_HFXO_CAP_INTERNAL=y
CONFIG_SOC_HFXO_CAP_INT_VALUE_X2=17
 
#  Use internal capacitor for 32k xtal and set capacitor value to 7pF 
# (only 4 options of internal capacitor value settings for 32k xtal
#   -INT_6PF
#   -INT_7PF
#   -INT_9PF
#   - USE external capacitor)
CONFIG_SOC_ENABLE_LFXO=y
CONFIG_SOC_LFXO_CAP_INT_7PF=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Allen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to disable UART at runtime NCS v2.2.0</title><link>https://devzone.nordicsemi.com/thread/405671?ContentTypeID=1</link><pubDate>Thu, 19 Jan 2023 12:42:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a5378e8-6d1a-42b9-b2ca-e7095c0f2d28</guid><dc:creator>OliverB</dc:creator><description>&lt;p&gt;Got it! Your hint regarding the modem shell sample led me to the&amp;nbsp;right direction. It was not a wrong device, it was just one device too few. I have to disable uart1 too. I just overlooked that uart1 is&amp;nbsp;enabled in the boards device tree and thus was enabled by CONFIG_SERIAL=y too. I added&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;uart1 {
	compatible = &amp;quot;nordic,nrf-uart&amp;quot;;
	status = &amp;quot;disabled&amp;quot;;
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;in my board overlay file. This leads to about 3,5 &amp;micro;A which is perfect.&lt;/p&gt;
&lt;p&gt;Thanks and regards,&lt;br /&gt;Oliver&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to disable UART at runtime NCS v2.2.0</title><link>https://devzone.nordicsemi.com/thread/405646?ContentTypeID=1</link><pubDate>Thu, 19 Jan 2023 11:37:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:788c7943-d502-4aeb-80ac-ee2c95576f89</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;For an example on how to disable UART, see &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/82e5133162c2be035141c4a57f104815fe3a7e2c/samples/nrf9160/modem_shell/src/uart/uart.c#L38-L55"&gt;the modem shell sample&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;How much current draw are you measuring after calling pm_device_action_run?&lt;/p&gt;
&lt;p&gt;Could it be that you suspend the wrong device?&lt;/p&gt;
&lt;p&gt;Try to suspend &amp;quot;uart0&amp;quot; as in the modem shell sample, and see if you can see any difference?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to disable UART at runtime NCS v2.2.0</title><link>https://devzone.nordicsemi.com/thread/405624?ContentTypeID=1</link><pubDate>Thu, 19 Jan 2023 09:51:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63de73dc-9769-46cc-9a89-9bac4e86c704</guid><dc:creator>OliverB</dc:creator><description>&lt;p&gt;Fyi: I edited my code example. In line 21 it must be&amp;nbsp;PM_DEVICE_ACTION_SUSPEND instead of PM_DEVICE_ACTION_TURN_OFF.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>