<?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>How to get started with NOR flash on Zephyr ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93228/how-to-get-started-with-nor-flash-on-zephyr</link><description>Hi, 
 I&amp;#39;m pretty new to Zephyr and I have to figure out how to connect to a NOR flash over SPI. Final application is the implementation of a file system, e.g. littlefs. 
 There is very little documentation on the web on that subject and one of the only</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Jul 2024 15:39:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93228/how-to-get-started-with-nor-flash-on-zephyr" /><item><title>RE: How to get started with NOR flash on Zephyr ?</title><link>https://devzone.nordicsemi.com/thread/494217?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2024 15:39:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:496e01a6-58a1-46c3-a325-5109f9a2e7db</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;You can refer to the overlay fils here&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/drivers/spi_flash/boards"&gt;https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/drivers/spi_flash/boards&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please create a new support for your issue.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get started with NOR flash on Zephyr ?</title><link>https://devzone.nordicsemi.com/thread/494029?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2024 05:21:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26cff4ca-5b02-42bc-bdb5-4770e6e5b850</guid><dc:creator>xuezhi_zed</dc:creator><description>&lt;p&gt;Hi, I am also working with NOR memory with nrf52840 and I realize the sample code does not provide overlay file, may I know how to define the pin connections . I try to create the overlay file but keep getting compiling error. did you create a new yaml file? Do you mind share your project if possible? Appreciate in advance&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get started with NOR flash on Zephyr ?</title><link>https://devzone.nordicsemi.com/thread/393709?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 14:41:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d328459-495f-47b3-87fc-40685eb0eecb</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The spicific module under&amp;nbsp;v2.1.1&amp;nbsp;is not public on the github. If you install NCS v2.1.1 via Toolchain, you could see it. Please be aware that our support is limited to NCS instead of vanilla Zephyr, so I would suggest you use NCS.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1667399779038v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get started with NOR flash on Zephyr ?</title><link>https://devzone.nordicsemi.com/thread/393544?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 20:31:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6359545-b7e1-4d3b-8e34-115fe6207150</guid><dc:creator>rotem</dc:creator><description>&lt;p&gt;sorry, or I must be blind but there is no modules\fs\littlefs folder in 2.11:&lt;/p&gt;
&lt;p&gt;&lt;a id="" href="https://github.com/nrfconnect/sdk-nrf/tree/v2.1.1/modules"&gt;https://github.com/nrfconnect/sdk-nrf/tree/v2.1.1/modules&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Am I missing something?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get started with NOR flash on Zephyr ?</title><link>https://devzone.nordicsemi.com/thread/393541?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 18:55:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9cfb2c0-cf77-4fbc-af17-ea9b42f244d8</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Which version of NCS are you using?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you are using v2.1.1, lfs.h is under&amp;nbsp;&lt;/span&gt;modules\fs\littlefs.&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get started with NOR flash on Zephyr ?</title><link>https://devzone.nordicsemi.com/thread/393531?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 16:40:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca545737-86a3-41ac-b064-6e8f0c402ceb</guid><dc:creator>rotem</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;p&gt;I was able to make the NOR-flash run over SPI! Mainly the configuration for the SST25 had to be adapted and some particularity with our board.&lt;/p&gt;
&lt;p&gt;I was also able to make the&lt;strong&gt; NVS Filesystem sample&lt;/strong&gt; run.&lt;/p&gt;
&lt;p&gt;Now I try with the &lt;strong&gt;littleFS sample&lt;/strong&gt; and here I got stuck again: When building, I get an error saying&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/zephyr/include/zephyr/fs/littlefs.h:14:10: fatal error: lfs.h: No such file or directory&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; 14 | #include &amp;lt;lfs.h&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;As this file does not exist nowhere in the filesystem I suppose it should be generated by zephyr but it isn&amp;#39;t&lt;/p&gt;
&lt;p&gt;Within littlefs.h I find&lt;/p&gt;
&lt;p&gt;&lt;code&gt;#include &amp;lt;lfs.h&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;When I comment it out, some symbols like&lt;/p&gt;
&lt;p&gt;&lt;code&gt;struct lfs_config cfg;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;are marked as unknown.&lt;/p&gt;
&lt;p&gt;My dts looks like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;amp;sst25 {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; partitions {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; compatible = &amp;quot;fixed-partitions&amp;quot;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #address-cells = &amp;lt;1&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #size-cells = &amp;lt;1&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 16 KBy partition to use for LFS filesystem */&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;partition@0001000 {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;label = &amp;quot;storage&amp;quot;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;reg = &amp;lt;0x0001000 0x0004000&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;};&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/code&gt;&lt;br /&gt;&lt;code&gt;};&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;and the node initialization like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(_LfsConfig);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;static struct fs_mount_t lfs_storage_mnt = {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.type = FS_LITTLEFS,&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.fs_data = &amp;amp;_LfsConfig,&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.storage_dev = (void *)DT_FLASH_AREA_STORAGE_ID,&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.mnt_point = &amp;quot;/lfs&amp;quot;,&lt;/code&gt;&lt;br /&gt;&lt;code&gt;};&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;and the conf like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;CONFIG_FLASH=y&lt;/code&gt;&lt;br /&gt;&lt;code&gt;CONFIG_FLASH_MAP=y&lt;/code&gt;&lt;br /&gt;&lt;code&gt;CONFIG_FLASH_PAGE_LAYOUT=y&lt;/code&gt;&lt;br /&gt;&lt;code&gt;CONFIG_SPI_NOR=y&lt;/code&gt;&lt;br /&gt;&lt;code&gt;CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096&lt;/code&gt;&lt;br /&gt;&lt;code&gt;CONFIG_FILE_SYSTEM=y&lt;/code&gt;&lt;br /&gt;&lt;code&gt;CONFIG_FILE_SYSTEM_LITTLEFS=y&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Any idea what could cause this problem?&lt;/p&gt;
&lt;p&gt;Thanx&lt;/p&gt;
&lt;p&gt;Marco&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: How to get started with NOR flash on Zephyr ?</title><link>https://devzone.nordicsemi.com/thread/392686?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 15:20:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:390872c6-7495-4d82-9a11-91c3151959be</guid><dc:creator>rotem</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;p&gt;I figured out the reason for the device_is_ready() = false: The initialization fails because the JEDEC-ID does not match. This is probably because of the way we initialize the SPI-interface.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll come back when I have new findings!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get started with NOR flash on Zephyr ?</title><link>https://devzone.nordicsemi.com/thread/392646?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 13:31:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f196f17-1134-4de8-8c6e-176152ba39a0</guid><dc:creator>rotem</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for the quick reply!&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;s_flashdevice_p = DEVICE_DT_GET(DT_NODELABEL(sst25));&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I now get a non-null instance that looks like that:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;s_flashdevice_p: 0x804ede8 &amp;lt;__device_dts_ord_626&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;name: 0x8059f6e &amp;quot;SST25VF016&amp;quot;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*name: 83 &amp;#39;S&amp;#39;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;config: 0x8050c24 &amp;lt;spi_nor_config_0&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;api: 0x8050c10 &amp;lt;spi_nor_api&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;state: 0x20000d70 &amp;lt;__devstate_dts_ord_626&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;init_res: 22&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;initialized: true&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;data: 0x200053b4 &amp;lt;spi_nor_data_0&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;handles: 0x804f3d8 &amp;lt;__devicehdl_DT_N_S_soc_S_spi_40013000_S_sst25vf016_0&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*handles: 36&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;But then, doing&lt;/p&gt;
&lt;p&gt;&lt;code&gt;device_is_ready( s_flashdevice_p );&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;returns &lt;code&gt;false&lt;/code&gt;, due to init_res != 0 I guess.&lt;/p&gt;
&lt;p&gt;Any hint what might be wrong with my setup?&lt;/p&gt;
&lt;p&gt;In the sample, you use &lt;code&gt;&lt;span class="pl-c1"&gt;DEVICE_DT_GET&lt;/span&gt;(&lt;span class="pl-c1"&gt;DT_ALIAS&lt;/span&gt;(spi_flash0));&lt;/code&gt; Where is spi_flash0 definied? I can&amp;#39;t find any dts in the sample project. It might be helpful as a starting point!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanx,&lt;/p&gt;
&lt;p&gt;Marco&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get started with NOR flash on Zephyr ?</title><link>https://devzone.nordicsemi.com/thread/392478?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 19:44:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcb08258-e24e-41bb-9460-ac90c256834a</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user=""]s_device_p = device_get_binding( FLASH_DEVICE ); //becomes 0x0[/quote]
&lt;p&gt;Which version of NCS are you using? Is it v2.1.0? If so,&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/84c73b2cec286720a274db0e597f85eb1fc8a414/doc/nrf/releases/release-notes-2.1.0.rst#id517"&gt;&lt;span&gt;func:`device_get_binding()`&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;usage is removed in favor of&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/84c73b2cec286720a274db0e597f85eb1fc8a414/doc/nrf/releases/release-notes-2.1.0.rst#id519"&gt;&lt;span&gt;func:`DEVICE_DT_GET()`&lt;/span&gt;&lt;/a&gt;. See the &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/84c73b2cec286720a274db0e597f85eb1fc8a414/doc/nrf/releases/release-notes-2.1.0.rst"&gt;release-notes-2.1.0&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;See the example here&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/samples/drivers/spi_flash/src/main.c#L37"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/main/samples/drivers/spi_flash/src/main.c#L37&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>