<?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>Using Flash during Softdevice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61431/using-flash-during-softdevice</link><description>Hi, 
 I am trying to store a buffer which i collect from ble connection. I have tried sd_flash functions first. I could not found any examples so page number or addresses might be wrong. 
 
 So i tried to test it with very easy code. These lines are in</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 May 2020 19:31:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61431/using-flash-during-softdevice" /><item><title>RE: Using Flash during Softdevice</title><link>https://devzone.nordicsemi.com/thread/250277?ContentTypeID=1</link><pubDate>Fri, 15 May 2020 19:31:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f5bf5f7-0e7c-4e61-a9c6-ac1da2913a7a</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;My bad. Read the code wrong - you copy FROM flash and not into with memcpy. That is totally safe, of course.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using Flash during Softdevice</title><link>https://devzone.nordicsemi.com/thread/250201?ContentTypeID=1</link><pubDate>Fri, 15 May 2020 13:26:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51ab89a6-7868-4cca-8bc8-02a692160998</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You are trying to both erase and write to page 0, and this is the MBR. You cannot write to anything that is in the MBR and SoftDevice region, and of course, you should not write to anything that holds any other code. Just pick a page that is empty and try that instead. If you don&amp;#39;t have a full understanding of your memory layout, you cust use the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nc_programmer%2FUG%2Fnrf_connect_programmer%2Fncp_introduction.html"&gt;nRF Connect Programmer&lt;/a&gt; to get an overview of the memory layout of your configuration.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using Flash during Softdevice</title><link>https://devzone.nordicsemi.com/thread/250151?ContentTypeID=1</link><pubDate>Fri, 15 May 2020 10:53:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e085a128-a19e-400e-b003-2b5695b766be</guid><dc:creator>oguzhanK</dc:creator><description>&lt;p&gt;I did not use memcpy to write flash. ????&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using Flash during Softdevice</title><link>https://devzone.nordicsemi.com/thread/250145?ContentTypeID=1</link><pubDate>Fri, 15 May 2020 10:32:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a45a98f5-aad4-4183-846e-f643995d894a</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;You cannot erase page zero when using softdevice - this is where the MBR is located. The first page you could erase is the first page &lt;em&gt;above&lt;/em&gt; the softdevice itself.&lt;/p&gt;
&lt;p&gt;If you actually bothered to check return codes, this would be very obvious (invalid param or similar error code).&lt;/p&gt;
&lt;p&gt;Using LibC memcpy() for flash writes is asking for trouble: Newlib-nano memcpy() copies a single &lt;em&gt;byte&lt;/em&gt; at a time, while flash must be written to 4 bytes at once. Those nvm driver functions exist for a reason.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>