<?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>power down/disable uart0 that is being used by the Peripheral UART sample</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95178/power-down-disable-uart0-that-is-being-used-by-the-peripheral-uart-sample</link><description>Hi, 
 for device power managment, i want to power down/disable uart0 that is being used by the Peripheral UART sample. it is giving errors when doing it via the .conf and overlay file as it is being used by the NUS functions? 
 pm_device_state_set(dev_uart</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Jan 2023 14:08:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95178/power-down-disable-uart0-that-is-being-used-by-the-peripheral-uart-sample" /><item><title>RE: power down/disable uart0 that is being used by the Peripheral UART sample</title><link>https://devzone.nordicsemi.com/thread/402991?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2023 14:08:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17d4696d-7286-448b-9176-4b5642bdcdbd</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Paul&lt;/p&gt;
[quote user="paul_B"]&lt;p&gt;&lt;span&gt;another option i can think of is to totally disable/enable the Bluetooth via the application&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;bt_disable/bt_enable. any thoughts on this ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;For what purpose? To save power?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In later versions of the nRF Connect SDK you can use the bt_disable() function to disable the Bluetooth stack completely, yes, but this shouldn&amp;#39;t really be necessary in order to keep power consumption low.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As long as you are not in an active Bluetooth connection or in advertise mode the Bluetooth stack should not draw any power.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: power down/disable uart0 that is being used by the Peripheral UART sample</title><link>https://devzone.nordicsemi.com/thread/402877?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2023 00:36:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb64eb9b-71e2-45bc-a508-b342f9766f78</guid><dc:creator>paul_B</dc:creator><description>&lt;p&gt;&lt;span&gt;@&lt;/span&gt;&lt;span&gt;Torbj&amp;oslash;rn&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;i appreciate the support. i will try the LPUART driver and try to disable uart0 rx first.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;another option i can think of is to totally disable/enable the Bluetooth via the application&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;bt_disable/bt_enable. any thoughts on this ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Paul&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: power down/disable uart0 that is being used by the Peripheral UART sample</title><link>https://devzone.nordicsemi.com/thread/402700?ContentTypeID=1</link><pubDate>Fri, 30 Dec 2022 15:55:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc68bc63-b703-4e70-8cae-31fbb4c496bf</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Paul&lt;/p&gt;
&lt;p&gt;Have you considered using the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/drivers/uart_nrf_sw_lpuart.html#uart-nrf-sw-lpuart"&gt;LPUART driver&lt;/a&gt;?&lt;br /&gt;This is a good option if you want a low power UART driver to communicate between two Nordic devices, but if you want to communicate with a non Nordic device then it might not be compatible since it&amp;nbsp;uses some additional control pins that are not a part of the UART standard.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As for your issue I think the problem could be related to the fact that the UART RX is enabled while you try to disable the driver.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I was able to disable uart0 if I made sure to disable the UART RX first.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I also had to comment out the handling of the UART_RX_DISABLED event, since this event simply tries to enable the RX again when the disabled event occurs.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With these two changes I can disable and re-enable uart0 without any crashes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: power down/disable uart0 that is being used by the Peripheral UART sample</title><link>https://devzone.nordicsemi.com/thread/402486?ContentTypeID=1</link><pubDate>Thu, 29 Dec 2022 05:37:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1156d9cf-fb8a-4205-8b06-79c06e2daff7</guid><dc:creator>paul_B</dc:creator><description>&lt;p&gt;@&lt;span&gt;Torbj&amp;oslash;rn&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Yes, you are correct. objective is to to reduce power/current consumption. problem maybe beacuse the BLE NUS of the peripheral uart sample is using the &amp;quot;uart0&amp;quot; in which i am having issues disabling. uart0 seems to always have to be enabled.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;but i can disable other uart&amp;#39;s (uart2 and uart1) easily using the PM comands:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;rc&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;pm_device_state_set&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;dev_uart&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;PM_DEVICE_STATE_SUSPENDED&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;rc&amp;nbsp;=&amp;nbsp;pm_device_state_set(dev_uart, PM_DEVICE_STATE_OFF)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;rc&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;pm_device_action_run&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;dev_uart&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;PM_DEVICE_ACTION_TURN_OFF&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;but not for uart0&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Thank you&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Paul&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: power down/disable uart0 that is being used by the Peripheral UART sample</title><link>https://devzone.nordicsemi.com/thread/402284?ContentTypeID=1</link><pubDate>Tue, 27 Dec 2022 13:09:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e940dc73-b7e3-40e3-94ea-0c4ee7074439</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Paul&lt;/p&gt;
&lt;p&gt;Are you planning to respond to the question from Vidar in the similar private case?&lt;/p&gt;
[quote user=""]for device power managment, i want to power down/disable uart0 that is being used by the Peripheral UART sample. &lt;br /&gt;it is giving errors when doing it via the .conf and overlay file as it is being used by the NUS functions?&amp;nbsp;[/quote]
&lt;p&gt;If you disable the UART permanently then it will probably fail, yes, as the UART is referenced by the sample.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If I understand you correctly you want to use the UART occasionally, but then disable it when it is not being used in order to reduce current consumption?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>