<?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>UART power consumption Zephyr NRF52833</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/90206/uart-power-consumption-zephyr-nrf52833</link><description>Hi all! 
 I am developing an application with Zephyr (commit b21a91e46833cfcf4f2bda9e3e0f9d8c2150882e) on nrf52833 and a Ublox SARA R5. I communicate with the module via the UART and I am now trying to optimise the power consumption. When I run the code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Aug 2022 09:55:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/90206/uart-power-consumption-zephyr-nrf52833" /><item><title>RE: UART power consumption Zephyr NRF52833</title><link>https://devzone.nordicsemi.com/thread/380326?ContentTypeID=1</link><pubDate>Fri, 05 Aug 2022 09:55:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39d8053c-ebf7-4c6e-82c7-66813a94413d</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We only support nRF Connect SDK in our integration layer and we can&amp;#39;t really help if the customer wants to use the vanilla Zephyr. That is, all the development was with nRF Connect SDK in mind, and we cannot guarantee it will work without code changes in a different context.&lt;/span&gt;&lt;/p&gt;
[quote user="sixaxix9"]If I set CONFIG_SERIAL disabled, won&amp;#39;t this disable the UART functionality?[/quote]
&lt;p&gt;Agree.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART power consumption Zephyr NRF52833</title><link>https://devzone.nordicsemi.com/thread/378988?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2022 19:00:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f3832ff-87e0-4591-948f-6de724a151d3</guid><dc:creator>sixaxix9</dc:creator><description>&lt;p&gt;Hi Amanda, thank you for your answer.&lt;/p&gt;
&lt;p&gt;Unfortunately, installing the NCS is not an option, as the code to be used has to be pulled from the Zephyr GitHub repo.&lt;/p&gt;
&lt;p&gt;I have LOG functions in the code, so I have to set up CONFIG_LOG always enabled. If I set CONFIG_SERIAL disabled, won&amp;#39;t this disable the UART functionality?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART power consumption Zephyr NRF52833</title><link>https://devzone.nordicsemi.com/thread/378242?ContentTypeID=1</link><pubDate>Fri, 22 Jul 2022 09:01:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2b027b2-27fa-4d35-9b94-845878f419c4</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user="sixaxix9"]I am getting error -134 when trying to set the UART to state off:[/quote]
&lt;p&gt;Do you install&amp;nbsp;&lt;span&gt;Zephyr via our NCS? If not, could you install NCS v1.9 which includes Zephyr 2.7?&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
[quote user="sixaxix9"]After some digging in the Zephyr power management code I found out that I should be using `pm_device_action_run`. It actually helped saving about 700uA, but we still get a baseline of 1mA instead of few uA (that we achieve with the UART disabled in the devicetree). Any pointers?[/quote]
&lt;p&gt;Could you also try to set CONFIG_LOG=n and&amp;nbsp;CONFIG_SERIAL=n in the prj.conf?&lt;/p&gt;
&lt;p&gt;There is an example provided by my colleague in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/89221/nrf5340-uart-completely-turn-off-and-turn-on-dynamically-in-app-program/373708"&gt;this thread&lt;/a&gt;. Could you also try that?&lt;/p&gt;
&lt;p&gt;-Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART power consumption Zephyr NRF52833</title><link>https://devzone.nordicsemi.com/thread/378067?ContentTypeID=1</link><pubDate>Thu, 21 Jul 2022 11:34:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0bff9e3-6ff2-4555-a192-e6f3f427c935</guid><dc:creator>sixaxix9</dc:creator><description>&lt;p&gt;Hi Amanda, thank you for your reply :)&lt;/p&gt;
&lt;p&gt;I am getting error -134 when trying to set the UART to state off:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;error = pm_device_state_set(DEVICE_DT_GET(DT_NODELABEL(uart1)), PM_DEVICE_STATE_OFF);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Please consider that I am using Zephyr 2.7 (commit in first message) and I have changed the function names accordingly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART power consumption Zephyr NRF52833</title><link>https://devzone.nordicsemi.com/thread/378059?ContentTypeID=1</link><pubDate>Thu, 21 Jul 2022 11:16:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:029c1a7e-b93d-4cff-94ab-90680500d538</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can use&amp;nbsp;the power management API as&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// Turn off UART1:

uart1 = device_get_binding(DT_LABEL(DT_NODELABEL(uart1)));

device_set_power_state(uart1, DEVICE_PM_OFF_STATE, NULL, NULL);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;See&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/71793/why-is-my-psm-floor-current-600-a-asset-tracker-thingy-91/298819"&gt;this thread&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART power consumption Zephyr NRF52833</title><link>https://devzone.nordicsemi.com/thread/378055?ContentTypeID=1</link><pubDate>Thu, 21 Jul 2022 11:11:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0b07059-a714-4608-a19d-5b7b2bd9e765</guid><dc:creator>sixaxix9</dc:creator><description>&lt;p&gt;Update:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;After some digging in the Zephyr power management code I found out that I should be using `pm_device_action_run`. It actually helped saving about 700uA, but we still get a baseline of 1mA instead of few uA (that we achieve with the UART disabled in the devicetree). Any pointers? :)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;pre class="ui-code" data-mode="text"&gt;error = pm_device_action_run(DEVICE_DT_GET(DT_NODELABEL(uart1)), PM_DEVICE_ACTION_RESUME);&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>