<?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>Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70846/concurrently-using-xip-and-qspi-to-read-back-data-from-external-flash</link><description>Dear Nordic, 
 
 I have a 4MB external flash on my board, I&amp;#39;ve successfully run the code on it by using XIP. However, I got stuck when I was trying to read back data from external flash. The following picture has the call stack trace. It&amp;#39;s a failure of</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Nov 2019 14:53:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70846/concurrently-using-xip-and-qspi-to-read-back-data-from-external-flash" /><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290905?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2019 14:53:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58351312-24f6-48f5-b075-5ba48e1dfb36</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;It is my understanding that no IRQ handler will work in XiP memory, regardless of whether you&amp;#39;re using the QSPI driver or not. You will need to place all IRQ handlers in internal flash.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290904?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2019 10:52:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e09f0c96-d453-44d7-906d-85458b63b4b2</guid><dc:creator>yuting0501</dc:creator><description>&lt;p&gt;If we disable all the interrupts, then we cannot deal with user BLE callback...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290903?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2019 10:49:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b22ca0b0-f468-435a-98f8-8f5d6648c68f</guid><dc:creator>yuting0501</dc:creator><description>[quote user="haakonsh"]If the IRQ for the QSPI is in internal flash you wont have any problems with interrupts of higher priority as the CPU will return to the internal flash to finish proccessing the IRQ or driver before returning to XiP.&amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;Sorry, I don&amp;#39;t understand why it is safe without disabling all interrupts, QSPI interrupt occurs when DMA transfer is finished, but when it is&amp;nbsp;&lt;span&gt;transferring, if some interrupt comes, for example, Systick, the Systick interrupt handler is in the external flash, then MCU crashes.&lt;br /&gt;&lt;br /&gt;As per my understanding, we have to use block send for QSPI and disable all interrupts during data transfer. Does it make sense?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290902?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2019 10:13:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c9eb89d-54e1-4540-a8c9-58e6ff8dbd30</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Well, you can&amp;#39;t execute code from XiP whenever the QSPI driver in internal flash tries to R/W to external flash. What you need to do is to prevent the CPU from returning to code in XiP. You can make the calls to the QSPI driver blocking calls, that does not return until the QSPI operation is complete. In that way you should be safe.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;If the IRQ for the QSPI is in internal flash you wont have any problems with interrupts of higher priority as the CPU will return to the internal flash to finish proccessing the IRQ or driver before returning to XiP.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290901?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2019 01:43:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:525fce39-28e7-4feb-a681-817a4eba46c1</guid><dc:creator>yuting0501</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Håkon&lt;/span&gt;, thanks for your reply.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;You&amp;#39;ll have to compile the QSPI driver and place it in internal flash, then link to the driver in internal flash when you compile the application in XiP.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In this case, we have to disable all interrupts when reading/wiring data to an external flash because we can not execute any code at that time, right? Do you have any idea how to solve this side effect?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290900?ContentTypeID=1</link><pubDate>Thu, 21 Nov 2019 11:44:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cb20e9b-d56e-4e4e-a235-a99fd08dd923</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Hey Eugene,&lt;br /&gt;&lt;br /&gt;Hung is away on vacation and I&amp;#39;ve got your case for now.&lt;br /&gt;&lt;br /&gt;You&amp;#39;ll have to compile the QSPI driver and place it in internal flash, then link to the driver in internal flash when you compile the application in XiP.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;BR,&lt;br /&gt;Håkon H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290899?ContentTypeID=1</link><pubDate>Mon, 18 Nov 2019 09:38:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f3e5601-6f27-4b3d-9284-e5a2eed194da</guid><dc:creator>yuting0501</dc:creator><description>&lt;p&gt;I&amp;nbsp;guess we also&amp;nbsp;&lt;span&gt;encountered you mentioned that Data read from the XIP area is incorrect, the workaround we&amp;#39;re using is to change the optimization to O0 for that particular function.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290898?ContentTypeID=1</link><pubDate>Mon, 18 Nov 2019 09:24:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47aac4f8-db8f-47af-84ce-19f32304089d</guid><dc:creator>yuting0501</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Hung,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m not sure whether this workaround can solve my problem. Let&amp;#39;s put it in another way, since Nordic&amp;nbsp;has an example maybe called `qspi_bootloader`, imaging this, if you divide the external flash into two parts, the first part is for data storage, the second part is XIP region. To avoid the limitation that we can&amp;#39;t execute code in XIP and access QSPI flash using the code in XIP,&amp;nbsp;you put the QSPI driver in the internal flash. In your application running in the external flash, it calls the QSPI driver in the internal flash to read/write data to the data region in the external flash. Does it work?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;d really appreciate it if you can provide this kind of example&amp;nbsp;for me.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290897?ContentTypeID=1</link><pubDate>Mon, 18 Nov 2019 03:42:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a023c033-c288-469b-9fed-0a919f51a79e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Eugene,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We are releasing the PAN and the workaround for the issue. I attached here the draft version:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Condition&lt;/em&gt;&lt;/strong&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Code executing from internal flash or RAM reads data located in XIP region.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;The read performs two consecutive LDR instructions from XIP addresses, where the result of the first LDR instruction is used as the address of the second LDR. This occurs when dereferencing a pointer located in the XIP addresses&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;:&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;
&lt;div&gt;&lt;em&gt;Data read from XIP area is incorrect.&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Workaround&lt;/strong&gt;&lt;em&gt;:&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span&gt;To avoid the race condition, where code executing in internal memory accesses data stored in the XIP region, perform one of the following:&lt;/span&gt;&lt;br /&gt;&lt;span&gt;* Copy the read-only data into internal RAM before accessing it by the use of the memcpy() function.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;* Place the read-only data in internal flash memory at compile time in the linker script&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure the issue you are experiencing now is exactly the issue described in the PAN. Could you check if it is ? And could you try the workaround to use memcpy()?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;(Please don&amp;#39;t redistribute the PAN before it&amp;#39;s published)&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290896?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2019 13:02:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:716c0fa6-ddb5-4d21-9aa3-d039150d3ab4</guid><dc:creator>yuting0501</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;It has been a long time, however, I still couldn&amp;#39;t manage to solve this issue.&amp;nbsp;I&amp;#39;d really appreciate it if you can provide a demo for me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290895?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2019 01:38:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2cfe8eb-fa6d-4ad5-a772-97e78c79ec0b</guid><dc:creator>yuting0501</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Hung,&lt;/p&gt;
&lt;p&gt;Thank you very much for providing more information! We also met the issue you mentioned about incorrect value, temporarily we use optimization O0 to avoid it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For XIP, we&amp;#39;re going to disable all interrupts except Softdevice interrupts until finishing data transfer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290894?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2019 10:12:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:160e4435-603f-4cc1-9e73-db8f293546fe</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hei Eugene,&lt;/p&gt;
&lt;p&gt;I was checking internally regarding your question. Your concern makes sense. You would need to be really careful when using XIP. As you mentioned, avoid calling it in an interrupt.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Unfortunately, executing code in XIP having quite a lot of issue.We are also investigating another issue that causing reading data from XIP provide incorrect values. We are going to release a PAN regarding this shortly.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For now, we would suggest to use only DMA.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290893?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2019 02:52:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59ad31fb-3b2e-4967-ba84-162e12498f40</guid><dc:creator>yuting0501</dc:creator><description>&lt;p&gt;Any update?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290892?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 07:28:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dff209ce-a7c0-478e-b593-588c60817ba5</guid><dc:creator>yuting0501</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Even if I&amp;nbsp;put QSPI driver in the internal flash, what would happen if interrupts come while we&amp;#39;re reading/writing data to external flash?&lt;/p&gt;
&lt;p&gt;When the DMA is ongoing, XIP has to be turned off, if&amp;nbsp;&lt;span&gt;the interrupt handler is in the external flash, then the MCU crashes. So we have to make sure the code executed in the external flash should never be&amp;nbsp;called in the interrupts?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Does it make sense?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290891?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 13:05:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c190312-8b6c-4098-bdb6-4d90df1074b4</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Yes, it&amp;#39;s correct. You can&amp;#39;t execute code in XIP and access QSPI flash using the code in XIP.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can use the code in internal flash to access QSPI flash. But make sure you call the TASK_ACTIVATE after the XIP access and before you access the QSPI flash.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290890?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 07:44:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21597aa4-7cb9-4c5c-ad03-c7d74d7a6e87</guid><dc:creator>yuting0501</dc:creator><description>&lt;p&gt;Can I put QSPI driver and external flash driver in the internal flash, when accessing external flash data, the code is executed in the internal flash, so we can both use XIP and access external flash?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290889?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 07:30:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f4ed284-8d94-4433-a132-cee046dec84e</guid><dc:creator>yuting0501</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;So the conclusion is&amp;nbsp;&lt;/p&gt;
[quote user="hungbui"]it&amp;#39;s not possible to execute code in XIP that can access QSPI flash storage[/quote]
&lt;p&gt;&amp;nbsp;Right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290888?ContentTypeID=1</link><pubDate>Thu, 25 Jul 2019 09:42:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab908633-5ec7-49b4-b729-cb551ddf0050</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi again Eugene,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After consult with our R&amp;amp;D we have basically two issues:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- Our earlier information on devzone was wrong, it&amp;#39;s not possible to execute code in XIP that can access QSPI flash storage. If you are accessing to memory using XIP, and want to use standard EasyDMA communication, you have to re-init QSPI.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- There is a bug&amp;nbsp;after accessing XIP&amp;nbsp;that you would need to trigger a TASKS_ACTIVATE before you re-init QSPI. Otherwise the CPU will hang.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Basically you would need to&amp;nbsp;stop accessing XIP and then calling&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;span&gt;NRF_QSPI-&amp;gt;&lt;/span&gt;&lt;span&gt;EVENTS_READY&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;NRF_QSPI-&amp;gt;&lt;/span&gt;&lt;span&gt;TASKS_ACTIVATE&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;while&lt;/span&gt;&lt;span&gt;(NRF_QSPI-&amp;gt;&lt;/span&gt;&lt;span&gt;EVENTS_READY&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;==&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;) {};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;before&amp;nbsp;accessing to QSPI flash data. After that you can go back to XIP.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290887?ContentTypeID=1</link><pubDate>Wed, 24 Jul 2019 09:27:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d83bf6fa-98ec-4747-b3fb-b408de2bf77f</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Eugene,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry that the case is going slower than expected.&amp;nbsp;We have limited staff during the summer holiday period.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have contacted our R&amp;amp;D and I think we are on&amp;nbsp;a&amp;nbsp;limitation of the QSPI that&amp;nbsp;you may not be able to do XIP and access QSPI flash directly.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am checking with them to get the workaround. I will update you when I have the full information and workaround.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290886?ContentTypeID=1</link><pubDate>Wed, 24 Jul 2019 01:59:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:730a8940-b8aa-4205-b2e5-6d7aae0e0256</guid><dc:creator>yuting0501</dc:creator><description>&lt;p&gt;Since Nordic has an example to run XIP code in the external flash, could you please help modify the demo to read/write external flash, then I can compare it with my application. Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290885?ContentTypeID=1</link><pubDate>Tue, 23 Jul 2019 11:16:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7494fa64-d3a9-42de-baef-8ea92b0ecfd0</guid><dc:creator>yuting0501</dc:creator><description>&lt;p&gt;It doesn&amp;#39;t work for me, I increased&amp;nbsp; `&lt;span&gt;QSPI_DEF_WAIT_TIME_US&lt;/span&gt;`&amp;nbsp;to 1000. Did you ever try to divide an external flash into two parts? One part for the XIP code, another part for a file system or just flash operation.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I initialize nrfx_qspi In the bootloader to enable XIP, if I&amp;nbsp;&lt;span&gt;initialize&amp;nbsp;nrfx_qspi in the application again, it won&amp;#39;t execute any code and gets&amp;nbsp;stuck. If I don&amp;#39;t&amp;nbsp;initialize&amp;nbsp;nrfx_qspi&amp;nbsp;in the application, it gets timeout issue as we&amp;#39;re talking about.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290884?ContentTypeID=1</link><pubDate>Tue, 23 Jul 2019 09:55:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30baef66-d3fe-4f5a-af79-b9a86a77fc48</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Eugene,&lt;/p&gt;
&lt;p&gt;According to this case, it seems that when you execute code from XIP and access the external flash, you may have longer wait:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/42259/qspi-behavior-while-executing-xip-and-accessing-data-not-mapped-to-xip"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/42259/qspi-behavior-while-executing-xip-and-accessing-data-not-mapped-to-xip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Could you try modify&amp;nbsp;QSPI_DEF_WAIT_TIME_US to increase it a little bit, and check if the result is still failed ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290883?ContentTypeID=1</link><pubDate>Tue, 23 Jul 2019 02:50:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45243dd3-4fee-44a4-9ee3-78a1fed6dee9</guid><dc:creator>yuting0501</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;I think the assertion failure is caused by the flag `wipwait`, you can see from the trace stack and refer to the nrfx source code,`&lt;span&gt;wipwait` is set to false in `&lt;/span&gt;nrfx_qspi_mem_busy_check`.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="hungbui"]If you don&amp;#39;t do XIP and only do a read out the data in QSPI do you see an error ?&amp;nbsp;[/quote]
&lt;p&gt;No, when the same code runs in the internal flash, everything works fine.&amp;nbsp;&lt;/p&gt;
[quote user="hungbui"]Regarding your question about bootloader and application both use nrfx. Could you give some more information of the issue ? My understanding is that since the&amp;nbsp;driver status is remains in RAM , if it&amp;#39;s not been reinitialize in the application properly we may have an issue ?&amp;nbsp;&amp;nbsp;[/quote]
&lt;p&gt;nrfx driver is compiled twice for bootloader and application, that means we have&amp;nbsp;d&lt;span&gt;uplicated&lt;/span&gt; .data segment and .bss&amp;nbsp;&lt;span&gt;segment&amp;nbsp;&lt;/span&gt;for nrfx driver. When initializing nrfx driver in the bootloader, it just modifies .data(bootloader) and .bss(&lt;span&gt;bootloader&lt;/span&gt;), it has nothing to do with&amp;nbsp;&lt;span&gt;.data(application) and .bss(application&lt;/span&gt;&lt;span&gt;). After jumping to the application from the bootloader, we call&amp;nbsp;nrfx again, and it finds the driver is not initialized, so it repeats the initialization work again, for nrfx_qspi, if you initialize it again, XIP may not work properly&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&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;Eugene&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrently using XIP and QSPI to read back data from external flash</title><link>https://devzone.nordicsemi.com/thread/290882?ContentTypeID=1</link><pubDate>Mon, 22 Jul 2019 15:27:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab609bce-2d11-41a7-8659-5116904b4966</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Eugene,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could you tell what&amp;#39;s the assertion error code ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t do XIP and only do a read out the data in QSPI do you see an error ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regarding your question about bootloader and application both use nrfx. Could you give some more information of the issue ? My understanding is that since the&amp;nbsp;driver status is remains in RAM , if it&amp;#39;s not been reinitialize in the application properly we may have an issue ?&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>