<?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>I am not able to install littlefs on an external qspi flash</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/120804/i-am-not-able-to-install-littlefs-on-an-external-qspi-flash</link><description>Hello 
 I&amp;#39;m new with zephyr environment and I want to use littlefs in order to partition an external flash over spi, and to be able to upload file over BLE by using a SMP server. 
 I know this topic comes up regularly. I downloaded the littlefs sample</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 25 Apr 2025 05:35:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/120804/i-am-not-able-to-install-littlefs-on-an-external-qspi-flash" /><item><title>RE: I am not able to install littlefs on an external qspi flash</title><link>https://devzone.nordicsemi.com/thread/532950?ContentTypeID=1</link><pubDate>Fri, 25 Apr 2025 05:35:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4e4fc7e-fc9c-43db-9984-405c25c339e5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for confirming.&amp;nbsp;So maybe the&amp;nbsp;mx25 is&amp;nbsp;just busy erasing flash pages while the nRF is rebooting, and therefore isn&amp;#39;t able to respond to the&amp;nbsp;read ID command. To confirm this, maybe you can try to&amp;nbsp;call&amp;nbsp;sys_reboot(0) when you receive the&amp;nbsp;&lt;span&gt;-ENODEV error in the application. The idea is that this will allow the device to recover, as the flash erase will be completed on the following startup.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am not able to install littlefs on an external qspi flash</title><link>https://devzone.nordicsemi.com/thread/532850?ContentTypeID=1</link><pubDate>Thu, 24 Apr 2025 13:44:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0aa3618-7f33-4597-a8ff-2723830e4ba0</guid><dc:creator>Aurele</dc:creator><description>&lt;p&gt;Hello Vidar&lt;br /&gt;&lt;br /&gt;That&amp;#39;s a good point. You are right, I cannot reproduce the same issue when I make a power cyle reset. The issue only occurs when I make a pin reset, so it means that the SPI stays in a bad stat. I guess I should start with a reset of the external flash (mx25) but how ? Is it possible to drive the reset pin of MX25 independantly as it is already used by the QSPI driver ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am not able to install littlefs on an external qspi flash</title><link>https://devzone.nordicsemi.com/thread/532747?ContentTypeID=1</link><pubDate>Thu, 24 Apr 2025 08:11:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8edcc650-2879-48a5-a769-b8716256bf08</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="Aurel"]Actually, i have noticed that the erase could be very very long, and when I reset the device during an erase, the issue occurs !!! So, I think everything is related to this erase that does not have time to finised before&amp;nbsp;the reset ...[/quote]
&lt;p&gt;I see. So you only experience the issue if you have a sudden reset during the erase operation. Maybe the SPI flash is getting into a bad state. Are you able to reproduce the same if you do a power cycle instead of resetting only the nRF?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am not able to install littlefs on an external qspi flash</title><link>https://devzone.nordicsemi.com/thread/532648?ContentTypeID=1</link><pubDate>Wed, 23 Apr 2025 15:24:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1452354c-977c-4655-8515-02cf4146b694</guid><dc:creator>Aurele</dc:creator><description>[quote userid="4240" url="~/f/nordic-q-a/120804/i-am-not-able-to-install-littlefs-on-an-external-qspi-flash/532645"]Yes, for some reason the SPI flash didn&amp;#39;t respond to the device ID read command. This causes the qspi driver init to fail and the subsequent&amp;nbsp;&lt;span&gt;-ENODEV error when the app tries to mount the filesystem.&lt;/span&gt;&amp;nbsp;I&amp;#39;ve seen similar issues on custom boards where the SPI flash was powered on too late and wasn&amp;#39;t ready by the time the QSPI initialization function was called, but not on the nRF52840 DK board.&amp;nbsp;[/quote]
&lt;p&gt;I m working with nrf52840DK v3.0.3 (even if i&amp;#39;m using a custom device tree definition board)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/120804/i-am-not-able-to-install-littlefs-on-an-external-qspi-flash/532645"]Does this seem to mitigate the problem with the qspi flash driver initialization? I don&amp;#39;t see how it could be related.&amp;nbsp;&amp;nbsp;[/quote]
&lt;p&gt;Actually, i have noticed that the erase could be very very long, and when I reset the device during an erase, the issue occurs !!! So, I think everything is related to this erase that does not have time to finised before&amp;nbsp;the reset ...&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/120804/i-am-not-able-to-install-littlefs-on-an-external-qspi-flash/532645"]If possible, please provide a minimal version of your project that will allow me to reproduce the problem here.[/quote]
&lt;p&gt;Sure, I will share it. Do I have to share it here, in this tread or do you have an email ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am not able to install littlefs on an external qspi flash</title><link>https://devzone.nordicsemi.com/thread/532645?ContentTypeID=1</link><pubDate>Wed, 23 Apr 2025 15:06:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:936d200b-e104-4320-84da-b541e9f1c4d2</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;Aur&amp;eacute;lien,&lt;/span&gt;&lt;/p&gt;
[quote userid="55583" url="~/f/nordic-q-a/120804/i-am-not-able-to-install-littlefs-on-an-external-qspi-flash/532639"]I guess the driver cannot read JEDEC ID :&amp;nbsp;[/quote]
&lt;p&gt;Yes, for some reason the SPI flash didn&amp;#39;t respond to the device ID read command. This causes the qspi driver init to fail and the subsequent&amp;nbsp;&lt;span&gt;-ENODEV error when the app tries to mount the filesystem.&lt;/span&gt;&amp;nbsp;I&amp;#39;ve seen similar issues on custom boards where the SPI flash was powered on too late and wasn&amp;#39;t ready by the time the QSPI initialization function was called, but not on the nRF52840 DK board.&amp;nbsp;&lt;/p&gt;
[quote userid="55583" url="~/f/nordic-q-a/120804/i-am-not-able-to-install-littlefs-on-an-external-qspi-flash/532639"]I&amp;#39;m starting with an erase after each reboot. ([/quote]
&lt;p&gt;Does this seem to mitigate the problem with the qspi flash driver initialization? I don&amp;#39;t see how it could be related.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If possible, please provide a minimal version of your project that will allow me to reproduce the problem here.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am not able to install littlefs on an external qspi flash</title><link>https://devzone.nordicsemi.com/thread/532639?ContentTypeID=1</link><pubDate>Wed, 23 Apr 2025 14:38:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f827a73e-4c24-4766-b229-6508fc4a0111</guid><dc:creator>Aurele</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;When it is not working, I see :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;E: JEDEC id [00 00 00] expect [c2 28 17]
I: littlefs partition at /lfs1
*** Booting My Application v0.8.9-55bf6540e72c ***
*** Using nRF Connect SDK v2.9.0-7787b2649840 ***
*** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
Starting Bluetooth
I: 2 Sectors of 4096 bytes
I: alloc wra: 0, dc8
I: data wra: 0, 318
I: SoftDevice Controller build revision:
I: 2d 79 a1 c8 6a 40 b7 3c |-y..j@.&amp;lt;
I: f6 74 f9 0b 22 d3 c4 80 |.t..&amp;quot;...
I: 74 72 82 ba |tr..
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 45.41337 Build 3074452168
I: No ID address. App must call settings_load()
W: opcode 0xfc0e status 0x42
Set Tx power err: -5 reason 0x00
Bluetooth initialized
I: Identity: ED:CF:94:01:17:9A (random)
I: HCI: version 6.0 (0x0e) revision 0x106b, manufacturer 0x0059
I: LMP: version 6.0 (0x0e) subver 0x106b
Non-connectable advertising started
Created adv: 0x20002c48
Connectable advertising started
Advertising successfully started
Sample program to r/w files on littlefs
E: FAIL: unable to find flash area 0: -19

I: LittleFS version 2.9, disk version 2.1
E: can&amp;#39;t open flash area 0
E: fs mount error (-19)
FAIL: mount id 0 at /lfs1: -19

Thread BT CTLR ECDH → stack libre : 264 octets
Thread BT RX WQ → stack libre : 3880 octets
Thread mcumgr smp → stack libre : 1864 octets
Thread BT LW WQ → stack libre : 1160 octets
Thread sysworkq → stack libre : 1520 octets
Thread MPSL Work → stack libre : 736 octets
Thread idle → stack libre : 272 octets
Thread main → stack libre : 3120 octets&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I guess the driver cannot read JEDEC ID :&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;E: JEDEC id [00 00 00] expect [c2 28 17]&lt;/pre&gt;&amp;nbsp;but i don&amp;#39;t know why. Is there a way to have more information from the qspi driver in the RTT logger ?&lt;/p&gt;
&lt;p&gt;When it is working, I see :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;I: littlefs partition at /lfs1
*** Booting My Application v0.8.9-55bf6540e72c ***
*** Using nRF Connect SDK v2.9.0-7787b2649840 ***
*** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
Starting Bluetooth
I: 2 Sectors of 4096 bytes
I: alloc wra: 0, db8
I: data wra: 0, 330
I: SoftDevice Controller build revision: 
I: 2d 79 a1 c8 6a 40 b7 3c |-y..j@.&amp;lt;
I: f6 74 f9 0b 22 d3 c4 80 |.t..&amp;quot;...
I: 74 72 82 ba             |tr..    
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 45.41337 Build 3074452168
I: No ID address. App must call settings_load()
W: opcode 0xfc0e status 0x42 
Set Tx power err: -5 reason 0x00
Bluetooth initialized
I: Identity: ED:CF:94:01:17:9A (random)
I: HCI: version 6.0 (0x0e) revision 0x106b, manufacturer 0x0059
I: LMP: version 6.0 (0x0e) subver 0x106b
Non-connectable advertising started
Created adv: 0x20002c48
Connectable advertising started
Advertising successfully started
Sample program to r/w files on littlefs
Area 0 at 0x0 on mx25r6435f@0 for 8388608 bytes
E: Erasing flash area ... 0
I: LittleFS version 2.9, disk version 2.1
I: FS at mx25r6435f@0:0x0 is 2048 0x1000-byte blocks with 512 cycle
I: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
E: WEST_TOPDIR/modules/fs/littlefs/lfs.c:1374: Corrupted dir pair at {0x0, 0x1}
W: can&amp;#39;t mount (LFS -84); formatting
I: /lfs1 mounted
/lfs1 mount: 0
/lfs1: bsize = 16 ; frsize = 4096 ; blocks = 2048 ; bfree = 2046

Listing dir /lfs1 ...
/lfs1/boot_count read count:0 (bytes: 0)
/lfs1/boot_count write new boot count 1: [wr:1]
I: Test file: /lfs1/pattern.bin not found, create one!&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m starting with an erase after each reboot. (&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;flash_area_flatten)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;Regards&lt;br /&gt;&lt;br /&gt;Aur&amp;eacute;lien&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am not able to install littlefs on an external qspi flash</title><link>https://devzone.nordicsemi.com/thread/532542?ContentTypeID=1</link><pubDate>Wed, 23 Apr 2025 09:12:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bcf31b6-e6a7-4bc5-b425-dd88db8b27d6</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Are you not seeing any error messages from the QSPI driver too (nrf_qpi_nor.c)? The message E: FAIL: unable to find flash area 0: -19 (where -19 corresponds to -ENODEV) indicates that the mx25r6435f device was not initialized. This issue&amp;nbsp;should be unrelated to whether the SPI flash is empty or not.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am not able to install littlefs on an external qspi flash</title><link>https://devzone.nordicsemi.com/thread/532162?ContentTypeID=1</link><pubDate>Fri, 18 Apr 2025 08:03:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52b51ed1-884c-4059-9cf3-50b2aad66ead</guid><dc:creator>Aurele</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;I managed to get it to work, but for it to work, I have to force a file upload with the &amp;quot;Device Manager&amp;quot; app, and when I reset the device, I see:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Area 0 at 0x0 on mx25r6435f@0 for 8388608 bytes
I: LittleFS version 2.9, disk version 2.1
I: FS at mx25r6435f@0:0x0 is 2048 0x1000-byte blocks with 512 cycles
I: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
/lfs1 mount: 0
/lfs1: bsize = 16 ; frsize = 4096 ; blocks = 2048 ; bfree = 2044

Listing dir /lfs1 ...
[FILE] Lorem_10.txt (size = 10)
[FILE] Lorem_1000.txt (size = 1000)
[FILE] boot_count (size = 1)
[FILE] pattern.bin (size = 547)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Otherwise, as soon as I boot for the first time or after an erase, I see the following error:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;E: FAIL: unable to find flash area 0: -19&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>