<?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>Protecting flash area</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52672/protecting-flash-area</link><description>I have a custom board with nRF52840 and uses Segger EDE. 
 In our project we would like to store some info about production to flash memory (DeviceID, production date etc). Is it possible to protect this area in case of firmware updates later on? Right</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 30 Sep 2019 11:28:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52672/protecting-flash-area" /><item><title>RE: Protecting flash area</title><link>https://devzone.nordicsemi.com/thread/212541?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2019 11:28:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00404524-4689-4481-bddf-2f4928709bc6</guid><dc:creator>Edvin</dc:creator><description>[quote user="awneil"]But it is erased by a full chip erase?[/quote]
&lt;p&gt;Yes. Definitely. But if it is programmed during production, together with the bootloader, then it will remain for the lifetime. The bootloader will never erase the UICR.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Protecting flash area</title><link>https://devzone.nordicsemi.com/thread/212345?ContentTypeID=1</link><pubDate>Fri, 27 Sep 2019 15:12:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:107cfde6-5ec0-4ee9-b926-5f9b1f0cdbb4</guid><dc:creator>awneil</dc:creator><description>[quote userid="26071" url="~/f/nordic-q-a/52672/protecting-flash-area/212322"]The UICR is never touched by the Bootloader[/quote]
&lt;p&gt;But it is erased by a full chip erase?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Protecting flash area</title><link>https://devzone.nordicsemi.com/thread/212322?ContentTypeID=1</link><pubDate>Fri, 27 Sep 2019 14:13:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd7eec6d-5dc1-4daf-ae7a-3d6d9dac5896</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;There are a few different approaches to this.&lt;/p&gt;
&lt;p&gt;You can either store this information using FDS. The bootloader will not (if set up correctly) erase the FDS area during firmware updates.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, if this is data that is never meant to change or be updated, which it sounds like based on the info you describe:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]store some info about production to flash memory (DeviceID, production date etc)[/quote]
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I would recommend to store this information in the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fuicr.html&amp;amp;cp=3_0_0_3_4" rel="noopener noreferrer" target="_blank"&gt;UICR&lt;/a&gt;. The Customer[N], N=0-31, is a good place to store this information.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The UICR is never touched by the Bootloader.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As mentioned, the DFU will not touch the end of the flash, typically used for FDS. If you search for&amp;nbsp;NRF_DFU_APP_DATA_AREA_SIZE in sdk_config.h in&amp;nbsp;the&amp;nbsp;bootloader project, this is the define that says how many bytes (right below the bootloader in flash) that is reserved. If you use FDS, which typically use 3 FDS pages, this will equal 3 * 4096 bytes = 12288 bytes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you want to reserve some extra space, add another page, so you have FDS pages + 1 reserved.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>