<?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>Explanations about flash_fstorage example.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85664/explanations-about-flash_fstorage-example</link><description>Hello 
 I have some questions about flash_fstorage example. 
 
 
 After reading the macro, it seems that fstorage will be located in .fs_data flash zone. 
 start_addr is set to 0x3e000. Where does this address come from? Is it an absolute value in device</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Mar 2022 16:01:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85664/explanations-about-flash_fstorage-example" /><item><title>RE: Explanations about flash_fstorage example.</title><link>https://devzone.nordicsemi.com/thread/357736?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 16:01:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:098f40b1-ad3c-4e4c-8db1-f26bd292a5d3</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Julien,&lt;br /&gt;&lt;br /&gt;I am glad to help. &lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Explanations about flash_fstorage example.</title><link>https://devzone.nordicsemi.com/thread/357720?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 15:16:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7ecae0a-9599-4a38-87e1-3a1d5c9bcc5b</guid><dc:creator>julienD</dc:creator><description>&lt;p&gt;OK, thanks for your answer.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Julien&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Explanations about flash_fstorage example.</title><link>https://devzone.nordicsemi.com/thread/357700?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 14:24:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f99a76fe-1fb3-4033-bd3a-00ebce263d8e</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Julien,&lt;/p&gt;
[quote user="julienD"] is&amp;nbsp;&lt;span&gt;fstorage data located in .fs_data flash zone?&lt;/span&gt;[/quote]
&lt;p&gt;No. It is not a part of fstorage.&lt;/p&gt;
[quote user="julienD"]If my app code is growing (new version), fstorage might be overwritten. Right ?[/quote]
&lt;p&gt;If you want to have an option of new application&amp;nbsp; version you should have a bootloader which is located on top of the flash. If you have MBR and Softdevice, then these two would go to the bottom of the flash. There is a free space between bootloader and softdevice controller which is used to put application with its data. If you have FDS, it would be located just below the bootloader. &lt;br /&gt;If your application is too big it will have a potential to exceed its limits and could overwrite either the application data or bootloader. You could also potentially run out of the flash space.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user="julienD"]&lt;p&gt;&lt;span&gt; In the example, there&amp;#39;s a function called&amp;nbsp;uint32_t nrf5_flash_end_addr_get(). This function is &amp;quot; Helper function to obtain the &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;last address on the last page of the on-chip flash that can be used to write user data.&amp;quot;. The usage is clear to me but&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;what&amp;#39;s the way to get the first address on the first page available to write data?&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Function &lt;span&gt;nrf5_flash_end_addr_get()&lt;/span&gt; gets the last available address for writing to the flash. This address is the bottom address of the bootloader. This value can also be obtained by looking at the address (base address plus offset) of the register UICR.NRFFW[0] . You can read more about UICR registers in the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/uicr.html?cp=4_0_0_3_4_0#topic"&gt;product documentation&lt;/a&gt;. For the value of flash starting address, it is up to the user to ensure that different instances operate on non-overlapping flash memory regions. From the hex file of your application you can determine (with drag&amp;amp;drop to the nRF for Desktop Programmer application) the value for&amp;nbsp; the starting address of your application. &lt;br /&gt;&lt;br /&gt;In the documentation, you can read more about &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.1.0%2Flib_fstorage.html"&gt;flash storage&lt;/a&gt; and &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_bootloader.html"&gt;bootloader memory layout&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Explanations about flash_fstorage example.</title><link>https://devzone.nordicsemi.com/thread/357495?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2022 16:24:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:625a8faa-02ad-47ff-a020-51d3130887df</guid><dc:creator>julienD</dc:creator><description>&lt;p&gt;The diagram on this page&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_fstorage.html"&gt;infocenter.nordicsemi.com/.../lib_fstorage.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;show that FDS area is located after application code.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please, for my comprehension, could you answer the following questions :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- is&amp;nbsp;&lt;span&gt;fstorage data located in .fs_data flash zone?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- If my app code is growing (new version), fstorage might be overwritten. Right ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- In the example, there&amp;#39;s a function called&amp;nbsp;uint32_t nrf5_flash_end_addr_get(). This function is &amp;quot; Helper function to obtain the &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;last address on the last page of the on-chip flash that can be used to write user data.&amp;quot;. The usage is clear to me but&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;what&amp;#39;s the way to get the first address on the first page available to write data?.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Julien&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Explanations about flash_fstorage example.</title><link>https://devzone.nordicsemi.com/thread/357490?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2022 16:02:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3a6c5cf-65ab-421b-b639-5220d8775397</guid><dc:creator>julienD</dc:creator><description>&lt;p&gt;Hi Dejan.&lt;/p&gt;
&lt;p&gt;Documentation answers none of my questions.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How can I know that 0x3e000 belongs to fs_data ? ( If what I understood is right )&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Julien&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Explanations about flash_fstorage example.</title><link>https://devzone.nordicsemi.com/thread/357489?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2022 15:53:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f4f71ef-be8c-430c-a318-1c1483de869d</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi, &lt;br /&gt;&lt;br /&gt;These are the example values that need to be set manually depending on a specific need. You can read more in &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/fstorage_example.html"&gt;flash storage example documentation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>