<?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>nRF52832 internal flash memory with littlefs</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89368/nrf52832-internal-flash-memory-with-littlefs</link><description>Hi, 
 we are having issue with nRF52832 and littlefs. We are using Nordic Connect SDK 1.9.1 and Visual Studio Code. 
 We created dts overlay and removed partitions not needed and expanded storage_partition so it takes all available space, in our case</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Jun 2022 10:54:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89368/nrf52832-internal-flash-memory-with-littlefs" /><item><title>RE: nRF52832 internal flash memory with littlefs</title><link>https://devzone.nordicsemi.com/thread/374707?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2022 10:54:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5dfde546-4cd2-4b28-bbdc-9a6b320df922</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have tested and looked at your sample. I must admit I&amp;nbsp;am far from a littlefs expert, but the approach in general seems sensible, and is the about the same as is used in the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/zephyr/samples/subsys/fs/littlefs/README.html"&gt;littlefs File System Sample Application&lt;/a&gt;. However, updating or overwriting flash data involves deleting and writing to a new location (as bits can only be flipped from 0 to 1 by a page erase), and this will not be possible when the flash is full. So you will need to update the data before the flash is full (and perhaps also consider using multiple files).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 internal flash memory with littlefs</title><link>https://devzone.nordicsemi.com/thread/374473?ContentTypeID=1</link><pubDate>Tue, 28 Jun 2022 08:35:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2561fc08-e8d7-4d2f-a167-b2e8fe9534f5</guid><dc:creator>Davorin Madaric</dc:creator><description>&lt;p&gt;Here is sample:&lt;br /&gt;&lt;a id="" href="https://github.com/davorinm/littlefsSample"&gt;https://github.com/davorinm/littlefsSample&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Board used&amp;nbsp;nrf52dk_nrf52832. &lt;br /&gt;Dtk is not modified, storage partition is 24kB.&lt;br /&gt;&lt;br /&gt;After about a minute write will begin to fail.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 internal flash memory with littlefs</title><link>https://devzone.nordicsemi.com/thread/374443?ContentTypeID=1</link><pubDate>Tue, 28 Jun 2022 06:42:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:227be9ae-2750-4adc-bced-6cee2e87a24f</guid><dc:creator>Davorin Madaric</dc:creator><description>&lt;p&gt;&lt;span&gt;CONFIG_FS_LOG_LEVEL_DBG=y did not reveal anything new.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is my log:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is first unsuccessful&amp;nbsp;write at data file index 12240. It fails on fs_write():&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:03:39.664,245] &amp;lt;dbg&amp;gt; main.dataDetected: newDataDetected
[00:03:39.669,860] &amp;lt;dbg&amp;gt; dataStorage.writeData: seek data to: 12240, 0
[00:03:39.940,765] &amp;lt;err&amp;gt; littlefs: WEST_TOPDIR/modules/fs/littlefs/lfs.c:567: No more free space 10
[00:03:39.940,795] &amp;lt;err&amp;gt; fs: file write error (-28)
[00:03:39.940,795] &amp;lt;dbg&amp;gt; dataStorage.writeData: write new data to: 12240, -28
[00:03:39.940,826] &amp;lt;err&amp;gt; dataStorage: data write error, no more space left: -28&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;br /&gt;Set data file index to 0, retry to write, fs_write succeded but fails on fs_close&lt;br /&gt;From this point on fs_write suceeds to write, data file index is incremented, fs_close fails with error -28 (-ENOSPC)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:03:39.946,380] &amp;lt;dbg&amp;gt; dataStorage.writeData: seek data to: 0, 0
[00:03:40.092,834] &amp;lt;dbg&amp;gt; dataStorage.writeData: write new data to: 0, 40
[00:03:40.292,480] &amp;lt;err&amp;gt; littlefs: WEST_TOPDIR/modules/fs/littlefs/lfs.c:567: No more free space 10
[00:03:40.292,510] &amp;lt;err&amp;gt; fs: file close error (-28)
[00:03:40.292,541] &amp;lt;err&amp;gt; dataStorage: File close error: -28
[00:03:40.292,541] &amp;lt;dbg&amp;gt; dataStorage.dataStorage_addData: data write #2 sucess: 40
[00:03:40.298,065] &amp;lt;dbg&amp;gt; dataStorage.writeDataFileIndex: write new data_file_index: 40, ret: 4

[00:03:40.809,844] &amp;lt;dbg&amp;gt; main.dataDetected: newDataDetected
[00:03:40.815,765] &amp;lt;dbg&amp;gt; dataStorage.writeData: seek data to: 40, 0
[00:03:40.994,689] &amp;lt;dbg&amp;gt; dataStorage.writeData: write new data to: 40, 40
[00:03:41.192,596] &amp;lt;err&amp;gt; littlefs: WEST_TOPDIR/modules/fs/littlefs/lfs.c:567: No more free space 10
[00:03:41.192,626] &amp;lt;err&amp;gt; fs: file close error (-28)
[00:03:41.192,626] &amp;lt;err&amp;gt; dataStorage: File close error: -28
[00:03:41.198,211] &amp;lt;dbg&amp;gt; dataStorage.writeDataFileIndex: write new data_file_index: 80, ret: 4

[00:03:41.699,188] &amp;lt;dbg&amp;gt; main.dataDetected: newDataDetected
[00:03:41.704,833] &amp;lt;dbg&amp;gt; dataStorage.writeData: seek data to: 80, 0
[00:03:41.834,899] &amp;lt;dbg&amp;gt; dataStorage.writeData: write new data to: 80, 40
[00:03:42.032,684] &amp;lt;err&amp;gt; littlefs: WEST_TOPDIR/modules/fs/littlefs/lfs.c:567: No more free space 10
[00:03:42.032,714] &amp;lt;err&amp;gt; fs: file close error (-28)
[00:03:42.032,714] &amp;lt;err&amp;gt; dataStorage: File close error: -28
[00:03:42.038,299] &amp;lt;dbg&amp;gt; dataStorage.writeDataFileIndex: write new data_file_index: 120, ret: 4&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In this case file system is 24kB in size, but this write fails on&amp;nbsp;12kB.&lt;br /&gt;&lt;br /&gt;I will prepare an example.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 internal flash memory with littlefs</title><link>https://devzone.nordicsemi.com/thread/374400?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 17:06:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efeb1386-bce2-423c-bd8f-617be7743d33</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;-ENOSPC indicate that there is no more space, and this corresponds to&amp;nbsp;LFS_ERR_NOSPC.&amp;nbsp;I do not notice anything sticking out as incorrect in what you describe.&amp;nbsp;&lt;span style="font-family:inherit;"&gt;Can you enable logging and also add&amp;nbsp;CONFIG_FS_LOG_LEVEL_DBG=y and see if the log revels anything?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t make progress it would be interesting to test on my end if you have a minimal failing example that runs on a DK so that I can test on my end.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>