<?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>FDS GC seems not to work</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25923/fds-gc-seems-not-to-work</link><description>Using SDK 13 FDS, I store 6468 byte, that is 1617 words, including FDS header. Of course this size is total.
In detail in byte size, this size consists of 
 (12(header)+ 576) * 7
(12 + 774) * 1
(12 + 691) * 2
(12 + 144) * 1
 
 I set FDS_VIRTUAL_PAGE_SIZE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Oct 2017 07:35:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25923/fds-gc-seems-not-to-work" /><item><title>RE: FDS GC seems not to work</title><link>https://devzone.nordicsemi.com/thread/102108?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2017 07:35:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d1e7df1-03a4-4273-ac97-73823a2edef5</guid><dc:creator>emdi</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;fds_gc() does not need an entire 4096 byte area to be deleted to work.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It might be possible that you don&amp;#39;t actually have enough space to fit your data in flash. A simple way to determine that would be to increase by one the value of FDS_VIRTUAL_PAGES and try again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS GC seems not to work</title><link>https://devzone.nordicsemi.com/thread/102107?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2017 07:20:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b58fdd1-8a5e-4c4e-a32f-ae6ad4487b40</guid><dc:creator>Luis</dc:creator><description>&lt;p&gt;One more thing, after calling GC, do you get NO_SPACE_IN_FLASH with the next write case or with the second?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS GC seems not to work</title><link>https://devzone.nordicsemi.com/thread/102105?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2017 07:18:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f8b433e-01ad-43a3-8afe-044bf40df748</guid><dc:creator>Luis</dc:creator><description>&lt;p&gt;I believe peer manager uses 1 full FDS page by itself, so it is normal that you get NO_SPACE_IN_FLASH when trying to update everything at once, because there is no enough room.
But as you state, GC should be able to delete those two records that you already updated and let you update one more... then GC is failing... are you sure there is no record opened at the moment you call gc? please copy here your FDS interrupt handler. Are you reading flash records at any moment? What is your BLE activity?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS GC seems not to work</title><link>https://devzone.nordicsemi.com/thread/102104?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2017 07:03:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf27b8cf-6f50-46fa-84b3-8ab7fcc9637c</guid><dc:creator>Haruki Kawakami</dc:creator><description>&lt;p&gt;Yes, I am waiting and reading for the result, and confirming result is FDS_SUCCESS.
And for second question, Yes I&amp;#39;m using peer manager.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS GC seems not to work</title><link>https://devzone.nordicsemi.com/thread/102103?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2017 06:56:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e4e42c7-0642-4b51-8823-2e67db4ff1e4</guid><dc:creator>Luis</dc:creator><description>&lt;p&gt;Every time you call FDS functions, are you waiting and reading for the interrupt result?
Are you using peer manager?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS GC seems not to work</title><link>https://devzone.nordicsemi.com/thread/102106?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2017 03:37:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c23abc5f-6fb7-43b3-b5a2-bd55014921fe</guid><dc:creator>Haruki Kawakami</dc:creator><description>&lt;p&gt;I got running GC after fds_record_write() has no effect.&lt;/p&gt;
&lt;p&gt;Then, I&amp;#39;m noticed that I have omitted description a little.&lt;/p&gt;
&lt;p&gt;More detail explanation is below.&lt;/p&gt;
&lt;p&gt;For initial write of 6468 byte, I use fds_record_write() for 11 times, and all results are FDS_SUCCESS.
Then for next write, that is update, of 6468 byte, I use fds_record_update().  The write and update order is below.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;1. (12 + 144) * 1
2. (12 + 691) * 2
3. (12 + 774) * 1
4. (12(header)+ 576) * 7
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For 1 and first of 2 update execution, fds_record_update() returns FDS_SUCCESS, then for second of 2 execution, fds_record_update() returns FDS_ERR_NO_SPACE_IN_FLASH.&lt;/p&gt;
&lt;p&gt;Then I call fds_gc() and call fds_record_update() again, but it returns FDS_ERR_NO_SPACE_IN_FLASH again.&lt;/p&gt;
&lt;p&gt;Does fds_gc() only work when all 4096 byte area are marked as deleted?
If so, should I set  FDS_VIRTUAL_PAGES to 5 (double for my data)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS GC seems not to work</title><link>https://devzone.nordicsemi.com/thread/102102?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2017 13:05:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b91c89c6-d2cf-4955-9488-3abba23b2320</guid><dc:creator>emdi</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Running GC after fds_record_write() has no effect.&lt;/p&gt;
&lt;p&gt;Running GC after fds_record_update() will delete the &amp;#39;old&amp;#39; copy of the record, if it &lt;em&gt;succeeds&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;To have an &amp;#39;old&amp;#39; copy of the record the fds_record_update() call must have returned FDS_SUCCESS synchronously and then sent out an FDS_EVT_UPDATE event indicating FDS_SUCCESS.
Otherwise, the operation is not performed and thus no &amp;#39;old&amp;#39; record that can be garbge collected is present in flash.&lt;/p&gt;
&lt;p&gt;My understanding is that you are not actually able to create a new, updated copy of a record because the fds_record_update() call returns FDS_ERR_NO_SPACE_IN_FLASH which indicates that there is no space for the new copy, therefore the record can&amp;#39;t be updated and the &amp;#39;old&amp;#39; copy marked as dirty.&lt;/p&gt;
&lt;p&gt;Regards,
emdi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>