<?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>I have a question with flash writing of nRF 52.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34555/i-have-a-question-with-flash-writing-of-nrf-52</link><description>I have a question with flash writing of nRF 52. Once written, you can not write it for the second time. It will not cause an error, but is there any way? Write the source code below. 
 -----------------------------------------------------------------</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 23 May 2018 06:53:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34555/i-have-a-question-with-flash-writing-of-nrf-52" /><item><title>RE: I have a question with flash writing of nRF 52.</title><link>https://devzone.nordicsemi.com/thread/132872?ContentTypeID=1</link><pubDate>Wed, 23 May 2018 06:53:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83a26e4e-d5ff-4070-a000-8a79f65336ea</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can write&amp;nbsp;to the same address more than once, but there are some limitations. When you erase a page, all memory cells (holding one bit) are set to &amp;#39;1&amp;#39;, and writing can flip any bit from &amp;#39;1&amp;#39; to &amp;#39;0&amp;#39;. However Neighboring memory cells are also affected by the write, so there is a limit of how many writes you can do before you risk corrupting these neighboring bits.&lt;/p&gt;
&lt;p&gt;The product specification lists the limitations. For the nRF52832, the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/nvmc.html?cp=2_1_0_10#concept_pcl_wbz_vr"&gt;NVMC chapter in the PS&lt;/a&gt; states that the same block in the Flash can only be written n&lt;sub&gt;WRITE&lt;/sub&gt; number&amp;nbsp;of times before an erase must be performed, where&amp;nbsp;n&lt;sub&gt;WRITE&lt;/sub&gt; is&amp;nbsp;181. For the&amp;nbsp;nRF52832, the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52840.ps/nvmc.html?cp=2_0_0_3_2"&gt;NVMC chapter in the PS&lt;/a&gt; states that a 32 bit word can only be written n&lt;sub&gt;WRITE&lt;/sub&gt; number of times before an erase must be performed. In this case,&amp;nbsp;n&lt;sub&gt;WRITE&lt;/sub&gt; is 2.&lt;/p&gt;
&lt;p&gt;This limitation is not enforced by &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/lib_fstorage.html?cp=4_0_0_3_53"&gt;fstorage&lt;/a&gt; or SoftDevice, so you must handle it yourself if you do low-level flash access. However, this is taken care of if&amp;nbsp; you use the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/lib_fds.html?cp=4_0_0_3_52"&gt;FDS&lt;/a&gt;&amp;nbsp;file system.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>