<?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 filing system for nRF Connect SDK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72045/flash-filing-system-for-nrf-connect-sdk</link><description>Hi there, 
 Our team is developing an application based on the nRF5340-DK - we are developing on the DK while our hardware is in transit. Our schematic largely follows the reference design for all necessary peripherals. Notably, we&amp;#39;ve used the same QSPI</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 22 Mar 2021 06:58:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72045/flash-filing-system-for-nrf-connect-sdk" /><item><title>RE: Flash filing system for nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/301112?ContentTypeID=1</link><pubDate>Mon, 22 Mar 2021 06:58:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf7f8308-81b4-4bc6-9d31-6bc06361caba</guid><dc:creator>zigenz</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Have tested and confirm that it works (at this stage).&amp;nbsp; I&amp;#39;m using a custom board with the Macronix&amp;nbsp;MX66L1G45G (1-Gbit flash); I made the necessary changes in the zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts as below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;qspi {
	status = &amp;quot;okay&amp;quot;;
	sck-pin = &amp;lt;17&amp;gt;;
	io-pins = &amp;lt;13&amp;gt;, &amp;lt;14&amp;gt;, &amp;lt;15&amp;gt;, &amp;lt;16&amp;gt;;
	csn-pins = &amp;lt;18&amp;gt;;
	mx66l1g: mx66l1g45g@0 {
		compatible = &amp;quot;nordic,qspi-nor&amp;quot;;
		reg = &amp;lt;0&amp;gt;;
		/* MX66L1G supports only pp and pp4io */
		writeoc = &amp;quot;pp4io&amp;quot;;
		/* MX66L1G supports all readoc options */
		readoc = &amp;quot;read4io&amp;quot;;
		sck-frequency = &amp;lt;8000000&amp;gt;;
		label = &amp;quot;MX66L1G&amp;quot;;
		jedec-id = [c2 20 1b];
		sfdp-bfp = [
			e5 20 fb ff  ff ff ff 3f  44 eb 08 6b  08 3b 04 bb
			fe ff ff ff  ff ff 00 ff  ff ff 44 eb  0c 20 0f 52
			10 d8 00 ff  d6 49 c5 00  82 df 04 e3  44 03 67 38
			30 b0 30 b0  f7 bd d5 5c  4a 9e 29 ff  f0 50 f9 85
		];
		size = &amp;lt;1073741824&amp;gt;;
	};
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;4k page size is fine, but had to also modify the number of pages to be able to access the full memory.&lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Zyrus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash filing system for nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/301074?ContentTypeID=1</link><pubDate>Sun, 21 Mar 2021 12:57:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad417b8a-5d1f-4e1a-b0f6-4558839a116c</guid><dc:creator>zigenz</dc:creator><description>&lt;p&gt;Great - thanks Simon. Will give it a go first thing in the morning - it&amp;#39;s 9pm here ATM.&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Zyrus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash filing system for nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/301072?ContentTypeID=1</link><pubDate>Sun, 21 Mar 2021 12:53:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5653aaf-4e19-4617-9d4f-5e0f0067ae37</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I was able to make it work.&lt;/p&gt;
&lt;p&gt;Could you test this application with NCS v1.5.0 and the board nrf5340dk_nrf5340_cpuapp:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3603.nvs_5F00_external_5F00_flash.zip"&gt;devzone.nordicsemi.com/.../3603.nvs_5F00_external_5F00_flash.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Also you have to make&amp;nbsp;CONFIG_NORDIC_QSPI_NOR select CONFIG_FLASH_HAS_PAGE_LAYOUT in&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.4.99-ncs1/drivers/flash/Kconfig.nordic_qspi_nor"&gt;zephyr/drivers/flash/Kconfig.nordic_qspi_nor&lt;/a&gt;. See code snippet below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;menuconfig NORDIC_QSPI_NOR
	bool &amp;quot;QSPI NOR Flash&amp;quot;
	select FLASH_HAS_DRIVER_ENABLED
	select NRFX_QSPI
	select FLASH_JESD216
	select FLASH_HAS_PAGE_LAYOUT
	depends on HAS_HW_NRF_QSPI
	help
	  Enable support for nrfx QSPI driver with EasyDMA.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The Kconfig CONFIG_FLASH_HAS_PAGE_LAYOUT does not have a prompt, so it&amp;#39;s not possible to set it directly in the prj.conf file.&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 filing system for nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/297529?ContentTypeID=1</link><pubDate>Wed, 03 Mar 2021 13:30:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2adbeb26-38a5-4fb0-b386-7a8f589302cf</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I tried to look into this, but it wasn&amp;#39;t that straightforward. I&amp;#39;ll put off some time the next days and see if I can make this work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash filing system for nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/297127?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 10:27:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4be1b07d-51d5-43c1-92d4-1c84e988eed9</guid><dc:creator>zigenz</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I had a cursory look, but nothing meaningful.&amp;nbsp; Figured that I&amp;#39;d wait for (i.e. rely on) the official guidance and so&amp;nbsp;focussed on some other activities to make more efficient use of my time - i.e. nothing at all (sorry!).&lt;/p&gt;
&lt;p&gt;Appreciate your assistance.&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Zyrus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash filing system for nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/297109?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 10:07:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6d8198d-7abc-4c2b-be2b-f32889ab68b6</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Sorry for the delayed response. I have not tried using NVS on external flash before, but before looking into it, could you tell me what you&amp;#39;ve done so far? Then I can try to fill in the gaps and try to get it working.&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 filing system for nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/296397?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 23:57:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6daded71-bfbf-4418-b06e-3a02c09ee4db</guid><dc:creator>zigenz</dc:creator><description>&lt;p&gt;Thanks for the detailed list of options, Simon.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve had a review of the various file systems outlined in your response; NVS, being a&amp;nbsp;basic key:value store,&amp;nbsp;looks&amp;nbsp;like a good fit for this&amp;nbsp;application.&amp;nbsp; I&amp;#39;ll start looking into&amp;nbsp;implementation based on the guidance you&amp;#39;ve already provided, however would appreciate if you&amp;nbsp;could also outline implementation steps.&amp;nbsp; Thank you.&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Zyrus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash filing system for nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/296359?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 16:12:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dba570a5-4da2-48aa-8ba1-15e8f2ebb984</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I think you should be able to use the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/zephyr/reference/storage/nvs/nvs.html"&gt;NVS filesystem&lt;/a&gt; with external flash and QSPI. The &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/4ce908a2342494c19df09f347ce79ab81b415185/subsys/fs/nvs/nvs.c"&gt;NVS driver&lt;/a&gt;&amp;nbsp;uses the api &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/4ce908a2342494c19df09f347ce79ab81b415185/include/drivers/flash.h"&gt;flash.h&lt;/a&gt;, and the underlying hardware interface can be choosen between the drivers located in&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/master/drivers/flash"&gt;zephyr/drivers/flash&lt;/a&gt;&amp;nbsp;and there is indeed one for qspi: &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/4ce908a2342494c19df09f347ce79ab81b415185/drivers/flash/nrf_qspi_nor.c"&gt;zephyr/drivers/flash/nrf_qspi_nor.c&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Please tell me if the NVS filesystem satisfies your needs, and I&amp;#39;ll help you implement it. But I think the way to go about it is to use the sample&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/4ce908a2342494c19df09f347ce79ab81b415185/samples/subsys/nvs"&gt;zephyr/samples/subsys/nvs&lt;/a&gt;, and add some configs to the prj.conf (check how it&amp;#39;s done in e.g. the &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/4ce908a2342494c19df09f347ce79ab81b415185/samples/drivers/spi_flash/boards/nrf5340dk_nrf5340_cpuapp.conf#L7-L8"&gt;spi_flash sample&lt;/a&gt; or the &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/4ce908a2342494c19df09f347ce79ab81b415185/samples/subsys/fs/littlefs/boards/nrf52840dk_nrf52840.conf#L12-L13"&gt;littlefs sample&lt;/a&gt;), in addition I think you need to an an overlay file to configure the hardware.&lt;/p&gt;
&lt;p&gt;As seen in the link above it seems like LittleFs also has support for external flash through QSPI, just use the &lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/4ce908a2342494c19df09f347ce79ab81b415185/samples/subsys/fs/littlefs/boards"&gt;board files&lt;/a&gt; for the nRF52840dk as a reference&lt;/p&gt;
&lt;p&gt;Regarding FatFS, it does not seem like it&amp;#39;s supported out-of the box if you&amp;#39;re using external flash with QSPI. This ticket may be helpful:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/71566/use-nrfx-qspi-with-zephyr-filesystem"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/71566/use-nrfx-qspi-with-zephyr-filesystem&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In general I would no&amp;nbsp;recommend you&amp;nbsp;an&amp;nbsp;advanceded file system, like littleFS or FatFs, if the intention is only to use it internally on the chip, that might be an overkill. One usecase might be if you&amp;#39;re using USB and are going to emulate a USB Stick.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Of course you could use the sample &lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/4ce908a2342494c19df09f347ce79ab81b415185/samples/drivers/spi_flash"&gt;SPI Flash sample&lt;/a&gt;&amp;nbsp;where you&amp;nbsp;access the flash directly, and structure&amp;nbsp;the data the way you like.&lt;/p&gt;
&lt;p&gt;Please tell me what kind of File System you would like to implement and I&amp;#39;ll assist 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></channel></rss>