<?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 Flash Access Error Flag when running FTFE flash erase command on K60. in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Access-Error-Flag-when-running-FTFE-flash-erase-command-on/m-p/411331#M23265</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote a flash driver and it works fine&amp;nbsp; on K70 cpus . &lt;/P&gt;&lt;P&gt;Flash erase works fine and flash programming works fine.&lt;/P&gt;&lt;P&gt;Flash erase starts from address 0x20000 and goes to the end of the flash (1MB for K70) erasing 4kB sector at the time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, same code, on K60 cpu, does not work. &lt;/P&gt;&lt;P&gt;When first flash sector erase command is invoked to start erasing from address 0x20000 I get Flash Access Error Flag. &lt;/P&gt;&lt;P&gt;Strange thing is that if I break (breakpoint, IAR) before erase command is invoked, than erase command runs successfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What could be causing this? Does anyone have any idea?&lt;/P&gt;&lt;P&gt;I appreciate any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Sep 2015 14:59:57 GMT</pubDate>
    <dc:creator>boci</dc:creator>
    <dc:date>2015-09-25T14:59:57Z</dc:date>
    <item>
      <title>Flash Access Error Flag when running FTFE flash erase command on K60.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Access-Error-Flag-when-running-FTFE-flash-erase-command-on/m-p/411331#M23265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote a flash driver and it works fine&amp;nbsp; on K70 cpus . &lt;/P&gt;&lt;P&gt;Flash erase works fine and flash programming works fine.&lt;/P&gt;&lt;P&gt;Flash erase starts from address 0x20000 and goes to the end of the flash (1MB for K70) erasing 4kB sector at the time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, same code, on K60 cpu, does not work. &lt;/P&gt;&lt;P&gt;When first flash sector erase command is invoked to start erasing from address 0x20000 I get Flash Access Error Flag. &lt;/P&gt;&lt;P&gt;Strange thing is that if I break (breakpoint, IAR) before erase command is invoked, than erase command runs successfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What could be causing this? Does anyone have any idea?&lt;/P&gt;&lt;P&gt;I appreciate any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2015 14:59:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Access-Error-Flag-when-running-FTFE-flash-erase-command-on/m-p/411331#M23265</guid>
      <dc:creator>boci</dc:creator>
      <dc:date>2015-09-25T14:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Access Error Flag when running FTFE flash erase command on K60.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Access-Error-Flag-when-running-FTFE-flash-erase-command-on/m-p/411332#M23266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update.&lt;/P&gt;&lt;P&gt;So I found out that on K60, the FTFE_FCCOB registers are not being set correctly. &lt;/P&gt;&lt;P&gt;If I break before the registers are to be set and step through it than the registers get set correctly. &lt;/P&gt;&lt;P&gt;If I break after registers are being set than they are set incorrectly and thus the &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Flash Access Error Flag&lt;/SPAN&gt; . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What could be causing this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code that sets the registers.&amp;nbsp; 'startAddress' is the address that I am passing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*(volatile uint8_t *)&amp;amp;FTFE_FCCOB0 = (uint8_t)FLASH_CMD_SECTOR_ERASE;&lt;/P&gt;&lt;P&gt;*(volatile uint8_t *)&amp;amp;FTFE_FCCOB1 = (uint8_t)(startAddress &amp;gt;&amp;gt; 16);&lt;/P&gt;&lt;P&gt;*(volatile uint8_t *)&amp;amp;FTFE_FCCOB2 = (uint8_t)((startAddress &amp;gt;&amp;gt; 8) &amp;amp; 0xFF);&lt;/P&gt;&lt;P&gt;*(volatile uint8_t *)&amp;amp;FTFE_FCCOB3 = (uint8_t)(startAddress &amp;amp; 0xFF);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be great.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2015 15:37:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Access-Error-Flag-when-running-FTFE-flash-erase-command-on/m-p/411332#M23266</guid>
      <dc:creator>boci</dc:creator>
      <dc:date>2015-09-25T15:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Access Error Flag when running FTFE flash erase command on K60.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Access-Error-Flag-when-running-FTFE-flash-erase-command-on/m-p/411333#M23267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Boci Nik:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the full part number of your K60? And the mask (below part number)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That behavior sounds very strange. If possible please attach your project so I can give it a check from my side.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 20:12:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Access-Error-Flag-when-running-FTFE-flash-erase-command-on/m-p/411333#M23267</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-09-29T20:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Access Error Flag when running FTFE flash erase command on K60.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Access-Error-Flag-when-running-FTFE-flash-erase-command-on/m-p/411334#M23268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jorge, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for replying and offering help. &lt;/P&gt;&lt;P&gt;Here is the full part number for K60 CPU -&amp;nbsp; MK60FX512VLQ12 .&amp;nbsp; The code in the message above does NOT work with this CPU. &lt;/P&gt;&lt;P&gt;However, the same code works on K70 CPU, part number MK70FN1M0VMJ12. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, to make it work on K60 also, I put in while loops. Here is the modified code that works on both CPUs. &lt;/P&gt;&lt;P&gt;If you guys can explain why I need this for K60, that would be great. I curious to know what is the reason. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(FTFE_FCCOB0 !=(uint8_t)FLASH_CMD_SECTOR_ERASE)&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; *(volatile uint8_t *)&amp;amp;FTFE_FCCOB0 = (uint8_t)FLASH_CMD_SECTOR_ERASE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(FTFE_FCCOB1 != (uint8_t)(startAddress &amp;gt;&amp;gt; 16))&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; *(volatile uint8_t *)&amp;amp;FTFE_FCCOB1 = (uint8_t)(startAddress &amp;gt;&amp;gt; 16);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(FTFE_FCCOB2 != (uint8_t)((startAddress &amp;gt;&amp;gt; 8) &amp;amp; 0xFF))&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; *(volatile uint8_t *)&amp;amp;FTFE_FCCOB2 = (uint8_t)((startAddress &amp;gt;&amp;gt; 8) &amp;amp; 0xFF);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(FTFE_FCCOB3 != (uint8_t)(startAddress &amp;amp; 0xFF))&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; *(volatile uint8_t *)&amp;amp;FTFE_FCCOB3 = (uint8_t)(startAddress &amp;amp; 0xFF);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 16:46:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Access-Error-Flag-when-running-FTFE-flash-erase-command-on/m-p/411334#M23268</guid>
      <dc:creator>boci</dc:creator>
      <dc:date>2015-10-01T16:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Access Error Flag when running FTFE flash erase command on K60.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Access-Error-Flag-when-running-FTFE-flash-erase-command-on/m-p/411335#M23269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Boci Nik:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have never seen such issue before, but I wonder if it is caused by a memory serialization problem. See the next document about this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-95210"&gt;Serialization of memory operations and events&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then instead of a while loop you can try with a simple read from the FCCOBx registers AFTER each write instruction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Oct 2015 02:58:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Access-Error-Flag-when-running-FTFE-flash-erase-command-on/m-p/411335#M23269</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-10-03T02:58:17Z</dc:date>
    </item>
  </channel>
</rss>

