<?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: It is not possible to erase the MCU flash, help. :-( in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/It-is-not-possible-to-erase-the-MCU-flash-help/m-p/305221#M12929</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Marko:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you see those flash values when debugging, then FSEC = 0xFA, which means that mass erase is enabled and mcu is not secured; so do not worry, your MCU is still alive :smileyhappy:.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the questions are: What software/hardware tools and procedure are you using to try to erase the MCU? Are you trying to program the device or just a mass erase?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please provide more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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>Thu, 27 Mar 2014 17:52:17 GMT</pubDate>
    <dc:creator>Jorge_Gonzalez</dc:creator>
    <dc:date>2014-03-27T17:52:17Z</dc:date>
    <item>
      <title>It is not possible to erase the MCU flash, help. :-(</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/It-is-not-possible-to-erase-the-MCU-flash-help/m-p/305219#M12927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use a MK10DN512VLL10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't erase the memory of my MCU. But I can still debug the application through JTAG. I "played" with protection settings when this happened. I'm making a bootloader that I want to protect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The flash configuration memory from 0x400 and forward is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;0x400 = FF &lt;/P&gt;&lt;P&gt;0x401 = FF&lt;/P&gt;&lt;P&gt;0x402 = FF&lt;/P&gt;&lt;P&gt;0x403 = FF&lt;/P&gt;&lt;P&gt;0x404 = &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;FF &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;0x405 = FF &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;0x406 = FF &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;0x407 = FF &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;0x408 = FE (FPROT0) &amp;lt;---- The first part of the FLASH is protected. I think this prevents mass erase???&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;0x409 = FF (FPROT1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;0x40A = FF (FPROT2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;0x40B = FF (FPROT3)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;0x40C = FA (FSEC)&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;0x40D = FF (FOPT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;0x40E = FF (FEPROT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;0x40F = FF (FDPROT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to erase the memory in some way or do I have to replace the MCU?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2014 16:03:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/It-is-not-possible-to-erase-the-MCU-flash-help/m-p/305219#M12927</guid>
      <dc:creator>markosiponen</dc:creator>
      <dc:date>2014-03-27T16:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: It is not possible to erase the MCU flash, help. :-(</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/It-is-not-possible-to-erase-the-MCU-flash-help/m-p/305220#M12928</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;Try the following with CW - &lt;A _jive_internal="true" href="https://community.nxp.com/thread/321396" title="https://community.freescale.com/thread/321396"&gt;https://community.freescale.com/thread/321396&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hopefully it has the same option with the JTAG interface you are using... I just manged to unsecure sector 0 of a KL26 with it ;-)&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2014 17:46:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/It-is-not-possible-to-erase-the-MCU-flash-help/m-p/305220#M12928</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-03-27T17:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: It is not possible to erase the MCU flash, help. :-(</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/It-is-not-possible-to-erase-the-MCU-flash-help/m-p/305221#M12929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Marko:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you see those flash values when debugging, then FSEC = 0xFA, which means that mass erase is enabled and mcu is not secured; so do not worry, your MCU is still alive :smileyhappy:.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the questions are: What software/hardware tools and procedure are you using to try to erase the MCU? Are you trying to program the device or just a mass erase?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please provide more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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>Thu, 27 Mar 2014 17:52:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/It-is-not-possible-to-erase-the-MCU-flash-help/m-p/305221#M12929</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2014-03-27T17:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: It is not possible to erase the MCU flash, help. :-(</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/It-is-not-possible-to-erase-the-MCU-flash-help/m-p/305222#M12930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the KEIL µVision4 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I select Flash/Erase from the menu. It reply "Full Chip Erase Failed!"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried to call a function in the code I managed to download to the MCU before it got stuck. The function is used to erase a flash sector (see code snipped below). Just before calling&lt;STRONG&gt; execute_flash_command&lt;/STRONG&gt;() i changed the FTFL-&amp;gt;FCCOB0 to 0x44 (Erase All Blocks).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FSTAT{CCIF] = 1 (the command is ready)&lt;/P&gt;&lt;P&gt;FSTAT[FPVIOL] = 1 (Flash Protection Violation Flag, not good)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static uint8_t erase_flash_sector(uint32_t address)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t i;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Clear ACCERR &amp;amp; FPVIOL &amp;amp; RDCOLERR flag in flash status register&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTFL-&amp;gt;FSTAT = FTFL_FSTAT_ACCERR_MASK | FTFL_FSTAT_FPVIOL_MASK | FTFL_FSTAT_RDCOLERR_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTFL-&amp;gt;FCCOB0 = 9;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTFL-&amp;gt;FCCOB1 = address &amp;gt;&amp;gt; 16;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTFL-&amp;gt;FCCOB2 = address &amp;gt;&amp;gt; 8;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTFL-&amp;gt;FCCOB3 = address;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; execute_flash_command();&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Check error bits&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Get flash status register value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(FTFL-&amp;gt;FSTAT &amp;amp; (FTFL_FSTAT_ACCERR_MASK | FTFL_FSTAT_FPVIOL_MASK |&amp;nbsp; FTFL_FSTAT_RDCOLERR_MASK | FTFL_FSTAT_MGSTAT0_MASK))&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; // Failed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2014 21:28:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/It-is-not-possible-to-erase-the-MCU-flash-help/m-p/305222#M12930</guid>
      <dc:creator>markosiponen</dc:creator>
      <dc:date>2014-03-27T21:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: It is not possible to erase the MCU flash, help. :-(</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/It-is-not-possible-to-erase-the-MCU-flash-help/m-p/305223#M12931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Markos:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "Erase all blocks" command in code cannot be executed when one or more flash sectors are protected, so you will always have errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution is a mass-erase using an external JTAG tool or the EZPORT interface. In CodeWarrior I know about the method pointed my Mark, but I am not experienced with KEIL uVision. There should be an option to trigger a mass-erase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;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>Thu, 27 Mar 2014 23:57:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/It-is-not-possible-to-erase-the-MCU-flash-help/m-p/305223#M12931</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2014-03-27T23:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: It is not possible to erase the MCU flash, help. :-(</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/It-is-not-possible-to-erase-the-MCU-flash-help/m-p/305224#M12932</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;This is the problem that I had. Your code can (is allowed to) set protection bits from '1' to '0' in the PROT registers but not from '0' to '1'. This means that the only way to unprotect a protected region is to change the values in the Flash configuration area in Flash and then reboot. If the first region is protected this is not possible without using the mass ersase command (can only be commanded by the debugger or EZPORT).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you install CW you can do it with the flash utility by setting the connection setting to do a mass erase on connection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If using Keil you can look around to see whether they have something similar. I would however ask Keil directly because they must have a method. Please report back as to what needs to be done in that environment so that it is generally known.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Mar 2014 00:21:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/It-is-not-possible-to-erase-the-MCU-flash-help/m-p/305224#M12932</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-03-28T00:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: It is not possible to erase the MCU flash, help. :-(</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/It-is-not-possible-to-erase-the-MCU-flash-help/m-p/305225#M12933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I solved the problem. I selected "Connect: under Reset" and did not check the "Reset after Connect". Then I managed to erase the flash. :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ok.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/43358i9C9B8B4E98D328B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="ok.png" alt="ok.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Mar 2014 09:47:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/It-is-not-possible-to-erase-the-MCU-flash-help/m-p/305225#M12933</guid>
      <dc:creator>markosiponen</dc:creator>
      <dc:date>2014-03-28T09:47:42Z</dc:date>
    </item>
  </channel>
</rss>

