<?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>How can I read bytes from flash?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11672/how-can-i-read-bytes-from-flash</link><description>developer.nordicsemi.com/.../a00935.html 
 The doc seems to provide only write functions.
And, the flashwrite example doesn&amp;#39;t show how to read from flash even after device rebooted.
How can I read something later that has been stored in flash?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Feb 2016 11:47:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11672/how-can-i-read-bytes-from-flash" /><item><title>RE: How can I read bytes from flash?</title><link>https://devzone.nordicsemi.com/thread/44122?ContentTypeID=1</link><pubDate>Wed, 03 Feb 2016 11:47:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dca153d-180e-4bcf-96fc-8e19cfa79313</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Thanks for coming back and updating this thread.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read bytes from flash?</title><link>https://devzone.nordicsemi.com/thread/44121?ContentTypeID=1</link><pubDate>Wed, 03 Feb 2016 10:45:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:403cf50c-db96-4341-8a5a-c80a84b41ab8</guid><dc:creator>Rifat Mahmud</dc:creator><description>&lt;p&gt;Yes, the flash is working on restart. Thanks. :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read bytes from flash?</title><link>https://devzone.nordicsemi.com/thread/44120?ContentTypeID=1</link><pubDate>Wed, 03 Feb 2016 10:38:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af482d37-5df5-4bce-a485-d4d90f53968c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I do not see why not!! The flash is initialized before the CPU starts executing code. So it should work, give it a try and let me know how it went.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read bytes from flash?</title><link>https://devzone.nordicsemi.com/thread/44119?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2016 12:20:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75b4daba-f59d-4522-a424-ba2a2055f7fc</guid><dc:creator>Rifat Mahmud</dc:creator><description>&lt;p&gt;But, since it&amp;#39;s &amp;#39;non volatile&amp;#39; memory, will this address be working even after complete hard reboot of the device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I read bytes from flash?</title><link>https://devzone.nordicsemi.com/thread/44118?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2016 07:30:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ece5418a-0b6a-430d-824c-84274f32fdf4</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You do not need NVMC hardware or API to read the flash memory. Just read it like any other memory.&lt;/p&gt;
&lt;p&gt;for example, if you want to read 2 bytes of flash located at 0x21000 then the below code will do it&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define STORAGE_ADR   0x21000
uint16_t value = *(uint16_t *)ptr;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or If you want to compare it with some thing then better would be to do like below&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  if(*((uint16_t *)STORAGE_ADR) == 0xff)
  {
    do something;
  } 
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>