<?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>NCS Power Management</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/94431/ncs-power-management</link><description>Some clarification on Power Management using NCS/Zephyr, please, for present and future use: 1. There is System PM and Device PM. 2. System PM is associated with the processor. When the main thread (and all other threads) end (yield or sleep) and the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 Nov 2023 22:22:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/94431/ncs-power-management" /><item><title>RE: NCS Power Management</title><link>https://devzone.nordicsemi.com/thread/454324?ContentTypeID=1</link><pubDate>Mon, 06 Nov 2023 22:22:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94336941-8384-4102-b71a-52ba5bbfe3e6</guid><dc:creator>Ryjan</dc:creator><description>&lt;p&gt;Just in case someone is looking for information on the follow-up subject, like I was, it can be found &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/94547/device-power-management-and-saadc"&gt;here.&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS Power Management</title><link>https://devzone.nordicsemi.com/thread/398931?ContentTypeID=1</link><pubDate>Mon, 05 Dec 2022 09:21:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e360a7e0-6e5d-4375-8bf1-8a80eb1f058b</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Please create a separate ticket for this. This thread has already been with multiple different info which would be hard to search for other forum members.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We try to keep one thread to one context/querry.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS Power Management</title><link>https://devzone.nordicsemi.com/thread/398856?ContentTypeID=1</link><pubDate>Sat, 03 Dec 2022 01:12:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56fb8a39-7bbc-48c0-a01b-3cacbe79db5e</guid><dc:creator>David Ormand</dc:creator><description>&lt;p&gt;Thanks, this helps a lot.&lt;/p&gt;
&lt;p&gt;Now I&amp;#39;ve got more of a QUESTION about NCS Power Management:&lt;/p&gt;
&lt;p&gt;I&amp;#39;m guessing (and was not informed otherwise by any response to my clarification point #8 (the first #8, oops)) that Device PM puts a peripheral into low-power by setting the ENABLE register of the peripheral to disable it, and then the PMU on the chip automatically shuts down the power and/or clock to the peripheral.&lt;/p&gt;
&lt;p&gt;The Runtime Device PM uses a&amp;nbsp;&lt;span&gt;pm_device_runtime_enable&lt;/span&gt;(dev) call, where &amp;quot;dev&amp;quot; is a pointer to a struct device pointer, same as used in the device_is_ready() call.&lt;/p&gt;
&lt;p&gt;Our project uses GPIO for LEDs, the ADC to monitor the supply bus, and I2C for a sensing peripheral.&amp;nbsp; In main(), I call device_is_ready() for everything, and that works.&amp;nbsp; At the end of main(), I call &lt;span&gt;pm_device_runtime_enable() for all those struct device pointer things for which device_is_ready() was called.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I2C works.&amp;nbsp; I guess Device PM for I2C is implemented.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;GPIO (&amp;quot;led.port&amp;quot;) does not work.&amp;nbsp; -134, ENOTSUP.&amp;nbsp; I see in other DevZone queries that the GPIO subsystem is not subject to power shutdown, and it does not have an ENABLE register.&amp;nbsp; So I&amp;#39;m not surprised.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;ADC (&amp;quot;&lt;/span&gt;&lt;span&gt;adc_channels&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;].&lt;/span&gt;&lt;span&gt;dev&amp;quot;) does not work.&amp;nbsp; -134, ENOTSUP.&amp;nbsp; This is surprising that the SAADC cannot be controlled by Device PM under NCS.&amp;nbsp; It has an ENABLE register.&amp;nbsp; I see in other posts that the ADC could be shut down in older contexts (HAL/nrf?).&amp;nbsp; Am I missing something?&amp;nbsp; Or do I need to use the nrf libraries to shut down the SAADC between readings?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS Power Management</title><link>https://devzone.nordicsemi.com/thread/398630?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2022 19:05:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4dd29b47-38ef-4fab-98f6-2288d6ffba10</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user=""]6. I&amp;#39;ve seen external sample code (from a DevZone query) in which all the&lt;br /&gt; unused peripherals are &amp;quot;disabled&amp;quot; in a DeviceTree overlay. Since none of&lt;br /&gt; the Zephyr samples do this, I&amp;#39;m guessing that unless a peripheral is&lt;br /&gt; activated (via is_device_ready()), it never gets powered, or Device PM&lt;br /&gt; makes sure it never gets powered.[/quote]
&lt;p&gt;ANot sure if you are asking any question but all points above and including this seems correct.&lt;/p&gt;
[quote user=""] I&amp;#39;m guessing the RTC wakes up the CPU to run any timers that&lt;br /&gt; are configured, and to perform the Bluetooth radio activities on schedule.&lt;br /&gt; So one of the three RTCs never gets shut down (which one?).[/quote]
&lt;p&gt;It is NRF_RTC1, please look into&amp;nbsp;\ncs\v2.x\zephyr\drivers\timer\nrf_rtc_timer.c&lt;/p&gt;
[quote user=""]I&amp;#39;m guessing a timer interrupt will wake up&lt;br /&gt; the system just like a &amp;quot;tick&amp;quot;, and there will be a system wake-up latency.[/quote]
&lt;p&gt;Yes,rtc&amp;nbsp; timer interrupt is enabled to wakeup and handle its current_tick count updates.&lt;/p&gt;
[quote user=""]8. There are a CONFIG_PM_CPU_OPS and a CONFIG_PM_DEVICE_POWER_DOMAIN and a&lt;br /&gt; CONFIG_PM_DEVICE_RUNTIME_EXCLUSIVE and a series of CONFIG_PM_MCUX_ config&lt;br /&gt; options, but none of the nrf or Zephyr samples use them, so they must not&lt;br /&gt; be critical. Or maybe not even wired up in NCS.[/quote]
&lt;p&gt;I am not sure.&lt;/p&gt;
[quote user=""]9. I see some main() functions in the samples end in a busy loop and some&lt;br /&gt; that do not. I&amp;#39;ve got (pre-PM) code now that after setting up the&lt;br /&gt; Bluetooth structure and start a timer just ends and lets everything&lt;br /&gt; just work. I&amp;#39;m guessing that the main() function exits to the idle&lt;br /&gt; thread. Or would it be better to end in a forever-sleep?[/quote]
&lt;p&gt;Main can exit when it is not doing kernel initialization. This is clearly defined in the documentation for &lt;a href="https://docs.zephyrproject.org/1.14.1/reference/kernel/threads/index.html#system-threads"&gt;system threads&lt;/a&gt;.Not using main in application is still ok if the application does not need one.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>