<?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 does FDS write the data to?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30112/where-does-fds-write-the-data-to</link><description>Hi, 
 I checked the flash_fds example. I could not tell the address it tries to access to. Is there any way I can find the address? Can I limited it to a certain address range? What is the data structure looks like? 
 
 Thank you, 
 Min-Ching</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Feb 2018 07:53:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30112/where-does-fds-write-the-data-to" /><item><title>RE: Where does FDS write the data to?</title><link>https://devzone.nordicsemi.com/thread/119870?ContentTypeID=1</link><pubDate>Tue, 06 Feb 2018 07:53:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4edd5b8e-1e53-41ec-8e3b-bb06f20bc8a5</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;I think you&amp;#39;re mixing between the functionality provided in FDS and the FSTORAGE library.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The Fstorage library is a driver for flash storage, with support for SoftDevice and NVMC backend.&lt;/p&gt;
&lt;p&gt;Fstorage has a simplistic API, where the application controls which address/page of the flash is manipulated.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;FDS is a filesystem implemented on-top of fstorage, where each entry is tagged in a type/length/value (TLV) structure, where the user sets aside a given amount of flash pages (min. 2, because one page will be tagged as SWAP). The amount of pages set aside is configurable in your project&amp;#39;s define sdk_config.h::FDS_VIRTUAL_PAGES.&lt;/p&gt;
&lt;p&gt;FDS is used by the peer_manager library, which handles storing of bluetooth bonds to flash.&lt;/p&gt;
&lt;p&gt;When using FDS, the pages are located from the top of flash (derived from values in FICR), or from the DFU/Bootloaders area and down if a bootloader is present in your device.&lt;/p&gt;
&lt;p&gt;This is shown better in fds.c::flash_end_addr():&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static uint32_t flash_end_addr(void)
{
    uint32_t const bootloader_addr = NRF_UICR-&amp;gt;NRFFW[0];
    uint32_t const page_sz         = NRF_FICR-&amp;gt;CODEPAGESIZE;
#ifndef NRF52810_XXAA
    uint32_t const code_sz         = NRF_FICR-&amp;gt;CODESIZE;
#else
    // Number of flash pages, necessary to emulate the NRF52810 on NRF52832.
    uint32_t const code_sz         = 48;
#endif

    return (bootloader_addr != 0xFFFFFFFF) ? bootloader_addr : (code_sz * page_sz);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where does FDS write the data to?</title><link>https://devzone.nordicsemi.com/thread/119823?ContentTypeID=1</link><pubDate>Mon, 05 Feb 2018 18:34:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e0ae49a-2984-46ff-92e0-be8ca76ee2c3</guid><dc:creator>min-ching</dc:creator><description>&lt;p class="p1"&gt;&lt;span class="s1"&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon&lt;/span&gt;,&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="s1"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;The link you provided is for 52832 and we are using 52840. The flash size is a lot different in between these two. In the link, it says the end of the flash address is 0x80000 which is only half way of the flash on 52840.&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="s1"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; I tried to find &amp;quot;fstorage_internal_defs.h&amp;quot; in the SDK14.2. I can not find this file at all. I also tried to find &amp;quot;fs_flash_page_end_addr&amp;quot; function in the SDK14.2. I still can not find it. The closest one I found is fds_internal_defs.h. But, I can not see the end of address there. Can you please help me to identify where the address is?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="s1"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;One very important question we need to know. We&amp;nbsp;will have some partitions on the internal flash. Each partition will have it&amp;#39;s purpose. Will SoftDevice try to read or write data on internal flash? If it does, where does it stores the data? We want to avoid overlapping partitions.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="s1"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="s1"&gt;Thank you,&lt;/span&gt;&lt;/p&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;Min-Ching&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where does FDS write the data to?</title><link>https://devzone.nordicsemi.com/thread/119668?ContentTypeID=1</link><pubDate>Mon, 05 Feb 2018 07:50:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e9c8324-5810-48fd-b4ec-737294ad607d</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;FDS sets aside a configurable amount of flash pages for storage (and one for swap), as explained here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/22325/flash-data-storage-place-in-memory#post-id-141264"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/22325/flash-data-storage-place-in-memory#post-id-141264&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The storage format can be found here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/lib_fds_format.html?cp=4_0_0_3_50_2"&gt;http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/lib_fds_format.html?cp=4_0_0_3_50_2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>