<?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 in flash can I write that is safe from DFU?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39198/where-in-flash-can-i-write-that-is-safe-from-dfu</link><description>I&amp;#39;m running SDK 14.0.0 and notice in the examples/flashwrite, the very last flash page is chosen as the place to write data to. Are there any caveats to that? WIll this location get overwritten when I DFU? There were so many caveats to using the UICR</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Oct 2018 10:58:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39198/where-in-flash-can-i-write-that-is-safe-from-dfu" /><item><title>RE: Where in flash can I write that is safe from DFU?</title><link>https://devzone.nordicsemi.com/thread/151806?ContentTypeID=1</link><pubDate>Fri, 05 Oct 2018 10:58:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07f2714b-8ed9-40e9-9269-b63f5e681027</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The bootloader will preserve data in the &amp;quot;Application data&amp;quot; region, see &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v14.0.0%2Flib_bootloader.html&amp;amp;anchor=lib_bootloader_memory"&gt;Bootloader Memory layout&lt;/a&gt;. The size of application data is configured with APP_DATA_RESERVED. If you use a bootloader then the application data area is where you should store application data to be kept through DFU. The BLE examples in the SDK uses &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v14.0.0%2Flib_peer_manager.html"&gt;Peer Manager&lt;/a&gt;, which uses a configurable number of flash pages from application data. You should consider using &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v14.0.0%2Flib_fds.html"&gt;Flash Data Storage (FDS)&lt;/a&gt; for storing your data. (Peer Manager also uses FDS.) If on the other hand you need to read/write directly from/to a fixed address, then you may for instance use a page below the range used by FDS / Peer Manager. Just make sure that APP_DATA_RESERVED covers all the data that you need to keep.&lt;/p&gt;
&lt;p&gt;The bootloader itself uses the very last page in flash for internal bookkeeping, known as the &amp;quot;bootloader settings page&amp;quot;. The bootloader needs to be in full control of this page, and any other data written there may confuse the bootloader and/or get overwritten by the bootloader.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>