<?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 write data flash in K40? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-data-flash-in-K40/m-p/276325#M9934</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, the 24 bit Flash internal address Flash address bit [23] indicate the program Flash block is program flash block or data flash block. If customer want to program data flash, it just need to add 0x800000 with converted FTFL internal flash address. More detailed info, please check below code:&lt;/P&gt;&lt;P&gt;/* check for valid range of the target addresses */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if((endAddress &amp;gt;= PSSDConfig-&amp;gt;PFlashBlockBase) &amp;amp;&amp;amp; \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (endAddress &amp;lt;= (PSSDConfig-&amp;gt;PFlashBlockBase + BYTE2WORD(PSSDConfig-&amp;gt;PFlashBlockSize))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Convert System memory address to FTFx internal memory address */&lt;/P&gt;&lt;P&gt;#if DSC_56800EX == CPU_CORE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; destination = (2*(destination - PSSDConfig-&amp;gt;PFlashBlockBase));&lt;/P&gt;&lt;P&gt;#else&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; destination -= PSSDConfig-&amp;gt;PFlashBlockBase;&lt;/P&gt;&lt;P&gt;#endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sectionAlign = PPGMSEC_ALIGN_SIZE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if((endAddress &amp;gt;= PSSDConfig-&amp;gt;DFlashBlockBase) || \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (endAddress &amp;lt;= (PSSDConfig-&amp;gt;DFlashBlockBase + BYTE2WORD(PSSDConfig-&amp;gt;DFlashBlockSize))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Convert System memory address to FTFx internal memory address */&lt;/P&gt;&lt;P&gt;#if DSC_56800EX == CPU_CORE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; destination = (2*(destination - PSSDConfig-&amp;gt;DFlashBlockBase)+ 0x800000);&lt;/P&gt;&lt;P&gt;#else&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;destination = destination - PSSDConfig-&amp;gt;DFlashBlockBase + 0x800000;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;#endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sectionAlign = DPGMSEC_ALIGN_SIZE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else /* end address does not fall within Pflash or Dflash range */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* return an error code FTFx_ERR_RANGE */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; returnCode = FTFx_ERR_RANGE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; goto EXIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Customer could dowload Kinetis Flash driver from below link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/32bit/software/C90TFS_FLASH_DRIVER.exe"&gt;http://cache.freescale.com/files/32bit/software/C90TFS_FLASH_DRIVER.exe&lt;/A&gt;&lt;BR /&gt;Wish it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Jul 2013 03:36:32 GMT</pubDate>
    <dc:creator>Hui_Ma</dc:creator>
    <dc:date>2013-07-17T03:36:32Z</dc:date>
    <item>
      <title>How to write data flash in K40?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-data-flash-in-K40/m-p/276324#M9933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do I write data flash when FTFL_FCCOBn only provides 24-bits of address, and data flash is at 0x1000_0000?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a bare metal bootloader that needs to access three sectors of data flash, which start at 0x1000_0000.&lt;/P&gt;&lt;P&gt;The K40 reference manual&amp;nbsp; says that the FTFL_CCOBn registers are used to write to program and data flash.&lt;/P&gt;&lt;P&gt;These registers work fine for program flash, but since FTFL_CCOB0 has 8-bits for the command and only 24-bits&lt;/P&gt;&lt;P&gt;for address, it cannot access data flash properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the correct method to write to data flash on a bare metal embedded system?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don dT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 22:01:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-data-flash-in-K40/m-p/276324#M9933</guid>
      <dc:creator>donden</dc:creator>
      <dc:date>2013-07-16T22:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to write data flash in K40?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-data-flash-in-K40/m-p/276325#M9934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, the 24 bit Flash internal address Flash address bit [23] indicate the program Flash block is program flash block or data flash block. If customer want to program data flash, it just need to add 0x800000 with converted FTFL internal flash address. More detailed info, please check below code:&lt;/P&gt;&lt;P&gt;/* check for valid range of the target addresses */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if((endAddress &amp;gt;= PSSDConfig-&amp;gt;PFlashBlockBase) &amp;amp;&amp;amp; \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (endAddress &amp;lt;= (PSSDConfig-&amp;gt;PFlashBlockBase + BYTE2WORD(PSSDConfig-&amp;gt;PFlashBlockSize))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Convert System memory address to FTFx internal memory address */&lt;/P&gt;&lt;P&gt;#if DSC_56800EX == CPU_CORE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; destination = (2*(destination - PSSDConfig-&amp;gt;PFlashBlockBase));&lt;/P&gt;&lt;P&gt;#else&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; destination -= PSSDConfig-&amp;gt;PFlashBlockBase;&lt;/P&gt;&lt;P&gt;#endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sectionAlign = PPGMSEC_ALIGN_SIZE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if((endAddress &amp;gt;= PSSDConfig-&amp;gt;DFlashBlockBase) || \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (endAddress &amp;lt;= (PSSDConfig-&amp;gt;DFlashBlockBase + BYTE2WORD(PSSDConfig-&amp;gt;DFlashBlockSize))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Convert System memory address to FTFx internal memory address */&lt;/P&gt;&lt;P&gt;#if DSC_56800EX == CPU_CORE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; destination = (2*(destination - PSSDConfig-&amp;gt;DFlashBlockBase)+ 0x800000);&lt;/P&gt;&lt;P&gt;#else&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;destination = destination - PSSDConfig-&amp;gt;DFlashBlockBase + 0x800000;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;#endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sectionAlign = DPGMSEC_ALIGN_SIZE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else /* end address does not fall within Pflash or Dflash range */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* return an error code FTFx_ERR_RANGE */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; returnCode = FTFx_ERR_RANGE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; goto EXIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Customer could dowload Kinetis Flash driver from below link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/32bit/software/C90TFS_FLASH_DRIVER.exe"&gt;http://cache.freescale.com/files/32bit/software/C90TFS_FLASH_DRIVER.exe&lt;/A&gt;&lt;BR /&gt;Wish it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2013 03:36:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-data-flash-in-K40/m-p/276325#M9934</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2013-07-17T03:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to write data flash in K40?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-data-flash-in-K40/m-p/276326#M9935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;Thank you!&amp;nbsp; I knew there must be some little trick to make this work.&amp;nbsp; This has resolved my problem.&amp;nbsp; :-)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;I didn’t notice this in the documentation.&amp;nbsp; I was using the K40P144M100SF2RM Reference Manual, mainly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2013 21:17:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-data-flash-in-K40/m-p/276326#M9935</guid>
      <dc:creator>donden</dc:creator>
      <dc:date>2013-07-17T21:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to write data flash in K40?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-data-flash-in-K40/m-p/276327#M9936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any initiative to put this in documentation, specifically the reference manuals? A year later, I still do not see this anywhere in K60P144M150SF3RM either, which probably means it is not included in the common manual section that keeps getting pasted into many Kinetis reference manuals. Seems a like a pretty important thing to include.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 18:54:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-data-flash-in-K40/m-p/276327#M9936</guid>
      <dc:creator>dmitriyc</dc:creator>
      <dc:date>2015-07-30T18:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to write data flash in K40?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-data-flash-in-K40/m-p/276328#M9937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe that the details have always been there:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/54546iE69B79EDAD0B5E14/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kinetis: &lt;A href="http://www.utasker.com/kinetis.html" title="http://www.utasker.com/kinetis.html"&gt;µTasker Kinetis support&lt;/A&gt; &lt;/P&gt;&lt;P&gt;K60: &lt;A href="http://www.utasker.com/kinetis/TWR-K60N512.html" title="http://www.utasker.com/kinetis/TWR-K60N512.html"&gt;µTasker Kinetis TWR-K60N512 support&lt;/A&gt;&amp;nbsp; / &lt;A href="http://www.utasker.com/kinetis/TWR-K60D100M.html" title="http://www.utasker.com/kinetis/TWR-K60D100M.html"&gt;µTasker Kinetis TWR-K60D100M support&lt;/A&gt;&amp;nbsp; / &lt;A href="http://www.utasker.com/kinetis/TWR-K60F120M.html" title="http://www.utasker.com/kinetis/TWR-K60F120M.html"&gt;µTasker Kinetis TWR-K60F120M support&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;EM&gt;For the complete "out-of-the-box" Kinetis experience and faster time to market&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 20:28:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-data-flash-in-K40/m-p/276328#M9937</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-07-30T20:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to write data flash in K40?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-data-flash-in-K40/m-p/276329#M9938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Haha. Got me. Maybe if I had read that chapter three &lt;EM&gt;more&lt;/EM&gt; times I would have noticed that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/54359i8861824B896AC5DB/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for pointing that out. You don't have to call a "wambulance" to come pick me up. Yes technically it's there... technically. *sigh*&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 20:53:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-data-flash-in-K40/m-p/276329#M9938</guid>
      <dc:creator>dmitriyc</dc:creator>
      <dc:date>2015-07-30T20:53:53Z</dc:date>
    </item>
  </channel>
</rss>

