<?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>Where is the peer manager data stored?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20746/where-is-the-peer-manager-data-stored</link><description>Hello,
I can&amp;#39;t find where in flash the peer manager data is stored. I&amp;#39;m currently working on DFU support and as part of that I want to define the memory area that should be preserved when doing updates (I want to store some custom data along with the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 Feb 2018 19:29:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20746/where-is-the-peer-manager-data-stored" /><item><title>RE: Where is the peer manager data stored?</title><link>https://devzone.nordicsemi.com/thread/121312?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2018 19:29:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a2201db-e8d2-44a6-9db2-1a84e6f12a14</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;J&amp;oslash;rn, I know this thread is 11months old, but after I read it, and the links you posted, it is still unclear for me, where is the peer manager data stored? I am facing a scenario&amp;nbsp;similar to Jacob. is it possible change the reserved memory used for FDS? where is it allocated?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;for example if the&amp;nbsp;peer manager data is&amp;nbsp;&amp;quot;underneath the region reserved for the bootloader (if a bootloader is present)&amp;quot; it means&amp;nbsp;the data will be stored&amp;nbsp;below the&amp;nbsp;bootloader addres&amp;nbsp;(end address) and the start address is bootloader address -( flash pages + pages for garbage)?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If no bootloader is present&amp;nbsp;the&amp;nbsp;peer manager should be&amp;nbsp;between or below the bootloader settings?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;for example, could the peer manager data, be store starting in the address&amp;nbsp;0x30000?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;thanks&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where is the peer manager data stored?</title><link>https://devzone.nordicsemi.com/thread/80970?ContentTypeID=1</link><pubDate>Wed, 29 Mar 2017 14:39:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3576c0c2-1a90-4f97-985b-3e2c713ecc49</guid><dc:creator>emdi</dc:creator><description>&lt;p&gt;Yes, you can grow the number of fds pages and DFU_APP_DATA_RESERVED in the future.
fds provides basic wear leveling functionality, i.e. it won&amp;#39;t keep track of how many times each page has been erased, but it will make an effort to not wear one page more than the others. To maximize the lifetime of flash when using fds, I suggest to garbage collect only when you receive the FDS_ERR_NO_SPACE_IN_FLASH error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where is the peer manager data stored?</title><link>https://devzone.nordicsemi.com/thread/80969?ContentTypeID=1</link><pubDate>Wed, 29 Mar 2017 14:23:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d683b47b-dd51-4435-b2ed-59424556ec54</guid><dc:creator>Jacob</dc:creator><description>&lt;p&gt;Ok. What if we along the way realize that we need to store more data (let&amp;#39;s say in two years from now), and increase the value of DFU_APP_DATA_RESERVED. Is that supported?&lt;/p&gt;
&lt;p&gt;How does FDS handle flash wearout? If a block (etc) goes bad in the flash, is this taken care of?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where is the peer manager data stored?</title><link>https://devzone.nordicsemi.com/thread/80968?ContentTypeID=1</link><pubDate>Wed, 29 Mar 2017 13:28:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7977c2e0-4006-4988-aa1f-9b5946302a0f</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;Stored data does not grow in its original location. When a record is updated, a new record with the new data size is written. The new record will be localized in the next available area of the virtual flash data page. After the new record is written, the old record is marked for deletion. The old record will not actually be erased until garbage collection is performed.&lt;/p&gt;
&lt;p&gt;If there is not enough room to store the new data, a FDS_ERR_NO_SPACE_IN_FLASH error will occur. This error is usually used to trigger the garbage collection procedure, to free up room before a new attempt is made to store the data.&lt;/p&gt;
&lt;p&gt;This way the data cannot grow into previously stored data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where is the peer manager data stored?</title><link>https://devzone.nordicsemi.com/thread/80967?ContentTypeID=1</link><pubDate>Wed, 29 Mar 2017 13:25:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:915a60a0-621c-4586-a406-2106019cdada</guid><dc:creator>emdi</dc:creator><description>&lt;p&gt;There is a configuration option in DFU to preserve fds data during updates. I think it&amp;#39;s called DFU_APP_DATA_RESERVED in nrf_dfu_types.h. You should set it to the number of pages used by FDS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where is the peer manager data stored?</title><link>https://devzone.nordicsemi.com/thread/80966?ContentTypeID=1</link><pubDate>Wed, 29 Mar 2017 13:20:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2834da4c-a0e8-4da0-8d60-c7e1708112aa</guid><dc:creator>emdi</dc:creator><description>&lt;p&gt;Yes, you can use fds to write to flash even when using Peer Manager.
You don&amp;#39;t need to take any precautions, fds will handle everything so that your data and Peer Manager data will not overwrite each other. You can write anything to flash, update it, read it back, delete it and whatnot.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where is the peer manager data stored?</title><link>https://devzone.nordicsemi.com/thread/80965?ContentTypeID=1</link><pubDate>Tue, 28 Mar 2017 14:45:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66c0d41d-9192-43e0-88ba-7594475e3577</guid><dc:creator>Jacob</dc:creator><description>&lt;p&gt;Thanks for your answer.&lt;/p&gt;
&lt;p&gt;FDS looks good. However, it feels dangerous that the peer manager data size may vary over time. The custom data may not be lost under any circumstances - is FDS the right module to use for that kind of data?&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s say I know the custom data occupies X bytes - how can I be sure the peer manager data will never grow and overwrite this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where is the peer manager data stored?</title><link>https://devzone.nordicsemi.com/thread/80964?ContentTypeID=1</link><pubDate>Tue, 28 Mar 2017 13:26:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1798f9f2-d624-41ab-9def-270c13e2834f</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;Hello Jacob&lt;/p&gt;
&lt;p&gt;The peer manager uses the Flash Data Storage (FDS) module, which in turn uses the Flash Storage (fstorage) module, which again employs the Softdevice,’s API for storing data in flash.&lt;/p&gt;
&lt;p&gt;The FDS registers with fstorage using the highest priority available, meaning its data will be placed at the highest address in flash, underneath the region reserved for the bootloader (if a bootloader is present). By default the FDS reserves 3 pages of flash (defined in sdk_config.h, minimum is 2), where 1 page is used for garbage handling, the rest is used for storage. The location of the stored data within the reserved memory is based on a first come first serve principal, so data location is not sorted based on user.
The size of the data from the peer manager varies with what data it needs to store.&lt;/p&gt;
&lt;p&gt;If you use FDS to store your custom data it will be stored in the same reserved flash area where the peer manager data is stored.&lt;/p&gt;
&lt;p&gt;For more information please see the following pages on Nordic Infocenter&lt;/p&gt;
&lt;p&gt;Peer Manager:
&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/lib_peer_manager.html?cp=4_0_1_3_1_8"&gt;infocenter.nordicsemi.com/.../lib_peer_manager.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Flash Data Storage:
&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/lib_fds.html?cp=4_0_1_3_37"&gt;infocenter.nordicsemi.com/.../lib_fds.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Flash Storage:
&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/lib_fstorage.html?cp=4_0_1_3_38"&gt;infocenter.nordicsemi.com/.../lib_fstorage.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Jørn Frøysa&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>