<?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>nRF52532 max number of write times in one block</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68466/nrf52532-max-number-of-write-times-in-one-block</link><description>Primarily addressed Torbj&amp;#248;rn &amp;#216;vrebekk, Nordic. 
 Refer document nRF52 832 Product Specification v1. 4 
 I read &amp;quot; The same block in the Flash can only be written n WRITE number of times before an erase must be performed &amp;quot; where nWRITE is 181 and block</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 30 Aug 2019 05:53:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68466/nrf52532-max-number-of-write-times-in-one-block" /><item><title>RE: nRF52532 max number of write times in one block</title><link>https://devzone.nordicsemi.com/thread/280465?ContentTypeID=1</link><pubDate>Fri, 30 Aug 2019 05:53:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b8362c3-a314-49b5-b1db-91319205c326</guid><dc:creator>Lennart</dc:creator><description>&lt;p&gt;Thank&amp;#39;s Håkan&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sure I know this option now, if I run out of flash in the edge.&amp;nbsp;For me the ticket can be closed as I have all information now.&lt;/p&gt;
&lt;p&gt;/ Lennart&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52532 max number of write times in one block</title><link>https://devzone.nordicsemi.com/thread/280464?ContentTypeID=1</link><pubDate>Thu, 29 Aug 2019 08:19:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1322f831-ae19-4326-a2c6-e2f471e69253</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;You do have 181-128 = 53 writes to spare, so you can do 75 32-bit words and 2 x 53 half-words.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52532 max number of write times in one block</title><link>https://devzone.nordicsemi.com/thread/280463?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2019 17:14:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e962b32-0a4e-44c6-94ab-cd9346d44ea0</guid><dc:creator>Lennart</dc:creator><description>&lt;p&gt;Thanks a lot now everything is 100% clear. I will then only write 32-bit words once, 128 times.&lt;/p&gt;
&lt;p&gt;/ Lennart&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52532 max number of write times in one block</title><link>https://devzone.nordicsemi.com/thread/280462?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2019 14:56:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3115b1e-5339-4c54-b7b4-e5fffa4def6f</guid><dc:creator>haakonsh</dc:creator><description>[quote user="lvedin"]Or is the limit that I shall never write more than two times to the same 32-bit word AND max 181 times in total ?[/quote]
&lt;p&gt;Correct!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52532 max number of write times in one block</title><link>https://devzone.nordicsemi.com/thread/280461?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2019 10:53:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40204d2d-572d-43e1-85ab-800448355792</guid><dc:creator>Lennart</dc:creator><description>&lt;p&gt;Ok thank you !&lt;/p&gt;
&lt;p&gt;TSS.se sell 100.000 loggers annually now, so we will only apply defined behavior. Also I have no time to learn all, just to apply something working. I really appreciate your help.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I get everything you wrote but not &amp;quot;&lt;span&gt;Each 4byte word can only be written to twice&lt;/span&gt;&amp;quot;, this result in 256 possible write operations for all of the 512b block, but the limit specify max181 times.&lt;/p&gt;
&lt;p&gt;My question is then:&lt;/p&gt;
&lt;p&gt;Can I write all the 512b block, 256 times divided in 16-bits word if writing max two times each 32-bit word?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Or is the limit that I shall never write more than two times to the same 32-bit word AND max 181 times in total ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52532 max number of write times in one block</title><link>https://devzone.nordicsemi.com/thread/280460?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2019 09:17:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:071c7669-cd61-4faf-9120-a1a33a4b3461</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;I wrote in my previous post that each block was 512kB, it&amp;#39;s actually 512bytes. &lt;br /&gt;This 512byte block can be written to 181 times before it needs to be erased. One 512byte block consists of 128 4byte words. Each 4byte word can only be written to twice, this means that if you only write one byte at a time you can only use half of the words, and therefore only half of the 512 byte block.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;There are 8 blocks of 512byte in each 4kB page, and one can only erase a page, not individual blocks.&amp;nbsp;&lt;/p&gt;
[quote user="lvedin"]Is my conclusion correct. If I write zero bits or other data in any order more than 181 times it is expected to typical be read back correctly, but not any&amp;nbsp;&lt;span&gt;guarantee ?&lt;/span&gt;[/quote]
&lt;p&gt;It is undefined behavior, we do not know what will happen. At best you will only get data corruption, at worst it will impact flash endurance, etc.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user="lvedin"]A following question is: If I write more than 181 times and for each write operation read back the value to confirm the read back is correct, is it then&amp;nbsp;guarantee&amp;nbsp;that the writing did work without any future&amp;nbsp;corruption ?[/quote]
&lt;p&gt;&amp;nbsp;We do not know, it&amp;#39;s undefined.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52532 max number of write times in one block</title><link>https://devzone.nordicsemi.com/thread/280459?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 17:08:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0f347a5-c799-44d7-b577-46c744338314</guid><dc:creator>Lennart</dc:creator><description>&lt;p&gt;Tack Håkan !&lt;/p&gt;
&lt;p&gt;Is my conclusion correct. If I write zero bits or other data in any order more than 181 times it is expected to typical be read back correctly, but not any&amp;nbsp;&lt;span&gt;guarantee ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Of cause always consider only writing zero-bits.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;A following question is: If I write more than 181 times and for each write operation read back the value to confirm the read back is correct, is it then&amp;nbsp;guarantee&amp;nbsp;that the writing did work without any future&amp;nbsp;corruption ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Tack och hej&amp;nbsp; Lennart&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52532 max number of write times in one block</title><link>https://devzone.nordicsemi.com/thread/280458?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 12:58:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8926eda2-e0fa-4223-8ab4-7a93888d4911</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Hey Lennart,&lt;/p&gt;
[quote user=""]I did perform&amp;nbsp;4096 number of write zero operations bit by bit with successfully read back same data one by one, and all bits was successfully zeros after restart. I could repeat this process. Was I just &amp;quot;lucky&amp;quot; ?[/quote]
&lt;p&gt;No, this is the expected behavior of any flash memory, where&amp;nbsp;the erased state of any byte is 0xFF, if you write zeroes bit-by-bit the state changes from 0xFF to 0xFE to 0xFD, etc, and you will be able to read out the correct state of the memory.&amp;nbsp;&lt;br /&gt;Now if you do the inverse, erase a byte, write it to 0x00, and then try to write any other value to the byte, you should see that it cannot change state from 0x00.&amp;nbsp;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Do I MUST erase after 181 writing, it mean I cannot even perform two write operations for all the 32-bits in one block without erase ?[/quote]
&lt;p&gt;Flash writing to zero is an operation where one drains a charge from a transistor gate, who has been previously charged during the erase procedure. This is why any flash memory cell&amp;#39;s erased state are all ones&amp;nbsp;and not zeroes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As one block of flash contains 512kB of memory cells, if you write to each byte, one-by-one, you should after a few hundred bytes start to see data corruption as the memory cell&amp;#39;s write-circuit fails, I believe due to insufficient charge somewhere in its circuitry. &lt;br /&gt;&lt;br /&gt;We guarantee safe operation for 181 such writes before one needs to erase the block, and thereby re-charging the memory cell&amp;#39;s circuits.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I suggest you read up on&amp;nbsp;&lt;span&gt;&lt;a href="https://en.wikipedia.org/wiki/Flash_memory#NOR_flash"&gt;NOR flash&lt;/a&gt;&amp;nbsp;and &lt;a href="https://en.wikipedia.org/wiki/Flash_memory#Block_erasure"&gt;Block erasure&lt;/a&gt;.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Håkon.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>