<?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>Regarding Flash Read and Write</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12428/regarding-flash-read-and-write</link><description>Hi All, 
 We are in design phase of our project, which uses two NRF52 chipset one as master and Central , We have some prewritten content in Flash, which need to be read when BLE connection is up. So am currently working on checking how much time it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 09 Mar 2016 08:36:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12428/regarding-flash-read-and-write" /><item><title>RE: Regarding Flash Read and Write</title><link>https://devzone.nordicsemi.com/thread/47035?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 08:36:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22d367d6-404c-4a7d-9270-bfda2bc92ee0</guid><dc:creator>Thangaraj</dc:creator><description>&lt;p&gt;Thank you very much Aryan for your quick response !!!!!!!!!!!!!! .........&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regarding Flash Read and Write</title><link>https://devzone.nordicsemi.com/thread/47034?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 08:00:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa3999a9-02c1-428a-8caf-340535193274</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You are right, you can use memcpy for read operation, but i see that there some small issue in you code below for write operation&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;memcpy(address,value,4096);
while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
{
    // Do nothing.
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Above is wrong as you need to wait for every word you write to the flash. That is why it takes so much time for flash writes.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;for (i = 0; i &amp;lt; size; i++)
{
  *address = value;

    // Wait flash write to finish
    while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
    {
        // Do nothing.
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>