<?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>Write Data in flash and use same data address in secure bootloader file</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95491/write-data-in-flash-and-use-same-data-address-in-secure-bootloader-file</link><description>Hello, 
 I am working on nRF52832 with using SDK nRF5 15.3.0 version in Segger Embedded Studio. 
 I have one application in which I have 64byte data received from BLE and store it in flash. This stored data I needs to use in secure bootloader project</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 Jan 2023 10:21:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95491/write-data-in-flash-and-use-same-data-address-in-secure-bootloader-file" /><item><title>RE: Write Data in flash and use same data address in secure bootloader file</title><link>https://devzone.nordicsemi.com/thread/406417?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2023 10:21:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a1fc033-ca3f-423b-b863-64d0f7f81679</guid><dc:creator>Drashti Mistry</dc:creator><description>&lt;p&gt;Thank you using fstorage example it is working..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Write Data in flash and use same data address in secure bootloader file</title><link>https://devzone.nordicsemi.com/thread/404810?ContentTypeID=1</link><pubDate>Fri, 13 Jan 2023 13:20:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36404b56-b653-4583-8e16-75d27ac2bfc6</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;You are not allowed to access the NVCM directly when using the SoftDevice. Instead, you have to use the SotDevice APIs for writing to flash. Either directly (sd_flash_write() /&amp;nbsp;sd_flash_page_erase()) or &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_fstorage.html"&gt;fstorage&lt;/a&gt;, which abstracts away the differences between using a SoftDevice or not.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Write Data in flash and use same data address in secure bootloader file</title><link>https://devzone.nordicsemi.com/thread/404777?ContentTypeID=1</link><pubDate>Fri, 13 Jan 2023 11:25:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:655555c7-0213-456f-85aa-6148bead95da</guid><dc:creator>Drashti Mistry</dc:creator><description>&lt;p&gt;Thank you for response. I tried same thing and I changed address. Now using 0x00071000 address everythings working fine and stored data from application file and read from bootloader. But I am getting another problem here is when I initialize flash and write the data at the begining of the code from application file(in main using flashwrite example), It is working well but as I said about my application previously, I want to use data comes from BLE So if I am receiving&amp;nbsp; 64 byte data from BLE and after receiving data I am calling this function in main while loop and it is getting stuck at enabling flash write.&lt;/p&gt;
&lt;p&gt;NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Wen;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&amp;lt;-- code get stuck here&lt;/p&gt;
&lt;p&gt;&lt;span&gt;what is the cause of the problem?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Write Data in flash and use same data address in secure bootloader file</title><link>https://devzone.nordicsemi.com/thread/404099?ContentTypeID=1</link><pubDate>Tue, 10 Jan 2023 13:10:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e4606bc-8fc2-44d7-9801-22c714e5eff6</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can read any part of the flash from the bootloader, and that can be as simple as dereferencing a pointer. If for instance you wrote your 64 byte array at 0x00040000, that&amp;nbsp;is where you would read it from. For instance, print the first bye like this:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_LOG_INFO(&amp;quot;First byte: 0x%x&amp;quot;, *(volatile uint8_t*)0x00040000);&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;This should be straight-forward.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;There is another&amp;nbsp;issue here, though. You write that you are using two pages starting at&amp;nbsp;0x0007e000, and that will not work with the bootloader. The last two pages are used for MBR params (second to last) and bootloader settings (very last), and cannot be used for anything&amp;nbsp;else. You need to pick a page that is actually unused. See &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_bootloader.html?cp=8_5_2_3_5_0_7#lib_bootloader_memory"&gt;memory layout in the bootloader documentation&lt;/a&gt; for details.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>