<?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>QSPI NOR power manager errrors when CONFIG_PM_DEVICE_RUNTIME is set</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113436/qspi-nor-power-manager-errrors-when-config_pm_device_runtime-is-set</link><description>I recently enabled power management in my code base by adding these two oiptions to my prj.conf: 
 
 CONFIG_PM_DEVICE = y 
 CONFIG_PM_DEVICE_RUNTIME = y 
 
 The code runs on an nRF5340 MCU with a LittleFS instance in an external MX25R64 QSPI flash. It</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 Jul 2024 12:21:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113436/qspi-nor-power-manager-errrors-when-config_pm_device_runtime-is-set" /><item><title>RE: QSPI NOR power manager errrors when CONFIG_PM_DEVICE_RUNTIME is set</title><link>https://devzone.nordicsemi.com/thread/496205?ContentTypeID=1</link><pubDate>Tue, 30 Jul 2024 12:21:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:144cb2cd-f7f2-4294-a776-2ffd4ce60914</guid><dc:creator>Bogdan Marinescu</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Thank you, that is reassuring. If possible, please let your developers know about the piece of code that I linked to in my previous post. It might be perfectly fine, but I think that taking another look at it doesn&amp;#39;t hurt.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Bogdan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: QSPI NOR power manager errrors when CONFIG_PM_DEVICE_RUNTIME is set</title><link>https://devzone.nordicsemi.com/thread/496193?ContentTypeID=1</link><pubDate>Tue, 30 Jul 2024 12:00:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c1f5693-7396-4f7c-830c-a5c5f1ab0cc7</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Bogdan&lt;/p&gt;
&lt;p&gt;So I double checked with the devs regarding this, and I&amp;#39;m told that yyou can safely ignore this error, as it is just the QSPI letting you know it can&amp;#39;t be powered down because of XIP being enabled. If everything works as intended you should be just fine. They will also double check the driver to make sure it&amp;#39;s working correctly, but at first glance&amp;nbsp;it seems okay.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: QSPI NOR power manager errrors when CONFIG_PM_DEVICE_RUNTIME is set</title><link>https://devzone.nordicsemi.com/thread/495981?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2024 11:03:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9472f921-6056-42b1-936e-c715f86cd67e</guid><dc:creator>Bogdan Marinescu</dc:creator><description>&lt;p&gt;Hi SImon,&lt;/p&gt;
&lt;p&gt;I am definitely not ttrying to put the MCU to sleep manually. When I enabled &lt;strong&gt;CONFIG_PM_DEVICE_RUNTIME&lt;/strong&gt;, I added various calls to &lt;strong&gt;pm_device_runtime_get&lt;/strong&gt; and &lt;strong&gt;pm_device_runtime_put&lt;/strong&gt; in my code. With these changes in places, power management should be automatic: the PM subsystem&amp;nbsp;should figure out which device(s) it can put to sleep and when (I am not considering device drivers here (which need to do more work), because my code doesn&amp;#39;t implement any device drivers, it just uses the existing ones). However, none of the PM calls in my code touch the QSPI NOR device, I just use the existing driver. And the driver should do all the required PM work automatically. Looking at the driver, I don&amp;#39;t think it&amp;#39;s doing it correctly. I&amp;#39;m talking specifially about&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.6.99-ncs2/drivers/flash/nrf_qspi_nor.c#L318-L323:"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v3.6.99-ncs2/drivers/flash/nrf_qspi_nor.c#L318-L323:&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;if (!dev_data-&amp;gt;xip_enabled) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; qspi_clock_div_change();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; pm_device_busy_set(dev);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt; }&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I would think that you want to call &lt;strong&gt;pm_device_busy_set&lt;/strong&gt; when XIP is &lt;strong&gt;enabled&lt;/strong&gt;, not disabled, like the code above does? There might be other places where this isn&amp;#39;t used correctly, I just highlighted one that looks suspicious.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Bogdan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: QSPI NOR power manager errrors when CONFIG_PM_DEVICE_RUNTIME is set</title><link>https://devzone.nordicsemi.com/thread/495939?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2024 07:46:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51b705f9-8c17-46d8-a46f-85a2c3e8b80c</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Okay, so I think what&amp;#39;s happening here is that this error is caused because you&amp;#39;ve set&amp;nbsp;&lt;span&gt;&lt;strong&gt;CONFIG_NORDIC_QSPI_NOR_XIP&lt;/strong&gt;=y in your project, because it will keep the QSPI busy to avoid it from being affected by the power management. But something in your project does use power management, that is in turn rejected by the QSPI. Are you trying to put the nRF53 to sleep at all, because that will also call the &lt;strong&gt;pm_device_runtime_put&lt;/strong&gt; I believe.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: QSPI NOR power manager errrors when CONFIG_PM_DEVICE_RUNTIME is set</title><link>https://devzone.nordicsemi.com/thread/495891?ContentTypeID=1</link><pubDate>Sun, 28 Jul 2024 06:51:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a740b31-9844-44c3-96e4-52ebd5ead894</guid><dc:creator>Bogdan Marinescu</dc:creator><description>&lt;p&gt;Hi SImon,&lt;/p&gt;
&lt;p&gt;Thabks for your reply. I&amp;nbsp;agree with the first part of your answer: indeed, it seems like the QSPI NOR device is busy when pm_device_runtime_put is being called. However, I disagree with &amp;quot;something in your application is trying to put the device in a suspended state&amp;quot;, because I don&amp;#39;t do any explicit power management on the QSPI NOR in my application. And I don&amp;#39;t think I should, because I believe that the QSPI NOR driver (and maybe some lower level drivers) should do this automatically. If my applcation should actually be involved in this process, please let me know how.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Bogdan&lt;/p&gt;
&lt;p&gt;EDIT: also, remember what I said earlier: in my application, I don&amp;#39;t actually want the QSPI NOR to go to sleep, which is why I&amp;nbsp;set CONFIG_NORDIC_QSPI_NOR_XIP=y. It is my understanding that this configuration option should prevent the QSPI NOR from sleeping. If this is correct, then the driver shouldn&amp;#39;t attempt to put it to sleep at all.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: QSPI NOR power manager errrors when CONFIG_PM_DEVICE_RUNTIME is set</title><link>https://devzone.nordicsemi.com/thread/495831?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2024 13:28:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:772e2b42-8382-4641-9961-e22844f9f9fd</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Error message -16 points to the device or resource you&amp;#39;re calling being busy, so it seems the QSPI is doing something when the pm_device_runtime_put() function is being called in your project. If you don&amp;#39;t intend to suspend the device, like this function does, you should find out where and why it&amp;#39;s being called, as something in your application is trying to put the device in a suspended state.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>