<?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>NRF FDS Issue:</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92987/nrf-fds-issue</link><description>I am using Nrf52832 as my main microcontroller and in that, I am using fstorage as well as FDS. I have one structure that has several values in it. I want to store the copies of that structure one by one in FDS and size of one structure is 23 bytes. I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Oct 2022 06:45:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92987/nrf-fds-issue" /><item><title>RE: NRF FDS Issue:</title><link>https://devzone.nordicsemi.com/thread/391782?ContentTypeID=1</link><pubDate>Fri, 21 Oct 2022 06:45:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1627539e-ec6a-4220-a99e-6d3b537e535f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="ChinmayDixit97"]1. I am using 3 fstorage locations as 0x3e000, 0x3e004 and 0x3e008. What is the width of the data in fstorage? Can I store uin32_t data in 0x3e000,0x3e001 and 0x3e002?&amp;nbsp;[/quote]
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_fstorage.html"&gt;Fstorage&lt;/a&gt; just provide direct access to the flash, so there are no headers etc. It simply gives you a API for writing to flash and erasing flash pages that is the same regardless of if you are using a SoftDevice or not, and ensures that you stay within the region you have defined. As you only write to a small part of the page at 0x3e000, you should reserve that page for fstorage, but not anything more. And nothing else should use that page. So in this case it would make sense to set the end address to&amp;nbsp;0x3ffff.&amp;nbsp; Moreover, you need to have full control over your memory layout. What does your flash cosists of, and where is every part located? Many things need to be placed at exact locations, and some (like your fstorage page) could be anywhere, as long as it does not overlap with anything else. If you see unpredictable behaviour, this is the first thing I would check (perhaps you are overwriting parts of the application or similar?).&lt;/p&gt;
[quote user="ChinmayDixit97"]2. Is fds pages starts automatically from where the fstorage ends? I can see, The fds has the last address as 0x80000 which is the last location in flash.&lt;br /&gt;[/quote]
&lt;p&gt;No. The &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_fds.html"&gt;FDS&lt;/a&gt; pages are located either at the very end of the flash, or right below the bootloader (if you are using that). The number of pages being used is defined by the&amp;nbsp;FDS_VIRTUAL_PAGES define in sdk_config.h (the default in most examples is 3). Have a look at the m&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_bootloader.html?cp=8_1_3_5_0_7#lib_bootloader_memory"&gt;emory layout figure in the bootloader&amp;nbsp;documentation&lt;/a&gt;&amp;nbsp;to get an overview.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF FDS Issue:</title><link>https://devzone.nordicsemi.com/thread/391729?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2022 16:07:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c930c4c-179b-4abf-a549-ce5902a98276</guid><dc:creator>ChinmayDixit97</dc:creator><description>&lt;p&gt;I have&amp;nbsp;two question. &lt;br /&gt;1. I am using 3 fstorage locations as 0x3e000, 0x3e004 and 0x3e008. What is the width of the data in fstorage? Can I store uin32_t data in 0x3e000,0x3e001 and 0x3e002?&amp;nbsp;&lt;br /&gt;2. Is fds pages starts automatically from where the fstorage ends? I can see, The fds has the last address as 0x80000 which is the last location in flash.&lt;br /&gt;&lt;br /&gt;Thanks for your support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF FDS Issue:</title><link>https://devzone.nordicsemi.com/thread/391726?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2022 16:00:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc4cdf7b-709b-4e15-9546-f6bda09ce8c4</guid><dc:creator>ChinmayDixit97</dc:creator><description>&lt;p&gt;Got your point &lt;a href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;&amp;nbsp;. Will do some debugging and get back to you.!! Thank you so much!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF FDS Issue:</title><link>https://devzone.nordicsemi.com/thread/391725?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2022 15:58:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f434f0f8-f4e0-498a-91a9-a2f9f3082e19</guid><dc:creator>ChinmayDixit97</dc:creator><description>&lt;p&gt;Sorry Einar. Could not see your reply. Will read and get back to you.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF FDS Issue:</title><link>https://devzone.nordicsemi.com/thread/391723?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2022 15:48:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6b56248-95ca-48cd-9ffd-de4c604e560c</guid><dc:creator>ChinmayDixit97</dc:creator><description>&lt;p&gt;Waiting for the reply as deadlines are tight. Really Appreciated if anyone can reply and suggest me for this problem!!!&lt;br /&gt;&lt;br /&gt;Thanks. &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF FDS Issue:</title><link>https://devzone.nordicsemi.com/thread/391354?ContentTypeID=1</link><pubDate>Wed, 19 Oct 2022 08:33:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4e136d3-45e9-4804-b61a-b033402c7786</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I do not immediately see the link between your direct use of fstorage and FDS, other than that your fstorage region is very large and overlaps with the pages used by FDS. It would probably make sense to reduce this region to what you actually intend to read/write to, to ensure that you do not accidentally touch the FDS pages.&lt;/p&gt;
&lt;p&gt;Regarding the reading, the code looks sensible. You write &amp;quot;it just hangs&amp;quot;, but the PC will be somewhere, and you should be able to learn more by debugging. Where does it &amp;quot;hang&amp;quot;? What else do you find from debugging?&lt;/p&gt;
[quote user=""]is there any efficient way to read the whole data at once?[/quote]
&lt;p&gt;If this data is in a single FDS record, it is consecutive in flash, so you can use memcpy just like I see you do. But separate records needs to be read separately (both because they could be scattered around the FDS pages, and because you have the headers in addition to the data, so you cannot simply copy data from more than one record in one go).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>