<?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: Why does my MK02F12810 security not work? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921942#M53804</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry&lt;/P&gt;&lt;P&gt;The unsecured version (when FSEC = 0xFE) of the application works perfectly without any issues.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Oct 2019 13:25:15 GMT</pubDate>
    <dc:creator>atilla</dc:creator>
    <dc:date>2019-10-17T13:25:15Z</dc:date>
    <item>
      <title>Why does my MK02F12810 security not work?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921938#M53800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I made the following change to my&amp;nbsp;&amp;nbsp; devices/MK02F12810/gcc/startup_MK02F12810.S:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .section .FlashConfig, "a"&lt;BR /&gt;#ifdef DEBUG&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFE&lt;BR /&gt;#else&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFF4&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can confirm that the MCU is secured, as when I try to reflash, I have to ask for a mass erase, block erase doesn't work, as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The unexpected part is, when I make a "release" build, the MCU doesn't start up. It doesn't give any life signs.&lt;/P&gt;&lt;P&gt;When I do a release build with the security bytes 0xFE, everything works as expected.&lt;/P&gt;&lt;P&gt;Where can I have a look? What might be wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2019 08:31:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921938#M53800</guid>
      <dc:creator>atilla</dc:creator>
      <dc:date>2019-10-15T08:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my MK02F12810 security not work?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921939#M53801</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;What happens if you try 0xffffffff instead of 0xfffffff4?&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>Tue, 15 Oct 2019 19:47:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921939#M53801</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2019-10-15T19:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my MK02F12810 security not work?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921940#M53802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;0xffffffff also locks up. I would debug but the point of enabling security is disabling the debug port.&lt;/P&gt;&lt;P&gt;We are using SDK 2.3 for gcc on Linux.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Oct 2019 12:11:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921940#M53802</guid>
      <dc:creator>atilla</dc:creator>
      <dc:date>2019-10-16T12:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my MK02F12810 security not work?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921941#M53803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-content-finding="Community" data-userid="340052" data-username="atilla@contentwise.info" href="https://community.nxp.com/people/atilla@contentwise.info"&gt;Atilla Filiz&lt;/A&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Please try the unsecured release version, whether that works or not?&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- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2019 11:47:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921941#M53803</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2019-10-17T11:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my MK02F12810 security not work?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921942#M53804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry&lt;/P&gt;&lt;P&gt;The unsecured version (when FSEC = 0xFE) of the application works perfectly without any issues.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2019 13:25:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921942#M53804</guid>
      <dc:creator>atilla</dc:creator>
      <dc:date>2019-10-17T13:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my MK02F12810 security not work?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921943#M53805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class=""&gt;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="340052" data-username="atilla@contentwise.info" href="https://community.nxp.com/people/atilla@contentwise.info"&gt;Atilla Filiz&lt;/A&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you for your updated information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; What's the IDE you are using? You can change the IDE optimization, not set it to the highest in the release version, then try it again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Any updated test result, please kindly let me know.&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2019 02:20:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921943#M53805</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2019-10-18T02:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my MK02F12810 security not work?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921944#M53806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are not using any IDE. We tried gcc 6.3.1 and 7.3.1&lt;/P&gt;&lt;P&gt;We normally compile with -Os optimization. I removed the optimization flag, and it still behaved exactly the same. Here are the other flags&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CPUFLAGS := -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CFLAGS&amp;nbsp;&amp;nbsp; := -DCPU_MK02FN64VLH10 -DFSL_RTOS_BM -DSDK_DEBUGCONSOLE=0 \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -DUSE_STRICT_SBRK=1 -DDEBUG -g -Wall -fmessage-length=0 \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -fsigned-char -funsigned-bitfields -ffunction-sections \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -fdata-sections -fno-common -ffreestanding -flto&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Removing -flto did not fix the issue either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2019 13:33:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921944#M53806</guid>
      <dc:creator>atilla</dc:creator>
      <dc:date>2019-10-22T13:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my MK02F12810 security not work?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921945#M53807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Atilla&lt;/P&gt;&lt;P&gt;I propose you do the following:&lt;/P&gt;&lt;P&gt;1. In you application have a function that you can call to print out the flash config bytes in Flash so that you are sure what is programmed there.&lt;/P&gt;&lt;P&gt;2. Make a version with the security byte set to 0xfe so that it runs.&lt;/P&gt;&lt;P&gt;3. Add a command to allow you to change the security value during run time as follows:&lt;BR /&gt;- Copy the content of the first Flash sector to a RAM buffer&lt;BR /&gt;- Disable interrupts&lt;BR /&gt;- Erase the first sector&lt;BR /&gt;- Modify the value of the security byte in the RAM buffer to add the security setting you wish to have&lt;BR /&gt;- Program the RAM buffer back to the first sector if Flash&lt;BR /&gt;- Re-enable interrupts&lt;BR /&gt;- Use the first command to read back the vale that is programmed to be absolutely sure&lt;BR /&gt;(make sure the code controlling the programming is not in the first sector so that it can operate normally)&lt;BR /&gt;&lt;BR /&gt;Presently the security is not yet active but the program will be operating&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Reset the board and if it runs check the programmed value again with the first command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this works it points to a debugger/programmer problem that doesn't allow programming the security byte as desired and caused other issues in the process. I have had similar things with certain security values that I had to avoid using.&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>Tue, 22 Oct 2019 14:55:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921945#M53807</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2019-10-22T14:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my MK02F12810 security not work?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921946#M53808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I put the test you mentioned on hold due to the effort it takes, it is definitely something I need to test in the future.&lt;/P&gt;&lt;P&gt;However, I did a simpler test. Instead of using pyocd + a CMSIS-DAP debug probe (A FRDM-k22f board), I used a PEMicro Cyclone to flash the image. With PEMicro, the device indeed works in secure mode as intended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/mjbcswitzerland"&gt;mjbcswitzerland&lt;/A&gt; &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/kerryzhou"&gt;kerryzhou&lt;/A&gt; If you have any ideas what might be wrong with my probe or pyocd, I would love to hear.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2019 11:42:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-does-my-MK02F12810-security-not-work/m-p/921946#M53808</guid>
      <dc:creator>atilla</dc:creator>
      <dc:date>2019-10-23T11:42:03Z</dc:date>
    </item>
  </channel>
</rss>

