<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Flash driver example: Reading the flash memory in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Flash-driver-example-Reading-the-flash-memory/m-p/658227#M7141</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gaurav Banyal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;FLASH_ReadResource&lt;/STRONG&gt; API is for a special flash memory region called &lt;STRONG&gt;Flash&lt;/STRONG&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;STRONG&gt;IFR&lt;/STRONG&gt;. In particular for the KL03 this region includes a 64 bytes &lt;STRONG&gt;Program Once Field&lt;/STRONG&gt;. You can find details about Program Once Field in the Reference Manual.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no dedicated API for reading flash as you can simply do it with a pointer or any C code method. Following the logic of the example you could read the written data in a separate buffer like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// Extra variables to read data&lt;/SPAN&gt;
uint32_t read_buffer&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;BUFFER_LEN&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
uint32_t &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;flash_ptr&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;//...Example code&lt;/SPAN&gt;

flash_ptr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;uint32_t&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;destAdrss&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; i &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; BUFFER_LEN&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&amp;nbsp; i&lt;SPAN class="operator token"&gt;++&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; read_buffer&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;flash_ptr&lt;SPAN class="operator token"&gt;++&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps to clarify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards!,&lt;BR /&gt;Jorge Gonzalez&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Nov 2016 04:13:36 GMT</pubDate>
    <dc:creator>Jorge_Gonzalez</dc:creator>
    <dc:date>2016-11-15T04:13:36Z</dc:date>
    <item>
      <title>Flash driver example: Reading the flash memory</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Flash-driver-example-Reading-the-flash-memory/m-p/658226#M7140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using FRDM-KL03Z board and experimenting with the SDK 2.0 example&amp;nbsp;\frdmkl03z\driver_examples\flash\pflash.&lt;/P&gt;&lt;P&gt;The example ends at flash write and verification. I would like to read the data written to the flash. I have tried using the function "FLASH_ReadResource" but I always get an error response "kStatus_FLASH_InvalidArgument" from the function "flash_check_resource_range". Moreover there is no mention of&amp;nbsp;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;FLASH_ReadResource" in the SDK API documentation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please let me know how to read out the array written to the flash in this example.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;An early response will be much help.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2016 13:27:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Flash-driver-example-Reading-the-flash-memory/m-p/658226#M7140</guid>
      <dc:creator>gauravbanyal</dc:creator>
      <dc:date>2016-11-14T13:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Flash driver example: Reading the flash memory</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Flash-driver-example-Reading-the-flash-memory/m-p/658227#M7141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gaurav Banyal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;FLASH_ReadResource&lt;/STRONG&gt; API is for a special flash memory region called &lt;STRONG&gt;Flash&lt;/STRONG&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;STRONG&gt;IFR&lt;/STRONG&gt;. In particular for the KL03 this region includes a 64 bytes &lt;STRONG&gt;Program Once Field&lt;/STRONG&gt;. You can find details about Program Once Field in the Reference Manual.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no dedicated API for reading flash as you can simply do it with a pointer or any C code method. Following the logic of the example you could read the written data in a separate buffer like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// Extra variables to read data&lt;/SPAN&gt;
uint32_t read_buffer&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;BUFFER_LEN&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
uint32_t &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;flash_ptr&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;//...Example code&lt;/SPAN&gt;

flash_ptr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;uint32_t&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;destAdrss&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; i &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; BUFFER_LEN&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&amp;nbsp; i&lt;SPAN class="operator token"&gt;++&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; read_buffer&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;flash_ptr&lt;SPAN class="operator token"&gt;++&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps to clarify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards!,&lt;BR /&gt;Jorge Gonzalez&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Nov 2016 04:13:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Flash-driver-example-Reading-the-flash-memory/m-p/658227#M7141</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2016-11-15T04:13:36Z</dc:date>
    </item>
  </channel>
</rss>

