<?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>Use nrfx QSPI with Zephyr filesystem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71566/use-nrfx-qspi-with-zephyr-filesystem</link><description>I&amp;#39;m using Zephyr on a nRF52840 and I&amp;#39;d like to use the QSPI with the Fat Filesystem. I added the following Config statements to prj.conf: 
 
 The nrfx QSPI driver and file system code is then included in the build, but I&amp;#39;m unsure how to associate the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Mar 2021 10:43:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71566/use-nrfx-qspi-with-zephyr-filesystem" /><item><title>RE: Use nrfx QSPI with Zephyr filesystem</title><link>https://devzone.nordicsemi.com/thread/297451?ContentTypeID=1</link><pubDate>Wed, 03 Mar 2021 10:43:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1108d98e-7fdf-433b-b18f-71c7e72bbc4a</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I&amp;#39;ll look into&amp;nbsp;ticket&amp;nbsp;&lt;span&gt;265559 soon.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use nrfx QSPI with Zephyr filesystem</title><link>https://devzone.nordicsemi.com/thread/297267?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 15:40:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:275dfa61-fcc6-415c-936e-5492162ad6da</guid><dc:creator>CktDesigner</dc:creator><description>&lt;p&gt;I was hoping for the higher throughput that SD mode would provide, but am now trying SPI mode.&amp;nbsp; &amp;nbsp;I&amp;#39;m having an issue there as well though.&amp;nbsp; &amp;nbsp; I submitted a separate ticket for that question (&lt;span&gt;Case ID: 265559:&amp;nbsp; Use SPI to interface to SDcard under Zephyr).&amp;nbsp; &amp;nbsp;I&amp;#39;m having trouble getting the SPI chip-select to work properly.&amp;nbsp; &amp;nbsp;(It seemed so much easier when I could call the configuration functions directly (instead of working through device-tree) :-))&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use nrfx QSPI with Zephyr filesystem</title><link>https://devzone.nordicsemi.com/thread/297101?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 09:56:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a90ce14-4f79-4eb5-ad04-b517a950034e</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;It does not seem like it&amp;#39;s possible to use QSPI with an SD Card, after browsing through DevZone. I&amp;#39;ll copy in another answer I found:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;quot;Using SD card in any other modes than SPI would require a licence from the SD card association,&amp;nbsp;&lt;a href="https://electronics.stackexchange.com/questions/132251/sd-card-4-bit-mode-license"&gt;link&lt;/a&gt;. Even if we had such an example, we wouldn&amp;#39;t be allowed to publish it. Hence only SPI examples are shown for SD Cards.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Would using SPI be an option for 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: Use nrfx QSPI with Zephyr filesystem</title><link>https://devzone.nordicsemi.com/thread/296988?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 18:37:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2001eb4-3954-4b99-962d-9ce74ad2e0cb</guid><dc:creator>CktDesigner</dc:creator><description>&lt;p&gt;After doing a lot of reading, I determined that it is not possible to control an SDcard using QSPI.&amp;nbsp; &amp;nbsp;While they are very similar, QSPI transmits command over the D0 signal while SDcard uses a separate CMD signal (for both command and response).&amp;nbsp; &amp;nbsp;I thought that perhaps there might be a way to connect D0 to CMD, but I don&amp;#39;t see a way to retrieve the command response using the QSPI setup.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use nrfx QSPI with Zephyr filesystem</title><link>https://devzone.nordicsemi.com/thread/296361?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 16:15:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:664938ba-cc60-4e84-af52-14522f2486bf</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I&amp;#39;m happy you got help and was able to get past the error.&lt;/p&gt;
&lt;p&gt;However, I&amp;#39;m handling another case regarding this. I&amp;nbsp;talked to a colleague and got some&amp;nbsp;more insight on this topic (File System on external flash in NCS), check it out here:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/72045/flash-filing-system-for-nrf-connect-sdk"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/72045/flash-filing-system-for-nrf-connect-sdk&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Sorry for not providing this information at an earlier point, but I wasn&amp;#39;t aware of this before now.&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: Use nrfx QSPI with Zephyr filesystem</title><link>https://devzone.nordicsemi.com/thread/296342?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 15:26:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce9727b3-2635-4a92-993a-7239709aea61</guid><dc:creator>CktDesigner</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Yes, I was able to get a better understanding of what was happening via the Zephyr/Slack group.&amp;nbsp; &amp;nbsp;I was trying to control the configuration via CONFIG statements.&amp;nbsp; &amp;nbsp;I guess I didn&amp;#39;t understand that most of the configuration is done via device-tree (via okay/disabled status, or other parameter modifications) overlay files.&amp;nbsp; &amp;nbsp;My case was more confusing in that I want to use the non-blocking feature of TWIM so that most I2C activities are performed in the background.&amp;nbsp; &amp;nbsp;The &amp;quot;stock&amp;quot; I2C/Nordic driver in Zephyr doesn&amp;#39;t expose the interrupt handler (which I need to catch the completion signal/interrupt and start the next job in the queue).&amp;nbsp; &amp;nbsp;So I had to disable the TWIM instance via device-tree, but enable it via CONFIG, since when enabling via device-tree, the internal interrupt is connected via &amp;quot;IRQ_CONNECT&amp;quot; (and I need to do that in my code to handle the interrupt myself).&amp;nbsp; If IRQ_CONNECT is called in both places, I get the error mentioned above.&amp;nbsp; &amp;nbsp;This sort of goes against the device-tree guidance.&amp;nbsp; &amp;nbsp;Evidently the device-tree methodology is replacing the CONFIG methodology, but for now both appear to be in place, so it is a bit confusing.&lt;/p&gt;
&lt;p&gt;Now that I more fully understand device-tree, I see its value in making things &amp;quot;more convenient&amp;quot; and perhaps making it easier to keep things consistent over multiple vendor devices.&amp;nbsp; But it also &amp;quot;hides&amp;quot; a lot of things that historically have been more visible in user code.&amp;nbsp; &amp;nbsp;(I have always put &amp;quot;config&amp;quot; calls as the first things in my code.&amp;nbsp; So it would be very easy to determine what was being configured by glancing at the beginning of the code.&amp;nbsp; &amp;nbsp;Now most of that work is hidden (for better or worse) in initialization code (or MACROS) inside the driver code.)&amp;nbsp; I guess I have to &amp;quot;get with the times&amp;quot;!!&lt;/p&gt;
&lt;p&gt;Thanks very much for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use nrfx QSPI with Zephyr filesystem</title><link>https://devzone.nordicsemi.com/thread/296228?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 11:31:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67c71aa6-da99-4124-9153-b142774cbbba</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Sorry for the delay on this. Have you made any progress lately? I&amp;#39;ll look into your issue today/tomorrow.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use nrfx QSPI with Zephyr filesystem</title><link>https://devzone.nordicsemi.com/thread/295488?ContentTypeID=1</link><pubDate>Mon, 22 Feb 2021 07:01:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b2feccb-631e-440f-9e71-c3ef071f5167</guid><dc:creator>CktDesigner</dc:creator><description>&lt;p&gt;Simon,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been looking into this and thought I&amp;#39;d try to get the SPI mode working, then see if I can modify&amp;nbsp;&lt;strong&gt;&lt;span&gt;disk_access_spi_sdhc.c&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;to handle QSPI.&lt;/p&gt;
&lt;p&gt;Using one of the examples, I found that I needed to set:&lt;/p&gt;
&lt;div class="evolution-code-editor theme-clouds"&gt;
&lt;div class=" ace_editor ace-clouds"&gt;
&lt;div class="ace_scroller"&gt;
&lt;div class="ace_content"&gt;
&lt;div class="ace_layer ace_marker-layer"&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_FILE_SYSTEM=y
CONFIG_FAT_FILESYSTEM_ELM=y
CONFIG_DISK_ACCESS=y
CONFIG_DISK_ACCESS_SDHC=y
CONFIG_SPI=y
CONFIG_SPI_2=y
CONFIG_DISK_ACCESS_SPI_SD&lt;/pre&gt;&lt;/div&gt;
&lt;div class="ace_layer ace_text-layer"&gt;
&lt;div class="ace_line"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="ace_layer ace_marker-layer"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;to get the appropriate drivers to load.&amp;nbsp; &amp;nbsp;Since I&amp;#39;m already using TWIM1 (via CONFIG_NRFX_TWIM1=y) and needed to write my own handler so multiple threads can share the I2C, I use the statement:&lt;/p&gt;
&lt;p&gt;IRQ_CONNECT(SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn,6,nrfx_isr,nrfx_twim_1_irq_handler,0);&lt;/p&gt;
&lt;p&gt;to catch the signal from the TWIM.&amp;nbsp; &amp;nbsp; The TWIM handler seems to be working correctly...&lt;/p&gt;
&lt;p&gt;However, this seems to cause a conflict in the isr table.&amp;nbsp; &amp;nbsp;When I compile with the SPI configs, I get the error:&lt;/p&gt;
&lt;p&gt;1&amp;gt; Combining &amp;lsquo;zephyr/isr_tables.c&amp;rsquo;&lt;br /&gt;1&amp;gt; gen_isr_tables.py: error: multiple registrations at table_index 4 for irq 4 (0x4)&lt;br /&gt;1&amp;gt; Existing handler 0x2ef09, new handler 0x2ef09&lt;br /&gt;1&amp;gt; Has IRQ_CONNECT or IRQ_DIRECT_CONNECT accidentally been invoked on the same irq multiple times?&lt;/p&gt;
&lt;p&gt;Commenting out my IRQ_CONNECT call removes the error, but also removes my ability to catch the signal from TWIM1 for my handler.&lt;/p&gt;
&lt;p&gt;I seem to remember reading (somewhere) that nRF52840 serial peripherals share index numbers leading me to think that I should be using SPI2 for the SDcard access.&amp;nbsp; &amp;nbsp; Do you know if the disk_access code hard codes using SPI1?&amp;nbsp; Or is there some other conflict causing the problem with the isr table?&lt;/p&gt;
&lt;p&gt;Thanks...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use nrfx QSPI with Zephyr filesystem</title><link>https://devzone.nordicsemi.com/thread/295229?ContentTypeID=1</link><pubDate>Thu, 18 Feb 2021 21:28:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3481e461-c24c-46f7-b1ca-23abf72b4da3</guid><dc:creator>CktDesigner</dc:creator><description>&lt;p&gt;OK, thanks.&lt;/p&gt;
&lt;p&gt;I did find this link:&amp;nbsp; &amp;nbsp;&lt;a href="https://medium.com/home-wireless/implement-littlefs-for-qspi-flash-in-zephyr-37e591f86b48"&gt;https://medium.com/home-wireless/implement-littlefs-for-qspi-flash-in-zephyr-37e591f86b48&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It appears to show how to use the QSPI with &amp;quot;littlefs&amp;quot; in Zephyr.&amp;nbsp; &amp;nbsp; I have to admit that I haven&amp;#39;t yet mastered the &amp;quot;device-tree&amp;quot; technology of Zephyr, so I&amp;#39;m not sure what is really happening here.&amp;nbsp; (I&amp;#39;m from the &amp;quot;old school&amp;quot; and am moving to Zephyr from FreeRTOS.&amp;nbsp; &amp;nbsp;It seems like a lot of &amp;quot;stuff&amp;quot; happens in some hidden space and I find it hard to trace where this code is &amp;quot;generated&amp;quot; and when it executes!).&amp;nbsp; &amp;nbsp;But I&amp;#39;m going to have to figure it out since, although I&amp;#39;m testing with nRF52480-DK, my application will be on a custom board...&lt;/p&gt;
&lt;p&gt;So perhaps this &amp;quot;littlefs&amp;quot; example can be used to make things work in FatFs.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use nrfx QSPI with Zephyr filesystem</title><link>https://devzone.nordicsemi.com/thread/295226?ContentTypeID=1</link><pubDate>Thu, 18 Feb 2021 20:30:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d8bc37b-48e0-412b-bae1-d1d89539338a</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Be aware that I don&amp;#39;t have the best knowledge about this, and I may have overlooked/misunderstood something. You may get better answers if you ask in any of the mentioned Zephyr resources.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use nrfx QSPI with Zephyr filesystem</title><link>https://devzone.nordicsemi.com/thread/295197?ContentTypeID=1</link><pubDate>Thu, 18 Feb 2021 16:59:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46d5cc7f-7b66-4f37-9b3b-25f408a6e302</guid><dc:creator>CktDesigner</dc:creator><description>&lt;p&gt;OK...&amp;nbsp; &amp;nbsp; &amp;nbsp;I&amp;#39;ll look into it further.&amp;nbsp; &amp;nbsp;Thanks for the pointers!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use nrfx QSPI with Zephyr filesystem</title><link>https://devzone.nordicsemi.com/thread/295137?ContentTypeID=1</link><pubDate>Thu, 18 Feb 2021 14:21:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80c13a77-4a29-4cd8-9874-30b24065e6a8</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I looked into this, and it does not seem like there is added any support for QSPI with FAT Fs. To give you a better overview I&amp;#39;ll provide you the call stack:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;main()--&amp;gt;disk_access_init()&amp;nbsp; |&amp;nbsp; zephyr\samples\subsys\fs\fat_fs\src\main.c
&lt;ul&gt;
&lt;li&gt;disk-&amp;gt;ops-&amp;gt;init(disk) | zephyr\subsys\disk\disk_access.c
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;span style="color:rgba(0, 0, 255, 1);"&gt;disk_spi_sdhc_access_init()--&amp;gt;&amp;nbsp; | if CONFIG_DISK_ACCESS_SPI_SDHC=y it will use functions from zephyr\subsys\disk\disk_access_spi_sdhc.c&lt;/span&gt;&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;spi_release() | zephyr\include\drivers\spi.h&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;At the blue layer, there are different choices for hardware interface, as you can see in&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/a077c29554be6e3a9e1dc95cac303305fa80aa6e/subsys/disk"&gt;zephyr/subsys/disk&lt;/a&gt;, but there is none for QSPI.&lt;/p&gt;
&lt;p&gt;One option would be&amp;nbsp;to create a driver yourself, in zephyr/subsys/disk/disk_access_spi_sdhc.c.&lt;/p&gt;
&lt;p&gt;You could also use the&amp;nbsp;API&amp;nbsp;\zephyr\include\drivers\flash.h and set these in prj.conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_FLASH=y
CONFIG_SPI=y
CONFIG_NORDIC_QSPI_NOR=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You may also get some good answers if you ask in any of these Zephyr resources:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.0/zephyr/introduction/index.html#community-support"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.0/zephyr/introduction/index.html#community-support&lt;/a&gt;&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>