<?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>Flash is25lp032d fails to enter sleep mode after erase.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114028/flash-is25lp032d-fails-to-enter-sleep-mode-after-erase</link><description>I am using is25lp03d flash with &amp;quot;nordic,qspi-nor&amp;quot; driver. 
 The issue is that nrf_qspi_nor.c driver uses `nrfx_qspi_mem_busy_check()` before entering suspend mode. This function repeatedly returns -EBUSY after erasing some portion of flash. 
 The solution</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 09 Sep 2024 11:55:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114028/flash-is25lp032d-fails-to-enter-sleep-mode-after-erase" /><item><title>RE: Flash is25lp032d fails to enter sleep mode after erase.</title><link>https://devzone.nordicsemi.com/thread/501713?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2024 11:55:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:677821ae-9ee0-4852-aed3-938039fe019e</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Micha&lt;span&gt;ł&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I heard back from a developer today, sorry that it took a while. They think the proposed workaround in the original post is incorrect, as&amp;nbsp;&lt;span&gt;&lt;span dir="ltr"&gt;&lt;code&gt;nrfx_qspi_mem_busy_check()&lt;/code&gt;&amp;nbsp;cannot use .wipwait = true&amp;nbsp;since the purpose of this function is to check and immediately return the memory chip status. To solve this issue, the&amp;nbsp;nrf_qspi_nor driver should wait until the erase is completed (as the spi_nor driver does). There&amp;#39;s an upstream PR that adds this waiting period here: &lt;a title="https://github.com/zephyrproject-rtos/zephyr/pull/75861" href="https://github.com/zephyrproject-rtos/zephyr/pull/75861" rel="noopener noreferrer" target="_blank"&gt;https://github.com/zephyrproject-rtos/zephyr/pull/75861&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;Best regards,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;Simon&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash is25lp032d fails to enter sleep mode after erase.</title><link>https://devzone.nordicsemi.com/thread/500679?ContentTypeID=1</link><pubDate>Mon, 02 Sep 2024 05:34:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f1ba9fc-ebbb-42f5-8911-a895fd2836b9</guid><dc:creator>Michal Piekos</dc:creator><description>&lt;p&gt;Below is the backtrace right up to the moment when `nrfx_qspi_mem_busy_check` is suppose to return NRFX_RETURN_BUSY:&lt;/p&gt;
&lt;p&gt;#0 nrfx_qspi_mem_busy_check () at /workdir/modules/hal/nordic/nrfx/drivers/src/nrfx_qspi.c:697&lt;br /&gt;#1 0x000230b2 in qspi_suspend (dev=0x48bc4 &amp;lt;__device_dts_ord_130&amp;gt;)&lt;br /&gt; at /workdir/zephyr/drivers/flash/nrf_qspi_nor.c:1250&lt;br /&gt;#2 qspi_nor_pm_action (dev=0x48bc4 &amp;lt;__device_dts_ord_130&amp;gt;, action=&amp;lt;optimized out&amp;gt;)&lt;br /&gt; at /workdir/zephyr/drivers/flash/nrf_qspi_nor.c:1298&lt;br /&gt;#3 0x00019136 in runtime_suspend (async=&amp;lt;optimized out&amp;gt;, delay=..., dev=0x48bc4 &amp;lt;__device_dts_ord_130&amp;gt;)&lt;br /&gt; at /workdir/zephyr/subsys/pm/device_runtime.c:85&lt;br /&gt;#4 0x000191c0 in pm_device_runtime_put (dev=dev@entry=0x48bc4 &amp;lt;__device_dts_ord_130&amp;gt;)&lt;br /&gt; at /workdir/zephyr/subsys/pm/device_runtime.c:333&lt;br /&gt;#5 0x00022dc2 in qspi_release (dev=dev@entry=0x48bc4 &amp;lt;__device_dts_ord_130&amp;gt;)&lt;br /&gt; at /workdir/zephyr/drivers/flash/nrf_qspi_nor.c:329&lt;br /&gt;#6 0x0002377e in qspi_nor_erase (dev=0x48bc4 &amp;lt;__device_dts_ord_130&amp;gt;, addr=&amp;lt;optimized out&amp;gt;, size=&amp;lt;optimized out&amp;gt;)&lt;br /&gt; at /workdir/zephyr/drivers/flash/nrf_qspi_nor.c:1002&lt;br /&gt;#7 0x00024252 in cmd_erase (sh=0x48fb0 &amp;lt;shell_uart&amp;gt;, argc=&amp;lt;optimized out&amp;gt;, argv=&amp;lt;optimized out&amp;gt;)&lt;br /&gt; at /workdir/zephyr/drivers/flash/flash_shell.c:102&lt;br /&gt;#8 0x0001c1c0 in exec_cmd (help_entry=0x20010f9c &amp;lt;shell_uart_stack+3556&amp;gt;, argv=0x20010fb4 &amp;lt;shell_uart_stack+3580&amp;gt;, &lt;br /&gt; argc=&amp;lt;optimized out&amp;gt;, sh=0x48fb0 &amp;lt;shell_uart&amp;gt;) at /workdir/zephyr/subsys/shell/shell.c:558&lt;br /&gt;#9 execute (sh=sh@entry=0x48fb0 &amp;lt;shell_uart&amp;gt;) at /workdir/zephyr/subsys/shell/shell.c:800&lt;br /&gt;#10 0x0001c450 in state_collect (sh=0x48fb0 &amp;lt;shell_uart&amp;gt;) at /workdir/zephyr/subsys/shell/shell.c:1008&lt;br /&gt;#11 shell_process (sh=0x48fb0 &amp;lt;shell_uart&amp;gt;) at /workdir/zephyr/subsys/shell/shell.c:1483&lt;br /&gt;#12 0x0001bb5e in shell_signal_handle (sh=sh@entry=0x48fb0 &amp;lt;shell_uart&amp;gt;, sig_idx=sig_idx@entry=SHELL_SIGNAL_RXRDY, &lt;br /&gt; handler=handler@entry=0x1c2d5 &amp;lt;shell_process&amp;gt;) at /workdir/zephyr/subsys/shell/shell.c:1296&lt;br /&gt;#13 0x0001cc32 in shell_thread (arg_log_backend=&amp;lt;optimized out&amp;gt;, arg_log_level=&amp;lt;optimized out&amp;gt;, &lt;br /&gt; shell_handle=0x48fb0 &amp;lt;shell_uart&amp;gt;) at /workdir/zephyr/subsys/shell/shell.c:1352&lt;br /&gt;#14 shell_thread (shell_handle=0x48fb0 &amp;lt;shell_uart&amp;gt;, arg_log_backend=&amp;lt;optimized out&amp;gt;, arg_log_level=&amp;lt;optimized out&amp;gt;)&lt;br /&gt; at /workdir/zephyr/subsys/shell/shell.c:1314&lt;br /&gt;#15 0x000154dc in z_thread_entry (entry=0x1cb71 &amp;lt;shell_thread&amp;gt;, p1=0x48fb0 &amp;lt;shell_uart&amp;gt;, p2=0x1, p3=0x4)&lt;br /&gt; at /workdir/zephyr/lib/os/thread_entry.c:48&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash is25lp032d fails to enter sleep mode after erase.</title><link>https://devzone.nordicsemi.com/thread/499960?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 11:30:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c5112c3-bcf3-4e84-a37c-4183d89eef92</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;While I&amp;#39;m looking into/asking internally about this, you&amp;#39;re not able to see where exactly the suspend is being called from, are you?&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: Flash is25lp032d fails to enter sleep mode after erase.</title><link>https://devzone.nordicsemi.com/thread/499522?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2024 10:58:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b89c232-15eb-46cc-b9ad-ccda416d46e2</guid><dc:creator>Michal Piekos</dc:creator><description>&lt;p&gt;Hi Simon&lt;/p&gt;
&lt;p&gt;Thanks for looking into it.&lt;/p&gt;
&lt;p&gt;The flash erase takes 7s and it is almost exactly in the middle of the range suggested by datasheet.&lt;br /&gt;&lt;br /&gt;I am using:&lt;br /&gt;`boot_erase_img_bank` which is calling `flash_area_erase` which is calling `flash_erase` which is calling `z_impl_flash_erase` which is calling `nrf_qspi_nor.c:qspi_erase()`&lt;br /&gt;Then probably Power Management subsystem is suspending flash by calling `nrf_qspi_nor.c:qspi_suspend()`.&lt;br /&gt;&lt;br /&gt;I do not control the time between calling erase and suspend. It is all within driver. That is why I suggested above implementation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash is25lp032d fails to enter sleep mode after erase.</title><link>https://devzone.nordicsemi.com/thread/499322?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2024 08:27:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aef98389-4856-465c-97da-991baccaa77a</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Michał&lt;/p&gt;
&lt;p&gt;What might be happening here is that the device is still erasing when you ask it to suspend so the response from the device is that it&amp;#39;s still busy doing something. Are you sure the error doesn&amp;#39;t return from the erase &amp;quot;ongoing&amp;quot; function, since it seems that the erase returns before the device has completed its operation.&lt;/p&gt;
&lt;p&gt;How long is the timing between you trying to erase and calling the sleep mode function, and what are the erase timings of the chip?&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: Flash is25lp032d fails to enter sleep mode after erase.</title><link>https://devzone.nordicsemi.com/thread/498989?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2024 09:02:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:244ea518-1138-4d4e-a22b-481a91f5a6a4</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I will have to check with the devs about this ticket, but to me it sounds like an okay way to handle things at least. I&amp;#39;ll get back to you when I hear from the devs.&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>