<?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>Calculate available space to use flash data read and write</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37642/calculate-available-space-to-use-flash-data-read-and-write</link><description>Hello Nordic Team 
 I am working on nRF52832 MCU, SDK-11. I want to calculate available space so that I can save custom sensors data in chip. 
 According to datasheet we have space 512 KB. Here Bootloader occupied 24 KB, Softdevice occupied 108 KB, Application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 Aug 2018 07:19:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37642/calculate-available-space-to-use-flash-data-read-and-write" /><item><title>RE: Calculate available space to use flash data read and write</title><link>https://devzone.nordicsemi.com/thread/145609?ContentTypeID=1</link><pubDate>Fri, 24 Aug 2018 07:19:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42cc40b1-77cf-4dd8-a5f9-0075d8c32b8b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I am not sure I understand. The FDS has nothing to do with the SoftDevice. If you use it (directly or indirectly because you use a module that use it, such as the Peer manager), then you need to account for it. If you don&amp;#39;t use it, then you don&amp;#39;t account for it.&lt;/p&gt;
&lt;p&gt;If you want to use raw flash for data recording, then you should account for everything that use flash. Once that is accounted for, you can use everything else for whatever you want. Typically you would have available flash between the end of the application (lower address) and the start of FDS pages (if used) or bootloader (higher address). Essentially look at the list in my original answer, and fill in the start and end address for each point. (You can even draw a &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/lib_bootloader.html?cp=4_0_0_3_5_0_7#lib_bootloader_memory"&gt;memory layout ad done here&lt;/a&gt;). That will show you exactly what flash&amp;nbsp; you have available at which start address.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate available space to use flash data read and write</title><link>https://devzone.nordicsemi.com/thread/145553?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 15:33:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0780d64-3a42-4b56-ad3f-94cfdf396a41</guid><dc:creator>Rajneesh</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;I will not count FSD size because I am softdevice is used in my project.&lt;/p&gt;
&lt;p&gt;One question, How can I know the starting location where I need to start data recording. And what is the last location?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate available space to use flash data read and write</title><link>https://devzone.nordicsemi.com/thread/145238?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2018 08:19:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8785cfe9-8419-4541-98f6-aa1d0ffcc530</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. I was not precise enough at this point. The MBR&amp;nbsp;is included in the SoftDevice, so if you use the SoftDevice you do not have to account for the MBR. (However, it is also available standalone so if you do not use the SoftDevice but for example need a USB bootloader for the nRF52840, then you need the MBR and would account for its size.)&lt;/p&gt;
&lt;p&gt;2. The minimum number of FDS pages is 2, as one of the pages are reserved for garbage collection. The SDK examples that only need the peer manager typically use 3 FDS pages (&lt;code&gt;FDS_VIRTUAL_PAGES&lt;/code&gt; in the projects sdk_config.h). If you need to store more data with FDS, you should increase the number of pages accordingly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate available space to use flash data read and write</title><link>https://devzone.nordicsemi.com/thread/145187?ContentTypeID=1</link><pubDate>Tue, 21 Aug 2018 21:34:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:138cdfc1-3fe6-481c-97ba-63fccb72ca2f</guid><dc:creator>Rajneesh</dc:creator><description>&lt;p&gt;Thanks Einor for quick reply.&lt;/p&gt;
&lt;p&gt;I have two questions:&lt;/p&gt;
&lt;p&gt;1. Does 1st and 2nd are different? If yes then how much space required for MRB?&lt;/p&gt;
&lt;p&gt;2. Regarding FSD pages, How much minimum space required?&lt;/p&gt;
&lt;p&gt;When I get above two answer I can calculate the available space in my system.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculate available space to use flash data read and write</title><link>https://devzone.nordicsemi.com/thread/145038?ContentTypeID=1</link><pubDate>Tue, 21 Aug 2018 07:35:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8f152db-a71f-4115-ad1f-3706990d5c60</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. You do not&amp;nbsp;strictly need to reserve room for DFU. The bootloader will use dual bank if there is available flash but will fall back to single bank if there is no additional room. That means that the bootloader would delete the application so that the new application could be written directly to the same location in flash, not needing any temporary flash memory.&lt;/p&gt;
&lt;p&gt;2. You can use all available flash for sensor data. However, it seems you did not include flash needed for the peer manager (storing BLE bonding information) in your calculation. This uses FDS. Typically, you will use three flash pages for that, but it is configurable (depend on how many bonds you want to be able to store).&lt;/p&gt;
&lt;p&gt;3. I think your calculations were correct, except for the missing FDS pages for the peer manager. Essentially you need the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;MRB (Fixed for a given SoftDevice version)&lt;/li&gt;
&lt;li&gt;SoftDevice (Fixed for a given SoftDevice version)&lt;/li&gt;
&lt;li&gt;Application (Variable depending on your application)&lt;/li&gt;
&lt;li&gt;FDS pages (Configurable in your applications sdk_config.h)&lt;/li&gt;
&lt;li&gt;Bootloader (including bootloader settings page. Given by the bootloader / SDK version)&lt;/li&gt;
&lt;li&gt;Any remaining flash can be used as you like.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>