<?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>flashwrite example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18139/flashwrite-example</link><description>Hi,
I am a bit confused from the example, in the specs it is said that writing the flash is word allign, and even so the example does something strange: 
 
 do
 
 
 {
 NRF_LOG_INFO(&amp;quot;Enter char to write to flash\r\n&amp;quot;);
 NRF_LOG_FLUSH();
 // Read</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Dec 2016 10:57:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18139/flashwrite-example" /><item><title>RE: flashwrite example</title><link>https://devzone.nordicsemi.com/thread/70006?ContentTypeID=1</link><pubDate>Tue, 06 Dec 2016 10:57:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a99c6e6b-4ade-4050-b23c-7c31ca48c8a7</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I agree with your guys, I have reported it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: flashwrite example</title><link>https://devzone.nordicsemi.com/thread/70005?ContentTypeID=1</link><pubDate>Sat, 03 Dec 2016 00:17:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:935b1f4d-c83e-486f-b3f4-a8094f0d0bf8</guid><dc:creator>AlekseyJ</dc:creator><description>&lt;p&gt;nRF51 page size 256 words or 1024 bytes. nRF52 page size 1024 words or 4096 bytes. I also agree with you that here is error in the code. Instead &lt;code&gt;i += sizeof(patwr);&lt;/code&gt; should be &lt;code&gt;i += sizeof(addr);&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: flashwrite example</title><link>https://devzone.nordicsemi.com/thread/70004?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2016 23:34:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d954b6fb-8105-40aa-89eb-7ef1cd1b239b</guid><dc:creator>etamar</dc:creator><description>&lt;p&gt;pg_size is given in bytes(i maybe mistaken) , not in words- because the addr is determined by (pg_size * pg_num)&lt;/p&gt;
&lt;p&gt;i(in bytes)  is compared to pg_size (words)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: flashwrite example</title><link>https://devzone.nordicsemi.com/thread/70003?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2016 21:52:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4df88e6-6f9d-4fc4-a5bd-bb5914e718c4</guid><dc:creator>AlekseyJ</dc:creator><description>&lt;p&gt;nRF51 and nRF52 SoC is built around a 32-bit ARM&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/00ae.svg" title="Registered"&gt;&amp;#x00ae;&lt;/span&gt; Cortex. Cortex ARM is a 32 bit processor.
32 bit equal to one word. One word is 4 bytes. sizeof(patwr) equal to 1 byte. ++addr equal to ++4 bytes. (uint32_t)patwr equal to 4 bytes of data, just first 3 bytes will be 0. Word aligned mean that it should be 4 bytes data length and also should be word-aligned address.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>