<?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>Zephyr 3.5: Power Management subsystem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106189/zephyr-3-5-power-management-subsystem</link><description>Hello, guys. 
 
 We have the application running on Zephyr RTOS (nRF52840 SoC) that is periodically switching between the sleeping (System ON) and active modes of operation. In System ON mode of operation the sample was consuming a few uA of current </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Dec 2023 15:07:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106189/zephyr-3-5-power-management-subsystem" /><item><title>RE: Zephyr 3.5: Power Management subsystem</title><link>https://devzone.nordicsemi.com/thread/458776?ContentTypeID=1</link><pubDate>Mon, 04 Dec 2023 15:07:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6541060f-e1c1-4db8-8ff5-a16f439e46ac</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Bojan,&lt;/p&gt;
&lt;p&gt;Thank you for the detailed explanation.&amp;nbsp;HAS_PM was &lt;a href="https://github.com/nrfconnect/sdk-zephyr/commit/3d2194f11e465adb2b99dfe85f88fef41ace7500"&gt;added for also nRF platforms&lt;/a&gt; originally, but then removed &lt;a href="https://github.com/zephyrproject-rtos/zephyr/commit/96b38273138f05dd06cf7a58fa361f401e773e5e"&gt;here&lt;/a&gt;, as there should not be any need for it. See the commit message for details. This system is a bit messy, but the PM and DEVICE_PM systems should be independent. So&amp;nbsp;pm_device_action_run() does not depend on CONFIG_HAS_PM.&lt;/p&gt;
&lt;p&gt;Do you have some code that use the PM hooks (and therefore fails without&amp;nbsp;CONFIG_HAS_PM)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr 3.5: Power Management subsystem</title><link>https://devzone.nordicsemi.com/thread/458658?ContentTypeID=1</link><pubDate>Mon, 04 Dec 2023 08:11:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c43ca428-20a0-40bb-8842-36b06dd3b8a3</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sorry for a delayed reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Let me update the status of our issue. We ported and tested our sample application in NCS environment. In NCS 2.4.2 that embeds Zephyr v3.3.99, the sample behaves as expected, no current spikes:&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/Screenshot_5F00_23.png" /&gt;&lt;/p&gt;
&lt;p&gt;The same sample application in latest NCS 2.5.0 environment that embeds Zephyr v3.4.99 does not behave as expected. The above mentioned periodic current spikes started to appear:&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/Screenshot_5F00_24.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;We tried to figure out what might be the reason for that and it seems that the current spikes are there because the UART console is not properly turned OFF with:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;pm_device_action_run(console, PM_DEVICE_ACTION_SUSPEND);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It seems that the above power management API did not have effect (even though we set the &lt;em&gt;&lt;strong&gt;CONFIG_PM&lt;/strong&gt; &lt;/em&gt;item to &lt;em&gt;&lt;strong&gt;y&lt;/strong&gt; &lt;/em&gt;in our &lt;em&gt;prj.conf&lt;/em&gt; file) because &lt;em&gt;&lt;strong&gt;CONFIG_HAS_PM&lt;/strong&gt; &lt;/em&gt;flag was not set to &lt;em&gt;&lt;strong&gt;y&lt;/strong&gt;&lt;/em&gt;. According to the Zephyr migration guide, this needs to be done:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Platforms that implement power management hooks must explicitly select&amp;nbsp;&lt;/span&gt;&lt;a class="reference internal" title="CONFIG_HAS_PM" href="https://docs.zephyrproject.org/latest/kconfig.html#CONFIG_HAS_PM"&gt;&lt;code class="xref kconfig kconfig-option docutils literal notranslate"&gt;&lt;span class="pre"&gt;CONFIG_HAS_PM&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;in Kconfig.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When we explicitly set &lt;em&gt;&lt;strong&gt;HAS_PM&lt;/strong&gt;&lt;/em&gt; in our Kconfig file with:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;config APP_PROVIDE_PM_HOOKS
	bool &amp;quot;Application provides PM hooks&amp;quot;
	default y
	select HAS_PM&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;the current spikes disappeared. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If the nRF52840 platform supports the power management hooks, would it make sense that you include that info directly in the&amp;nbsp;&lt;strong&gt;&lt;span style="background-color:#ccffcc;"&gt;&lt;em&gt;config SOC_SERIES_NRF52X&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt; definition (&lt;em&gt;zephyr/boards/soc/arm/nordic_nrf/nrf52/Kconfig.series&lt;/em&gt; file):&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;config SOC_SERIES_NRF52X
	bool &amp;quot;Nordic Semiconductor nRF52 series MCU&amp;quot;
	select ARM
	select SOC_COMPATIBLE_NRF52X
	select CPU_CORTEX_M4
	select CPU_HAS_ARM_MPU
	select SOC_FAMILY_NRF
	select XIP
	select HAS_NRFX
	select HAS_NORDIC_DRIVERS
	select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE
	select HAS_SWO
	select HAS_POWEROFF
	select HAS_PM
	help
	  Enable support for NRF52 MCU series&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Sincerely,&lt;br /&gt;Bojan&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr 3.5: Power Management subsystem</title><link>https://devzone.nordicsemi.com/thread/458330?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 14:08:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3df65c71-ce53-48b0-8aa2-0ad908a80eca</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Bojan,&lt;/p&gt;
&lt;p&gt;I am not able to say much based on this.&amp;nbsp;Can you elaborate on what you are doing so that we can understand more about what would cause this?&lt;/p&gt;
&lt;p&gt;Please also note that while I don&amp;#39;t have any reason to believe this is related, Nordic only support the nRF Connect SDK, and not vanilla Zephyr.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr 3.5: Power Management subsystem</title><link>https://devzone.nordicsemi.com/thread/458166?ContentTypeID=1</link><pubDate>Wed, 29 Nov 2023 16:05:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:032031db-b424-482a-988f-35e806c87128</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;An update from my side...&lt;/p&gt;
&lt;p&gt;When disabling the device runtime power management with:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_PM_DEVICE_RUNTIME=n&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the current spikes in active mode seem to dissapear:&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/8712.Screenshot_5F00_13.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>