<?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: How to read data from internal flash by using C90TFS library in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-read-data-from-internal-flash-by-using-C90TFS-library/m-p/427171#M2369</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding your question, as you know that the ARM architecture uses the normalized address space for the program/data flash, SRAM and peripheral, special commands are required to erase/program flash, but you can read a flash address as you read a RAM address.&lt;/P&gt;&lt;P&gt;you can read flash or RAM using the following macro based on the data width you access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;#define READ8(address)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;((uint8_t)(*(vuint8_t*)(address)))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;#define READ16(address)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;((uint16_t)(*(vuint16_t*)(address)))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;#define READ32(address)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;((uint32_t)(*(vuint32_t*)(address)))&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;for example, you can use the following code to access flash no matter whether the flash save data or code.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;uint16_t value, i, *pSrc, *pDest;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;pSrc=0xxxxxxxx;&lt;/P&gt;&lt;P&gt;value=READ16(pSrc);&lt;/P&gt;&lt;P&gt;pSrc++;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Nov 2015 07:17:08 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2015-11-26T07:17:08Z</dc:date>
    <item>
      <title>How to read data from internal flash by using C90TFS library</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-read-data-from-internal-flash-by-using-C90TFS-library/m-p/427170#M2368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to read data from Pflash and Dflash from MK20DX256 by using C90TFS library in KSDK 1.3. &lt;/P&gt;&lt;P&gt;But I cannot find read function in the library. Then how do you guys read data from the flash?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2015 14:58:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-read-data-from-internal-flash-by-using-C90TFS-library/m-p/427170#M2368</guid>
      <dc:creator>alexshephard</dc:creator>
      <dc:date>2015-11-20T14:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data from internal flash by using C90TFS library</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-read-data-from-internal-flash-by-using-C90TFS-library/m-p/427171#M2369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding your question, as you know that the ARM architecture uses the normalized address space for the program/data flash, SRAM and peripheral, special commands are required to erase/program flash, but you can read a flash address as you read a RAM address.&lt;/P&gt;&lt;P&gt;you can read flash or RAM using the following macro based on the data width you access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;#define READ8(address)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;((uint8_t)(*(vuint8_t*)(address)))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;#define READ16(address)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;((uint16_t)(*(vuint16_t*)(address)))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;#define READ32(address)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;((uint32_t)(*(vuint32_t*)(address)))&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;for example, you can use the following code to access flash no matter whether the flash save data or code.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;uint16_t value, i, *pSrc, *pDest;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;pSrc=0xxxxxxxx;&lt;/P&gt;&lt;P&gt;value=READ16(pSrc);&lt;/P&gt;&lt;P&gt;pSrc++;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 07:17:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-read-data-from-internal-flash-by-using-C90TFS-library/m-p/427171#M2369</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2015-11-26T07:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data from internal flash by using C90TFS library</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-read-data-from-internal-flash-by-using-C90TFS-library/m-p/427172#M2370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was trying for several hours to read program flash using the FlashReadResource() function.&amp;nbsp; After reading this post I tried the READ32() macro, and it just worked.&amp;nbsp; Yay!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sidenote:&lt;/P&gt;&lt;P&gt;It's strange to me that the C90TFS library has 2 functions to read the P-Flash IFR(FlashReadResource, and ReadOnce), but neither can read the basic program flash.&amp;nbsp; If you try to pass in an absolute address, e.g. 0x7E000 for a 512KB MKW2x chip, the FlashReadResource function will return an access error (ACCERR).&amp;nbsp; After lots of reading I realized that the access error is because these functions are only supposed to access IFR memory (see Table 35-44 of the MKW2x reference manual for valid local address ranges).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the info XiangJun Rong!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2016 20:22:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-read-data-from-internal-flash-by-using-C90TFS-library/m-p/427172#M2370</guid>
      <dc:creator>calebrust</dc:creator>
      <dc:date>2016-05-17T20:22:47Z</dc:date>
    </item>
  </channel>
</rss>

