<?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>Kinetis MicrocontrollersのトピックRe: secured MKL05 immediately self-destructs when trying to connect to it with j-link</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/secured-MKL05-immediately-self-destructs-when-trying-to-connect/m-p/456836#M27238</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good to know Bernd!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for sharing your finding, this may help others.&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>Mon, 07 Sep 2015 21:09:18 GMT</pubDate>
    <dc:creator>Jorge_Gonzalez</dc:creator>
    <dc:date>2015-09-07T21:09:18Z</dc:date>
    <item>
      <title>secured MKL05 immediately self-destructs when trying to connect to it with j-link</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/secured-MKL05-immediately-self-destructs-when-trying-to-connect/m-p/456833#M27235</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;(Ok, it does not really destruct itself, only the contents of its memories).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure whether this is a Kinetis feature or whether I should ask in the SEGGER forum because I cannot find any references to that behavior in any of the documentation. The observed behavior is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(A) programming with flash security bytes at 0x400 set to 0xffffffff ffffffff ffffffff fffffffe in the .bin file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- I can program the flash&lt;/P&gt;&lt;P&gt;- The program runs as intended&lt;/P&gt;&lt;P&gt;- I can debug with J-Link&lt;/P&gt;&lt;P&gt;- I can read out any memory area with jlink commander or with SEGGER's J-Mem tool&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(B) programming with flash security bytes set to 0xffffffff ffffffff ffffffff ffffffff in the .bin file (If I understood it correctly this means mass erase is still allowed but reading back the flash with SWD is not)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- I can program the flash&lt;/P&gt;&lt;P&gt;- The program runs as intended, everything is fine, I can even use my own bootloader to update the firmware&lt;/P&gt;&lt;P&gt;- any attempt to connect with J-Link (just connect, not even trying to read) results in an immediate and complete chip erase without any prior warning or notice. It reads all flash memory as 0xff except that single one byte in the flash security area that reads as 0xfe, any trace of my program is gone (and it is really gone because neither my application nor my bootloader will run anymore, it basically instantly self-destructs when attempting to connect with J-Link)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is how I connect to trigger the behavior:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Contents of jlink_readout_test.txt:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;mem32 0x400 8&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this is when I execute it&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;&amp;gt;"C:\Program Files (x86)\SEGGER\JLink\JLink.exe" -Device "MKL05Z32XXX4" -C&lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;ommandFile jlink_readout_test.txt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;SEGGER J-Link Commander V5.00i ('?' for help)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Compiled Jul 10 2015 18:28:50&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Script file read successfully.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: Device "MKL05Z32XXX4" selected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;DLL version V5.00i, compiled Jul 10 2015 18:28:14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Firmware: J-Link ARM V8 compiled Nov 28 2014 13:44:46&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Hardware: V8.00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;S/N: 268004727&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;OEM: SEGGER-EDU&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Feature(s): FlashBP, GDB&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Emulator has Trace capability&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;VTarget = 3.287V&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: TotalIRLen = ?, IRPrint = 0x..000000000000000000000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: TotalIRLen = ?, IRPrint = 0x..000000000000000000000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: TotalIRLen = ?, IRPrint = 0x..000000000000000000000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: TotalIRLen = ?, IRPrint = 0x..000000000000000000000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: TotalIRLen = ?, IRPrint = 0x..000000000000000000000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: TotalIRLen = ?, IRPrint = 0x..000000000000000000000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: TotalIRLen = ?, IRPrint = 0x..000000000000000000000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: TotalIRLen = ?, IRPrint = 0x..000000000000000000000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;No devices found on JTAG chain. Trying to find device on SWD.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: Found SWD-DP with ID 0x0BC11477&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: Found SWD-DP with ID 0x0BC11477&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: Found Cortex-M0 r0p0, Little endian.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: FPUnit: 2 code (BP) slots and 0 literal slots&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: CoreSight components:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: ROMTbl 0 @ F0002000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: ROMTbl 0 [0]: FFFFE000, CID: B105900D, PID: 000BB932 MTB-M0+&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: ROMTbl 0 [1]: FFFFF000, CID: B105900D, PID: 0008E000 MTBDWT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: ROMTbl 0 [2]: F00FD000, CID: B105100D, PID: 000BB4C0 ROM Table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: ROMTbl 1 @ E00FF000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: ROMTbl 1 [0]: FFF0F000, CID: B105E00D, PID: 000BB008 SCS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: ROMTbl 1 [1]: FFF02000, CID: B105E00D, PID: 000BB00A DWT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Info: ROMTbl 1 [2]: FFF03000, CID: B105E00D, PID: 000BB00B FPB&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Cortex-M0 identified.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Target interface speed: 100 kHz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Processing script file...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;00000400 = FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;00000410 = FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;Script processing completed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3a0699;"&gt;J-Link&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see in the 0x410 line it really erased the chip, there would be the beginning of the .text section and it is completely empty. I would have expected an error message that it cannot be read because the chip is secured but the fact that the jlink commander does not print a single line about this in the console led me to believe that this *might* be a feature that is built into the hardware itself and happens automatically. But I cannot find any references to such behavior in the documentation, neither Kinetis nor SEGGER nor elsewhere in the forums on the www.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this a Kinetis feature or should I ask in the SEGGER forum?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 07:29:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/secured-MKL05-immediately-self-destructs-when-trying-to-connect/m-p/456833#M27235</guid>
      <dc:creator>prof7bit</dc:creator>
      <dc:date>2015-08-21T07:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: secured MKL05 immediately self-destructs when trying to connect to it with j-link</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/secured-MKL05-immediately-self-destructs-when-trying-to-connect/m-p/456834#M27236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Bernd K:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Kinetis MCU does not have such feature. When a device is secured the way to recover external access is with a Mass Erase, but it has to be triggered either internally by the MCU's programmed code (which I assume is not your case) or externally with EzPort or the JTAG/SWD tool itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The application note &lt;STRONG&gt;AN4507&lt;/STRONG&gt; contains very interesting information about security options in Kinetis:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4507.pdf" title="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4507.pdf"&gt;http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4507.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The behavior you see must be caused by the JLink.exe software or the Segger J-Link tool. I think you can get more precise help from Segger forum.&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>Mon, 24 Aug 2015 17:50:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/secured-MKL05-immediately-self-destructs-when-trying-to-connect/m-p/456834#M27236</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-08-24T17:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: secured MKL05 immediately self-destructs when trying to connect to it with j-link</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/secured-MKL05-immediately-self-destructs-when-trying-to-connect/m-p/456835#M27237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found it. It was indeed the SEGGER software, it has one of these "never ask me this question again" checkboxes (without any config dialog to turn it off again) in one of their tools and when checked this wil make *ALL* segger tools *always* immediately and silently mass erase any chip on connect as soon as it detects the chip is secured.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2015 09:16:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/secured-MKL05-immediately-self-destructs-when-trying-to-connect/m-p/456835#M27237</guid>
      <dc:creator>prof7bit</dc:creator>
      <dc:date>2015-09-07T09:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: secured MKL05 immediately self-destructs when trying to connect to it with j-link</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/secured-MKL05-immediately-self-destructs-when-trying-to-connect/m-p/456836#M27238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good to know Bernd!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for sharing your finding, this may help others.&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>Mon, 07 Sep 2015 21:09:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/secured-MKL05-immediately-self-destructs-when-trying-to-connect/m-p/456836#M27238</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-09-07T21:09:18Z</dc:date>
    </item>
  </channel>
</rss>

