<?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 MK21FN1M0V12 locked in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK21FN1M0V12-locked/m-p/649396#M39490</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have locked several MK21FN1M0V12 devices because of a bad writing in internal flash. The Flash Configuration Field has been improperly set, resulting in the chip security being enabled.&lt;BR /&gt; We are working on the board with CodeWarrior for MCU v10.6 running on Windows.&lt;BR /&gt; We have tried several things but nothing succeeded. Here is a summary:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Connect a PE micro multilink device to the board and enable the "always mass erase" feature when setting the CodeWarrior connection. Everytime we try to debug, an error pop-up indicates that the connection fails&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;Define a mass erase task in the CodeWarrior "flash programmer" utility, same thing happens&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;Try the same with a JLink probe. This does not work either&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;Use JLink Commander. &lt;STRONG&gt;This is the most interesting part&lt;/STRONG&gt;:&lt;UL&gt;&lt;LI&gt;upon each connection, the tool detects the target is in secure mode and attempts to unlock it in a loop. It fails with a timeout error on halting the core&lt;/LI&gt;&lt;LI&gt;still, the tool connects to the target. some info can be retrieved (eg with hwinfo command), connection is OK but debugging is, of course, impossible&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;running the "unlock kinetis" command reports "OK" but nothing happens then &lt;/STRONG&gt; (eg running "erase" still does not work, the tool complains the core is secure...)&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;reading the MDM-AP status register&lt;/STRONG&gt; works and returns status 0x00000027 (&lt;STRONG&gt;this confirms mass erase is enabled, but also that the chip remains in reset state&lt;/STRONG&gt;)&lt;BR /&gt; to read it:&lt;BR /&gt; - swdwritedp 2 0x01000000 // selects DAP #1&lt;BR /&gt; - swdreadap 0 // dummy read&lt;BR /&gt; - swdreadap 0 // returns 0x27&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;writing 1 to the "Flash Mass Erase" bit of the MDM-AP control register does nothing&lt;/STRONG&gt;&lt;BR /&gt; to do so:&lt;BR /&gt; - swdwritedp 2 0x01000000 // selects DAP #1&lt;BR /&gt; - swdwriteap 1 1&lt;BR /&gt; no error is reported but nothing happens. Reading the MDM-AP status register does not show any difference&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Since Mass Erase is still enabled, it should be possible, theoretically, to reset the FCF.&lt;BR /&gt; It seems it fails because the core is in a "reboot" loop since garbage has been written to flash (invalid code and/or&amp;nbsp; bad stack pointer etc). Could it be that the procedure fails because the core cannot be halted?&lt;BR /&gt; Finally, there is no "reset" button on the board. Would a reset button have helped here?&lt;BR /&gt; &lt;BR /&gt; Thanks and best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Mar 2017 10:02:14 GMT</pubDate>
    <dc:creator>oliviercapron</dc:creator>
    <dc:date>2017-03-15T10:02:14Z</dc:date>
    <item>
      <title>MK21FN1M0V12 locked</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK21FN1M0V12-locked/m-p/649396#M39490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have locked several MK21FN1M0V12 devices because of a bad writing in internal flash. The Flash Configuration Field has been improperly set, resulting in the chip security being enabled.&lt;BR /&gt; We are working on the board with CodeWarrior for MCU v10.6 running on Windows.&lt;BR /&gt; We have tried several things but nothing succeeded. Here is a summary:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Connect a PE micro multilink device to the board and enable the "always mass erase" feature when setting the CodeWarrior connection. Everytime we try to debug, an error pop-up indicates that the connection fails&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;Define a mass erase task in the CodeWarrior "flash programmer" utility, same thing happens&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;Try the same with a JLink probe. This does not work either&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;Use JLink Commander. &lt;STRONG&gt;This is the most interesting part&lt;/STRONG&gt;:&lt;UL&gt;&lt;LI&gt;upon each connection, the tool detects the target is in secure mode and attempts to unlock it in a loop. It fails with a timeout error on halting the core&lt;/LI&gt;&lt;LI&gt;still, the tool connects to the target. some info can be retrieved (eg with hwinfo command), connection is OK but debugging is, of course, impossible&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;running the "unlock kinetis" command reports "OK" but nothing happens then &lt;/STRONG&gt; (eg running "erase" still does not work, the tool complains the core is secure...)&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;reading the MDM-AP status register&lt;/STRONG&gt; works and returns status 0x00000027 (&lt;STRONG&gt;this confirms mass erase is enabled, but also that the chip remains in reset state&lt;/STRONG&gt;)&lt;BR /&gt; to read it:&lt;BR /&gt; - swdwritedp 2 0x01000000 // selects DAP #1&lt;BR /&gt; - swdreadap 0 // dummy read&lt;BR /&gt; - swdreadap 0 // returns 0x27&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;writing 1 to the "Flash Mass Erase" bit of the MDM-AP control register does nothing&lt;/STRONG&gt;&lt;BR /&gt; to do so:&lt;BR /&gt; - swdwritedp 2 0x01000000 // selects DAP #1&lt;BR /&gt; - swdwriteap 1 1&lt;BR /&gt; no error is reported but nothing happens. Reading the MDM-AP status register does not show any difference&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Since Mass Erase is still enabled, it should be possible, theoretically, to reset the FCF.&lt;BR /&gt; It seems it fails because the core is in a "reboot" loop since garbage has been written to flash (invalid code and/or&amp;nbsp; bad stack pointer etc). Could it be that the procedure fails because the core cannot be halted?&lt;BR /&gt; Finally, there is no "reset" button on the board. Would a reset button have helped here?&lt;BR /&gt; &lt;BR /&gt; Thanks and best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 10:02:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK21FN1M0V12-locked/m-p/649396#M39490</guid>
      <dc:creator>oliviercapron</dc:creator>
      <dc:date>2017-03-15T10:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: MK21FN1M0V12 locked</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK21FN1M0V12-locked/m-p/649397#M39491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi olivier capron,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; If the chip mass erase still enabled, the chip can do the mass erase, then you can unlock it.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Now, please use the JLINK debugger with the JLINK commander window, follow my step:&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/16384i3D129EDD87195C3A/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;1. connect the chip, choose the correct part number.&lt;/P&gt;&lt;P&gt;2. input: unlock kinetis&lt;/P&gt;&lt;P&gt;Wait the unlocking device is ok&lt;/P&gt;&lt;P&gt;3. input:r&lt;/P&gt;&lt;P&gt;to reset the chip.&lt;/P&gt;&lt;P&gt;4.input:mem 0x400,0x10&lt;/P&gt;&lt;P&gt;Just to check the flash configuration field, to check the flash data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please follow my step, and post your result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Kerry&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, 16 Mar 2017 06:17:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK21FN1M0V12-locked/m-p/649397#M39491</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2017-03-16T06:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: MK21FN1M0V12 locked</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK21FN1M0V12-locked/m-p/649398#M39492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thank you for your support.&lt;/P&gt;&lt;P&gt;Unfortunately, as mentioned in our question, we already had tried this without success. Please find attached a capture showing the result.&lt;/P&gt;&lt;P&gt;As already explained, we tried to manually trigger a mass erase using the MDM-AP Control register, which is accessible. But the mass erase does not occur. It seems that the core is constantly resetting and thus cannot perform the erase. What do you think?&lt;/P&gt;&lt;P&gt;Thanks and best regards,&lt;span class="lia-inline-image-display-wrapper" image-alt="kinetis_locked.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/18958iACE1BB8DA12CB5D7/image-size/large?v=v2&amp;amp;px=999" role="button" title="kinetis_locked.PNG" alt="kinetis_locked.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 15:53:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK21FN1M0V12-locked/m-p/649398#M39492</guid>
      <dc:creator>oliviercapron</dc:creator>
      <dc:date>2017-03-16T15:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: MK21FN1M0V12 locked</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK21FN1M0V12-locked/m-p/649399#M39493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi oliver capron,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Please refer to this question post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/441479"&gt;K22 RESET line: Is a pull-up and a cap required?&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; There has a document about the lock, check that document, whether you&amp;nbsp; meet the according requirement at first?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&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>Fri, 17 Mar 2017 03:16:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK21FN1M0V12-locked/m-p/649399#M39493</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2017-03-17T03:16:19Z</dc:date>
    </item>
  </channel>
</rss>

