<?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>Settings via littlefs on internal flash</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/74168/settings-via-littlefs-on-internal-flash</link><description>Hi, 
 I&amp;#39;m currently trying to use littlefs as the storage backend for the settings subsys and the internal flash for the actual memory. LittleFS is working in general but if failed so far to use it for storing settings. 
 Upon settings initialization</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Apr 2022 06:57:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/74168/settings-via-littlefs-on-internal-flash" /><item><title>RE: Settings via littlefs on internal flash</title><link>https://devzone.nordicsemi.com/thread/363426?ContentTypeID=1</link><pubDate>Tue, 19 Apr 2022 06:57:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea261515-119e-4d81-9ad0-c279afb4bae2</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My apologies for the late reply. It has been easter holiday period here in Norway.&lt;/p&gt;
[quote user="k.szpila"]Any update on the issue? I have the same problem. Although this ticket is 1years old. I couldn&amp;#39;t find a solution.[/quote]
&lt;p&gt;This issue should have been improved with this specific PR:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/pull/645"&gt;https://github.com/nrfconnect/sdk-zephyr/pull/645&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you try this and report back?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Settings via littlefs on internal flash</title><link>https://devzone.nordicsemi.com/thread/362990?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2022 10:29:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a8fe287-8a43-4828-898e-ec61ff35ecf8</guid><dc:creator>k.szpila</dc:creator><description>&lt;p&gt;Hi all,&lt;br /&gt;&lt;br /&gt;Any update on the issue? I have the same problem. Although this ticket is 1years old. I couldn&amp;#39;t find a solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Settings via littlefs on internal flash</title><link>https://devzone.nordicsemi.com/thread/307041?ContentTypeID=1</link><pubDate>Tue, 27 Apr 2021 13:02:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee80da63-2e19-47ba-9022-215cd116d9ef</guid><dc:creator>caspar.friedrich</dc:creator><description>&lt;p&gt;That seems to work. It&amp;#39;s hacky but it seems to work...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Settings via littlefs on internal flash</title><link>https://devzone.nordicsemi.com/thread/306809?ContentTypeID=1</link><pubDate>Mon, 26 Apr 2021 13:00:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eac7ed20-c527-4d42-90c2-15e3d8501cb8</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user="caspar.friedrich"]Thank you and sorry for my delayed answer! Is there any progress so far?[/quote]
&lt;p&gt;Unfortunately, we have not found the root-cause of why this happens at this time.&amp;nbsp;Is it possible to work around the behavior in your application by mounting in main()-context, or is&amp;nbsp;the mount required to happen&amp;nbsp;prior to main() for your application to run as expected?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Settings via littlefs on internal flash</title><link>https://devzone.nordicsemi.com/thread/306572?ContentTypeID=1</link><pubDate>Fri, 23 Apr 2021 14:05:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e41e76a9-cf5a-45bf-a4c5-e62983f596a2</guid><dc:creator>caspar.friedrich</dc:creator><description>&lt;p&gt;Thank you and sorry for my delayed answer! Is there any progress so far?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Settings via littlefs on internal flash</title><link>https://devzone.nordicsemi.com/thread/305819?ContentTypeID=1</link><pubDate>Tue, 20 Apr 2021 11:23:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f46275b-df45-4605-807b-75345b1f00b5</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="caspar.friedrich"]&lt;p&gt;No difference, unfortunately.&lt;/p&gt;
&lt;p&gt;It seems that parts of the node are read correctly. The mount point for example is always correct. The littlefs example also works but that manages files manually. The problem seems to only exist with the &lt;span style="font-family:courier new, courier;"&gt;automount&lt;/span&gt; feature.&lt;/p&gt;[/quote]
&lt;p&gt;I also mount in the application, and then I see this log:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.4.99-ncs1  ***
Area 2 at 0xfa000 on NRF_FLASH_DRV_NAME for 24576 bytes
/lfs mount: 0
/lfs: bsize = 16 ; frsize = 4096 ; blocks = 6 ; bfree = 4
/lfs/boot_count stat: 0
        fn &amp;#39;boot_count&amp;#39; siz 4
/lfs/boot_count read count 5: 4
/lfs/boot_count seek start: 0
/lfs/boot_count write new boot count 6: 4
/lfs/boot_count close: 0
/lfs opendir: 0
  F 4 boot_count
End of files
/lfs unmount: 0
[00:00:00.000,030] &amp;lt;inf&amp;gt; littlefs: littlefs partition at /lfs1
[00:00:00.000,061] &amp;lt;inf&amp;gt; littlefs: LittleFS version 2.2, disk version 2.0
[00:00:00.000,091] &amp;lt;inf&amp;gt; littlefs: FS at NRF_FLASH_DRV_NAME:0x0 is 12 0x1000-byte blocks with 512 cycle
[00:00:00.000,091] &amp;lt;inf&amp;gt; littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
[00:00:00.000,152] &amp;lt;inf&amp;gt; littlefs: /lfs1 mounted
[00:00:00.000,152] &amp;lt;err&amp;gt; fs: fs mount error (-5)
[00:00:00.000,183] &amp;lt;err&amp;gt; littlefs: Automount /lfs1 failed: -5

[00:00:00.009,216] &amp;lt;inf&amp;gt; littlefs: LittleFS version 2.2, disk version 2.0
[00:00:00.009,399] &amp;lt;inf&amp;gt; littlefs: FS at NRF_FLASH_DRV_NAME:0xfa000 is 6 0x1000-byte blocks with 512 cycle
[00:00:00.009,399] &amp;lt;inf&amp;gt; littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
[00:00:00.010,101] &amp;lt;inf&amp;gt; littlefs: /lfs mounted
[00:00:00.039,306] &amp;lt;inf&amp;gt; littlefs: /lfs unmounted
&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The automount seems to&amp;nbsp;fail on pre-boot (logs seem to be printed out-of-order based on debug behavior).&lt;/p&gt;
&lt;p&gt;This is tested with sample ../ncs/zephyr/samples/subsys/fs/littlefs/, with CONFIG_MPU_ALLOW_FLASH_WRITE=y as the only change in config/sources.&lt;/p&gt;
&lt;p&gt;overlay that I&amp;#39;m using:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
    fstab {
        compatible = &amp;quot;zephyr,fstab&amp;quot;;
        lfs: lfs {
            compatible = &amp;quot;zephyr,fstab,littlefs&amp;quot;;
            mount-point = &amp;quot;/lfs1&amp;quot;;
            partition = &amp;lt;&amp;amp;storage_partition&amp;gt;;
            /* Uncomment to show failure */
            /*automount;*/
            read-size = &amp;lt;16&amp;gt;;
            prog-size = &amp;lt;16&amp;gt;;
            cache-size = &amp;lt;64&amp;gt;;
            lookahead-size = &amp;lt;32&amp;gt;;
            block-cycles = &amp;lt;512&amp;gt;;
            label = &amp;quot;storage&amp;quot;;
            no-format;
        };
    };
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I also tested on master, which didn&amp;#39;t change the behavior. I&amp;#39;ll report this internally.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Settings via littlefs on internal flash</title><link>https://devzone.nordicsemi.com/thread/305781?ContentTypeID=1</link><pubDate>Tue, 20 Apr 2021 09:30:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ad22316-d3c7-4bcf-8a5b-ee073b98534c</guid><dc:creator>caspar.friedrich</dc:creator><description>&lt;p&gt;No difference, unfortunately.&lt;/p&gt;
&lt;p&gt;It seems that parts of the node are read correctly. The mount point for example is always correct. The littlefs example also works but that manages files manually. The problem seems to only exist with the &lt;span style="font-family:courier new, courier;"&gt;automount&lt;/span&gt; feature.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Settings via littlefs on internal flash</title><link>https://devzone.nordicsemi.com/thread/305746?ContentTypeID=1</link><pubDate>Tue, 20 Apr 2021 08:33:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97d19b64-c079-47bb-a03e-62edd20a1ea0</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]lfs1: lfs1 {[/quote]
&lt;p&gt;The&amp;nbsp;partition manager normally looks for &amp;quot;lfs&amp;quot;. Could you try changing this to &amp;quot;lfs: lfs {&amp;quot; and see if its able to successfully detect the storage partition address offset?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>