<?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>When ist littlefs garbage collection / flash erase block called?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85243/when-ist-littlefs-garbage-collection-flash-erase-block-called</link><description>Hello, 
 I would like to use littlefs in out Project and it seems to be very usefull. I read several documents and have the sample running on the eval board. But there is one important Question I couldn&amp;#39;t answer by myself. 
 When is garbage collector</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Mar 2022 15:54:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85243/when-ist-littlefs-garbage-collection-flash-erase-block-called" /><item><title>RE: When ist littlefs garbage collection / flash erase block called?</title><link>https://devzone.nordicsemi.com/thread/356115?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2022 15:54:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b662edf-dd3b-4334-bcd6-d57745e2a52f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Erwin,&lt;/p&gt;
&lt;p&gt;I do not know the reason for this, unfortunately. You could ask the &lt;a href="https://discord.com/invite/Ck7jw53nU2"&gt;Zephyr community on Discord&lt;/a&gt; and see if someone there knows about why this is.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When ist littlefs garbage collection / flash erase block called?</title><link>https://devzone.nordicsemi.com/thread/355853?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 14:32:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81865ff0-4105-4956-b7c9-dc78eb1a068c</guid><dc:creator>ErwinCes</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;I expected to get an email when someout updates this ticket. But this didn&amp;#39;t happen because of your update so I see your response only today.&lt;/p&gt;
&lt;p&gt;Before raising this ticket I read the&amp;nbsp; design document from GitHub which helped much and where I get this understanding of gargabe Collection. But your mentioned post is interesting. May be I tweak littlefs a Little bit.&lt;/p&gt;
&lt;p&gt;In the meantime I&amp;#39;ve played around with the Zephyr variant of littleFS on the nrf5340 development board. According my Observation there is no garbage Collection. Every time a new page is required, i.e. littleFS wants to write data on it, the page is erase. I guess, even when the page is already empty. I hope the time to erase just one page is short enough that it doesn&amp;#39;t harm our product too much.&lt;/p&gt;
&lt;p&gt;Another think I&amp;#39;ve observed is that the Format function is not exported to fs Level (littleFS is only a speciallized implementation of the General file System. Do you know whether there is a Special reason for this? I realized it by calling lfs_format directly. But after that I have to call unmount and mount again&amp;nbsp; to get the file System working.&lt;/p&gt;
&lt;p&gt;Hopefully I turned now Reply notifications on. So I might receive an email when you or someone else responds.&lt;/p&gt;
&lt;p&gt;Regards&lt;br /&gt;Erwin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When ist littlefs garbage collection / flash erase block called?</title><link>https://devzone.nordicsemi.com/thread/355583?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 13:56:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67bb3973-d8ae-4440-89c9-0f03e27fd341</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Erwin,&lt;/p&gt;
&lt;p&gt;I must admit that I don&amp;#39;t have a intimate knowledge of littlefs, and it is not written by us. However, you can read a bit about this in the littlefs documentation.&amp;nbsp;I suggest you search for &amp;quot;garbage&amp;quot; under &lt;a href="https://github.com/littlefs-project/littlefs/blob/master/DESIGN.md"&gt;DESIGN&lt;/a&gt;. I also see a post &lt;a href="https://forum.pjrc.com/threads/58033-LittleFS-port-to-Teensy-SPIFlash?s=09cf223dd044a8470c273475a0d8d3ce&amp;amp;p=261653&amp;amp;viewfull=1#post261653"&gt;here &lt;/a&gt;about how you can do garbage collection when there is time to do it, which should prevent garbage collection from happening at other times.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>