<?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>The upper limit of user that saved by peer_manage</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114949/the-upper-limit-of-user-that-saved-by-peer_manage</link><description>How many users data can be saved by peer_manege that may limited by the size of flash? 
 I want to know the max value.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 Sep 2024 09:06:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114949/the-upper-limit-of-user-that-saved-by-peer_manage" /><item><title>RE: The upper limit of user that saved by peer_manage</title><link>https://devzone.nordicsemi.com/thread/503911?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2024 09:06:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e30f3f6-c534-4a41-ab04-9796537ab768</guid><dc:creator>Einar Thorsrud</dc:creator><description>[quote user="Chaoyue Ying"]Theoretically,I can reserve the entier flash for FDS used to save bond information?[/quote]
&lt;p&gt;No. You need space for your application at the very least.&lt;/p&gt;
[quote user="Chaoyue Ying"]RAM will ensure application running normally?[/quote]
&lt;p&gt;No. The applicaiton reside in flash (though theoretically you could run parts from RAM but it would still need to be stored in flash and copied to RAM on reset).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The upper limit of user that saved by peer_manage</title><link>https://devzone.nordicsemi.com/thread/503909?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2024 09:03:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bdd7e0c-ad2a-4ba4-8dcc-8cf803598b51</guid><dc:creator>Chaoyue Ying</dc:creator><description>&lt;p&gt;Theoretically,I can reserve the entier flash for FDS used to save bond information?RAM will ensure application running normally?In this premise,The max number of bond users can be calculate that without out of range&amp;nbsp;result in&amp;nbsp;overwrite the previous data.&lt;span class="yd-translate-container"&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="yd-wrapper-inline yd-highlight"&gt; 从理论上讲,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The upper limit of user that saved by peer_manage</title><link>https://devzone.nordicsemi.com/thread/503907?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2024 08:54:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb37dace-1834-47fc-b6a0-0e201066903f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Please ask the whole question in English.&lt;/p&gt;
[quote user="Chaoyue Ying"]I can set 1024 words per page and reserved 128 pages.[/quote]
&lt;p&gt;No. That would reserve the entier flash for FDS, leaving no room for the application or anything else.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The upper limit of user that saved by peer_manage</title><link>https://devzone.nordicsemi.com/thread/503903?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2024 08:48:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e622ebe1-d3c8-4893-b6bf-4d55f6cb0d14</guid><dc:creator>Chaoyue Ying</dc:creator><description>&lt;p&gt;So,Whether I can understand it as that,I can set 1024 words per page and reserved 128 pages.&lt;span class="yd-translate-container"&gt;&lt;span class="yd-wrapper-block yd-highlight"&gt;那么，我是否可以理解为，我可以设置每页1024个单词，预留128页。&lt;/span&gt;&lt;/span&gt;&lt;span class="yd-translate-container"&gt;&lt;span class="yd-wrapper-block yd-highlight"&gt;那么，我是否可以理解为，我可以设置每页1024个单词，预留128页。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;One page will used to&amp;nbsp;&lt;span&gt;garbage collection(assumption unchanged),therefore I can save 127 pages data of peer_data.And I see a bond informaton need 20 words,that means about 6502 bond informations can be saved if flash all used to save without recycle?&lt;span class="yd-translate-container"&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="yd-wrapper-inline yd-highlight"&gt; 垃圾收集&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="yd-translate-container"&gt;&lt;span class="yd-wrapper-block yd-highlight"&gt;一个页面将用于垃圾收集(假设不变)，因此我可以保存127个页面垃圾收集&lt;/span&gt;&lt;/span&gt;&lt;span class="yd-translate-container"&gt;&lt;span class="yd-wrapper-block yd-highlight"&gt;一个页面将用于垃圾收集(假设不变)，因此我可以保存127个页面垃圾收集&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The upper limit of user that saved by peer_manage</title><link>https://devzone.nordicsemi.com/thread/503899?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2024 08:33:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86160786-7bc3-483d-a1a7-3a3a193055d1</guid><dc:creator>Einar Thorsrud</dc:creator><description>[quote user="Chaoyue Ying"]Maybe you ignored the picture in previous reply.[/quote]
&lt;p&gt;Yes, I was unable to read that.&lt;/p&gt;
[quote user="Chaoyue Ying"]It said the&amp;nbsp;record key and file id was be saved for peer_manage start with 0xC0000.But the end value was not be refer to.And I want to know if their end value depends on pages.[/quote]
&lt;p&gt;The recod key and file ID is not related to where it is &lt;em&gt;located&lt;/em&gt; on flash. The location will move around every time FDS garbage collection is perfomed. If you want to understand more about this you can see the &lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/lib_fds.html"&gt;FDS documentation&lt;/a&gt;.&lt;/p&gt;
[quote user="Chaoyue Ying"]About the question of FDS pages max value above.I think this situation exists that pages&amp;nbsp;multiply by size more than 512KB that is the all flash size of nRF52832-QFAA.How it will deal it?[/quote]
&lt;p&gt;Unelss you have very good reason not to, you will set the virtual page size equal to the physical page size, which is 4 kB (0x1000). You configure FDS in sdk_config.h. Most example use this default config for FDS:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;e&amp;gt; FDS_ENABLED - fds - Flash data storage module
//==========================================================
#ifndef FDS_ENABLED
#define FDS_ENABLED 1
#endif
// &amp;lt;h&amp;gt; Pages - Virtual page settings

// &amp;lt;i&amp;gt; Configure the number of virtual pages to use and their size.
//==========================================================
// &amp;lt;o&amp;gt; FDS_VIRTUAL_PAGES - Number of virtual flash pages to use. 
// &amp;lt;i&amp;gt; One of the virtual pages is reserved by the system for garbage collection.
// &amp;lt;i&amp;gt; Therefore, the minimum is two virtual pages: one page to store data and one page to be used by the system for garbage collection.
// &amp;lt;i&amp;gt; The total amount of flash memory that is used by FDS amounts to @ref FDS_VIRTUAL_PAGES * @ref FDS_VIRTUAL_PAGE_SIZE * 4 bytes.

#ifndef FDS_VIRTUAL_PAGES
#define FDS_VIRTUAL_PAGES 3
#endif

// &amp;lt;o&amp;gt; FDS_VIRTUAL_PAGE_SIZE  - The size of a virtual flash page.
 

// &amp;lt;i&amp;gt; Expressed in number of 4-byte words.
// &amp;lt;i&amp;gt; By default, a virtual page is the same size as a physical page.
// &amp;lt;i&amp;gt; The size of a virtual page must be a multiple of the size of a physical page.
// &amp;lt;1024=&amp;gt; 1024 
// &amp;lt;2048=&amp;gt; 2048 

#ifndef FDS_VIRTUAL_PAGE_SIZE
#define FDS_VIRTUAL_PAGE_SIZE 1024
#endif

// &amp;lt;o&amp;gt; FDS_VIRTUAL_PAGES_RESERVED - The number of virtual flash pages that are used by other modules. 
// &amp;lt;i&amp;gt; FDS module stores its data in the last pages of the flash memory.
// &amp;lt;i&amp;gt; By setting this value, you can move flash end address used by the FDS.
// &amp;lt;i&amp;gt; As a result the reserved space can be used by other modules.

#ifndef FDS_VIRTUAL_PAGES_RESERVED
#define FDS_VIRTUAL_PAGES_RESERVED 0
#endif
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here, the virtual page size is 1024 &lt;em&gt;words&lt;/em&gt;, which is 4096 &lt;em&gt;bytes&lt;/em&gt; which is one page, and that is what I recomend you keep. 3 pages are reserved, which is in total 12 kB. Of this 1 page (4 kB) is used as swap page used during garbage collection, so you h ave 8 kB of data you can store (ignoring overhead). You can increase the&amp;nbsp;FDS_VIRTUAL_PAGES as needed if you need mre FDS data as long as there is available flash on your device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The upper limit of user that saved by peer_manage</title><link>https://devzone.nordicsemi.com/thread/503889?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2024 08:05:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:826ef5cf-824b-4d3a-970d-8f880cc3f39a</guid><dc:creator>Chaoyue Ying</dc:creator><description>&lt;p&gt;Maybe you ignored the picture in previous reply.&lt;/p&gt;
&lt;p&gt;It said the&amp;nbsp;record key and file id was be saved for peer_manage start with 0xC0000.But the end value was not be refer to.And I want to know if their end value depends on pages.&lt;/p&gt;
&lt;p&gt;And maybe I&amp;#39;m wrong to understand the relationship of (record key and file id) with flash.If they are not related?&lt;/p&gt;
&lt;p&gt;About the question of FDS pages max value above.I think this situation exists that pages&amp;nbsp;multiply by size more than 512KB that is the all flash size of nRF52832-QFAA.How it will deal it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The upper limit of user that saved by peer_manage</title><link>https://devzone.nordicsemi.com/thread/503877?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2024 07:07:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59cba0f4-80e5-4ae6-a1f2-cfc55040a406</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Chaoyue Ying"]I find such define in peer_manager_types.h[/quote]
&lt;p&gt;You are right, there is a&amp;nbsp;PM_PEER_ID_N_AVAILABLE_IDS. This is set to 256 though which is a value that is selected to be higher than what will normally ever be needed (and if we assume the same bond size as in the post I linked to with one CCCD, that wnumber will requier 38 kB flash storage, so in practice you would need to reserve 44 kB (10 flash pages) for FDS in order to be able to store that much. (If you need a higher value I would be intersted in understanding why, but that said you may adjust PM_PEER_ID_N_AVAILABLE_IDS to a higher value but make sure that the larges possible peer ID + connection handle is still lower than 0xFFFE which is&amp;nbsp;PDS_LAST_RESERVED_FILE_ID.&lt;/p&gt;
[quote user="Chaoyue Ying"]&lt;p&gt;Maybe it depends on&amp;nbsp;&lt;span&gt;the number of pages allocafted to FDS?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Yes, a normal project will allocate less than 10 pages for FDS, but that is configurable.&lt;/p&gt;
[quote user="Chaoyue Ying"]Here&amp;#39;s a new problem.If the number of pages allocafted to FDS is limited?If not,The defined flash space will more than the virtual flash space.How the chip will deal with it?[/quote]
&lt;p&gt;I did not understand the question. Can you elaborate? Generally though, you can monitor FDS usage and take action if the usage is too high (for instance delete the oldest bonds). It often makes sense to do this proactively for instance check after every bonding. You can check FDS usage with&amp;nbsp;fds_stat().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The upper limit of user that saved by peer_manage</title><link>https://devzone.nordicsemi.com/thread/503850?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2024 00:28:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25acd9a6-6566-4ce1-98bf-0645a68f4d0a</guid><dc:creator>Chaoyue Ying</dc:creator><description>&lt;p&gt;I find such define in peer_manager_types.h&lt;span class="yd-translate-container"&gt;&lt;span class="yd-wrapper-block yd-highlight"&gt;我在peer_manager_types.h中找到了这样的定义&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define PM_PEER_ID_N_AVAILABLE_IDS      256                                            /**&amp;lt; @brief The number of available peer IDs. */&lt;/pre&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;p&gt;This define will not limit the number of peers?&lt;span class="yd-translate-container"&gt;&lt;span class="yd-wrapper-block yd-highlight"&gt;这个定义不会限制节点的数量吗?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Besides,I find such explain in&amp;nbsp;third-party course about FDS.&lt;span class="yd-translate-container"&gt;&lt;span class="yd-wrapper-block yd-highlight"&gt;另外，我在关于FDS的第三方课程中也发现了这样的解释。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/QQ_FE564772_20240926081917.png" /&gt;&lt;/p&gt;
&lt;p&gt;Whether it is true?If it is certain,What is the end address of FDS for peer_manager?&lt;/p&gt;
&lt;p&gt;Maybe it depends on&amp;nbsp;&lt;span&gt;the number of pages allocafted to FDS?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here&amp;#39;s a new problem.If the number of pages allocafted to FDS is limited?If not,The defined flash space will more than the virtual flash space.How the chip will deal with it?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="yd-translate-container"&gt;&lt;span class="yd-wrapper-block yd-highlight"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="yd-translate-container"&gt;&lt;span class="yd-wrapper-block yd-highlight"&gt;这是真的吗?如果确定，peer_manager的FDS结束地址是什么?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The upper limit of user that saved by peer_manage</title><link>https://devzone.nordicsemi.com/thread/503746?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2024 12:18:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd2c0441-7789-4edb-ac63-1d51380f832e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is no defined maximum value of peers, it is only limited by flash size (and the number of pages allocafted to FDS and/or other data that is also stored in FDS. See&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/25703/how-large-is-the-size-peer-manager-uses/101258"&gt;this post &lt;/a&gt;for the typical size of a bond.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>