<?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: Securing K22 Code in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832538#M50366</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Christopher&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;__FlashConfig&lt;BR /&gt;DCD 0xffffffff &amp;lt;- backdoor keys1&lt;BR /&gt;DCD 0xffffffff &amp;lt;- backdoor keys2&lt;BR /&gt;DCD 0xffffffff &amp;lt;- program protection&lt;BR /&gt;DCD 0xfffffffe &amp;lt;- (data flash protection / EEPROM protection / non-volatile options / security setting)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I don't know why it is done in assembler since it is rather cryptic.&lt;/P&gt;&lt;P&gt;In the uTasker loader it is done as follows, which is more use friendly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;const KINETIS_FLASH_CONFIGURATION __flash_config&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;= {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KINETIS_FLASH_CONFIGURATION_BACKDOOR_KEY,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KINETIS_FLASH_CONFIGURATION_PROGRAM_PROTECTION,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KINETIS_FLASH_CONFIGURATION_SECURITY,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KINETIS_FLASH_CONFIGURATION_NONVOL_OPTION,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KINETIS_FLASH_CONFIGURATION_EEPROM_PROT,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KINETIS_FLASH_CONFIGURATION_DATAFLASH_PROT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;// FLASH configuration settings (these are plugged into the KINETIS_FLASH_CONFIGURATION_BACKDOOR_KEY area)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;//&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // note that values with all 0x00 or all 0xff are not valid&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define KINETIS_FLASH_CONFIGURATION_SECURITY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;STRONG&gt;FTFL_FSEC_SEC_SECURE | FTFL_FSEC_FSLACC_GRANTED | FTFL_FSEC_MEEN_ENABLED | FTFL_FSEC_KEYEN_ENABLED&lt;/STRONG&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define KINETIS_FLASH_CONFIGURATION_PROGRAM_PROTECTION (0xffffffff)&amp;nbsp; // PROT[31:24]:PROT[23:16]:PROT[15:8]:PROT[7:0] - no protection when all are '1'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define KINETIS_FLASH_CONFIGURATION_NONVOL_OPTION&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (FTFL_FOPT_EZPORT_ENABLED | FTFL_FOPT_LPBOOT_NORMAL | FTFL_FOPT_NMI_DISABLED)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define KINETIS_FLASH_CONFIGURATION_EEPROM_PROT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xff&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define KINETIS_FLASH_CONFIGURATION_DATAFLASH_PROT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xff&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A possible secure setting for your case is thus &lt;STRONG&gt;0xbc&lt;/STRONG&gt;&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>Sat, 21 Jul 2018 01:51:46 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2018-07-21T01:51:46Z</dc:date>
    <item>
      <title>Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832524#M50352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;I am using KDS v3.2 with Processor expert and a custom board.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering what some of my resources are for securing my firmware on my K22FN256LH12. Reading through this document&amp;nbsp;&lt;A class="link-titled" href="https://www.nxp.com/docs/en/application-note/AN4507.pdf" title="https://www.nxp.com/docs/en/application-note/AN4507.pdf"&gt;https://www.nxp.com/docs/en/application-note/AN4507.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I see there is&amp;nbsp;a basic "Security Enable" for JTag, which I use to access the chip. This allows for me to just not be able to debug, without erasing the whole chip correct? Once it is flashed, it can no longer be debugged, only re-flashed correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Backdoor key enable. Once this is used, a person cannot do anything to the chip without the 64 bit key? This includes flashing, erase, reading and debug correct? If I get in, I have full control again to flash right? Also I am unsure how to issue the&amp;nbsp; Verify Backdoor Access Key command, is there a method I can use/ Where is this value stored that I can use to compare?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Mass erase disable. Is this like a one shot? Once you flash it, that's how it stays forever?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Freescale Access, I assume I should not allow access. Since I'll do the analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anything I missed or any suggestions? I like the backdoor key if it allows full access if the right key is entered (can I change this key after I've gained access and reflash?), but it seems to need a lot of structure for it to setup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2018 20:44:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832524#M50352</guid>
      <dc:creator>burgeh</dc:creator>
      <dc:date>2018-06-29T20:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832525#M50353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christoper&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually setting the secure mode is adequate for code protection since it is then not possible to read the content without first issuing a mass erase (resulting in a fresh chip again).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Be very careful with JTAG lockout with mass erase disable since this restricts any further external programming or debugging and results in a bricked development unit in most cases.&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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uTasker developer and supporter (+5'000 hours experience on +60 Kinetis derivatives in +80 product developments)&lt;BR /&gt;&lt;SPAN&gt;Kinetis: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2018 22:17:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832525#M50353</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-06-29T22:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832526#M50354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would I be able to use the KinetisFlashTool to access my chip since it has a section for the backdoor key?&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/65178i0265A1EFE63819F4/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;The reason why I don't want to try this for my self is because of this image below. My application code (I believe, unless PE did something) does not have anything like this. However, it seems KinetisFlashTool can do this.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/65179iFAD83D9CEAE22686/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2018 14:03:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832526#M50354</guid>
      <dc:creator>burgeh</dc:creator>
      <dc:date>2018-07-10T14:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832527#M50355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Christopher&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the K22 doesn't have KBOOT built in as a BOOT ROM it represent an 'application' to the processor and as such fulfills the requirement to be able to run the validation command (KBOOT requires the FlashSecurityDisable option to be enabled for it to work).&lt;BR /&gt;Your usual application can do the same thing if it uses the same validation code (and has a method of the validation being commanded when the application is running)..&lt;/P&gt;&lt;P&gt;In both cases it will only be possible if either the boot loader mode can be entered or the application is operational - if for any reason one of these fails (something unforeseen) it will not be able to work anymore.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note also that the backdoor key validation is a temporary unlocking and after a reset it is secured again. This may not always be practical so it depends on the requirements to temporarily set the unsecured state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that KBOOT also has a "erase all to unlock" command which is a mass erase - this means that the chip then becomes more or less a fresh chip and you can reconnect without any restrictions via EzPort, SWD or JTAG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A simple way to at least allow the chip to be fully unsecured is to have a command in the application that performs a mass erase (if you prefer in addition to the backdoor unlock) since this will always ensure recovery. A pull-up or pull-down on a free pin at reset to cause this to execute is a fairly effective way to ensure that it works, even if the loaded application subsequently runs away due to some new error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It depends on what your exact security requirement is - if you just need to protect Flash content and have a Jtag programmer available simply setting the secure state would be adequate (no debugger blocking) and no internal recovery method will ever be needed.&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>Wed, 11 Jul 2018 00:58:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832527#M50355</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-07-11T00:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832528#M50356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My goals are to not have the firmware accessible (readable) and to not allow anyone to just mass erase it and reprogram it. I enable the security and the backdoor key as shown below.&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/65815i8720825552E22A45/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;However, I am still able to erase with J-Link Commander (no key needed) and reflash with KBoot (No key needed). Is there something I am missing?&amp;nbsp; I do have a bootloader on here. Below is an image of KBoot after I loaded the "secure" firmware on, and then tried loading another firmware. I was able to and it seems to be UNSECURE.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/65816iDE9AB3479D57135C/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2018 21:39:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832528#M50356</guid>
      <dc:creator>burgeh</dc:creator>
      <dc:date>2018-07-18T21:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832529#M50357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Christopher&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If KBOOT displays the device as UNSECURE (as in the image) it is not secure - how do you program to the board? - some tools don't let you program the security state (attempting to avoid you locking the chip unintentionally) without setting up its configuration to allow it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the device is un-secure KBOOT will also ignore the mass erase and backdoor key settings (they an be set but no command is sent).&lt;BR /&gt;&lt;BR /&gt;Also, note that features in KBOOT (at the processor) are optional and the mass erase and backdoor key settings are only supported when the options are enabled (they probably are enabled but make sure to avoid bricking the device).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is your requirement to neither allow the device to be erased nor reprogrammed externally that probably means that you need to enable security (blocks read) and disable the mass erase (can't un-secure via Jtag or EzPort) - or you could probably just as well disable the Jtag EzPort (which does both).&lt;BR /&gt;&lt;BR /&gt;Finally since you don't want a mass erase to be possible you will also need to configure the Kboot option to remove the support, otherwise anyone will still be able to do this using using KBOOT utility.&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>Wed, 18 Jul 2018 22:49:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832529#M50357</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-07-18T22:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832530#M50358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My mistake, I should have specified, I don't want some average Joe to mass erase. If they have the backdoor key (they would have permission from me) to mass erase and re-flash. I don't want to completely disable mass erase, since I would like to go back and occasionally update it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I currently use J-Link commander to load a tower_bootloader (provided by KBOOT) and then use a USB connection to the board after reset to communicate with the KinetisFlashTool. Using the flash tool flash the application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know for sure that when I flash the board using KDSv3.2 with just the security bit set that it informs me of the security protection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2018 14:21:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832530#M50358</guid>
      <dc:creator>burgeh</dc:creator>
      <dc:date>2018-07-19T14:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832531#M50359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Christopher&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SECURE / USECURE state displayed by KBOOT is the result of it requesting the board its flash security state using the PROPERTY_FLASH_SEC_STATE (17) property request.&lt;/P&gt;&lt;P&gt;When the Flash is unsecured the response is a 0 and when it is secured the response is 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you know that you have secured Flash but the tool is not showing it the problem is in the KBOOT version you have loaded to the K22. You will need to check whether it has additional options to allow this or whether it doesn't correctly identify the secured state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without the chip correctly signalling its secured state the KBOOT utility will also not attempt to unlock the device even if the check boxes are set, meaning that this must first be resolved before being able to move on.&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, 19 Jul 2018 15:46:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832531#M50359</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-07-19T15:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832532#M50360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there some bits that need to be set within the bootloader to reflect the fsec register within the application? I have no problem flashing it even though it should be secured with a backdoor key. Is there a headfile within the bootloader with some defines that I could check to ensure it is being set? I mostly see that it is pointers check registers within the CPU therefore if it is set on the application it should update the bootloader values (image one). The second and third&amp;nbsp;images, this is in my application, below seems to be that it has values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/65900i102255DE58E83F05/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/65901i18B75CDDB809E759/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&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/65910i60433C79F206D0AC/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;Thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2018 16:34:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832532#M50360</guid>
      <dc:creator>burgeh</dc:creator>
      <dc:date>2018-07-19T16:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832533#M50361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Christopher&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must secure the chip in the boot loader and not in the application. The application values have no relevance and can be removed - &amp;gt; therefore you much make the same security setting in the loader and re-flash the boot loader for them to apply.&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, 19 Jul 2018 18:05:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832533#M50361</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-07-19T18:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832534#M50362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you,&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/kerryzhou"&gt;kerryzhou&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;Is there a place within the tower_bootloader code for the K22FN256 where I can set the FSEC register as well as the backdoor key values?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2018 18:29:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832534#M50362</guid>
      <dc:creator>burgeh</dc:creator>
      <dc:date>2018-07-19T18:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832535#M50363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Christopher,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Of course, you can!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Please check my following picture:&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/65960iACA785B7289D7DF8/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;&lt;/P&gt;&lt;P&gt;FlashConfig used to configure the flash configuration field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&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>Fri, 20 Jul 2018 01:16:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832535#M50363</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-07-20T01:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832536#M50364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is that just setting the FSEC register? Where I do I enter the backdoor key value, and enable backdoor key?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jul 2018 01:48:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832536#M50364</guid>
      <dc:creator>burgeh</dc:creator>
      <dc:date>2018-07-20T01:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832537#M50365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please refer to the user manual,the flash configuration field is the 16byte space, it is the same as the code __FlashConfig , if you want to modify the backdoor key, just modify the front 8bytes in __FlashConfig. &lt;/P&gt;&lt;P&gt;&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/65966i74F18875CABCCC5F/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;&lt;BR /&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>Fri, 20 Jul 2018 03:05:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832537#M50365</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-07-20T03:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832538#M50366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Christopher&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;__FlashConfig&lt;BR /&gt;DCD 0xffffffff &amp;lt;- backdoor keys1&lt;BR /&gt;DCD 0xffffffff &amp;lt;- backdoor keys2&lt;BR /&gt;DCD 0xffffffff &amp;lt;- program protection&lt;BR /&gt;DCD 0xfffffffe &amp;lt;- (data flash protection / EEPROM protection / non-volatile options / security setting)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I don't know why it is done in assembler since it is rather cryptic.&lt;/P&gt;&lt;P&gt;In the uTasker loader it is done as follows, which is more use friendly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;const KINETIS_FLASH_CONFIGURATION __flash_config&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;= {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KINETIS_FLASH_CONFIGURATION_BACKDOOR_KEY,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KINETIS_FLASH_CONFIGURATION_PROGRAM_PROTECTION,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KINETIS_FLASH_CONFIGURATION_SECURITY,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KINETIS_FLASH_CONFIGURATION_NONVOL_OPTION,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KINETIS_FLASH_CONFIGURATION_EEPROM_PROT,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KINETIS_FLASH_CONFIGURATION_DATAFLASH_PROT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;// FLASH configuration settings (these are plugged into the KINETIS_FLASH_CONFIGURATION_BACKDOOR_KEY area)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;//&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // note that values with all 0x00 or all 0xff are not valid&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define BACKDOOR_KEY_7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define KINETIS_FLASH_CONFIGURATION_SECURITY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;STRONG&gt;FTFL_FSEC_SEC_SECURE | FTFL_FSEC_FSLACC_GRANTED | FTFL_FSEC_MEEN_ENABLED | FTFL_FSEC_KEYEN_ENABLED&lt;/STRONG&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define KINETIS_FLASH_CONFIGURATION_PROGRAM_PROTECTION (0xffffffff)&amp;nbsp; // PROT[31:24]:PROT[23:16]:PROT[15:8]:PROT[7:0] - no protection when all are '1'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define KINETIS_FLASH_CONFIGURATION_NONVOL_OPTION&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (FTFL_FOPT_EZPORT_ENABLED | FTFL_FOPT_LPBOOT_NORMAL | FTFL_FOPT_NMI_DISABLED)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define KINETIS_FLASH_CONFIGURATION_EEPROM_PROT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xff&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define KINETIS_FLASH_CONFIGURATION_DATAFLASH_PROT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xff&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A possible secure setting for your case is thus &lt;STRONG&gt;0xbc&lt;/STRONG&gt;&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>Sat, 21 Jul 2018 01:51:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832538#M50366</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-07-21T01:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832539#M50367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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/66369i9C6585C0B0CFF8D7/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;I have these values set, so this would set the FSEC to secure, and set the backdoor key to 000...001. However, I still get Unsecure from KBOOT as well as I can erase easily from J-Link Commander.&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/kerryzhou"&gt;kerryzhou&lt;/A&gt;‌ I seem to have it set correctly. I am using the tower_bootloader code on the K22FN&lt;STRONG&gt;256&lt;/STRONG&gt;. Not quite sure why it would not be securing. I've built it a few times as the release version. Any other place I need to change? I attached my current tower_bootloader. I don't recall any changes other than the flashconfig.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2018 16:12:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832539#M50367</guid>
      <dc:creator>burgeh</dc:creator>
      <dc:date>2018-07-24T16:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832540#M50368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christopher,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Don't worry, please generate the .hex file, and in the hex file, check the according flash address, whether the data is configured as your defined? If yes, it is correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Besides, when you use the JLINK, as you know, there will have a chip partnumber select, you need to select the partnumber with allow security, that means when you use the JLINK, the flash configuration field can be modified, otherwise JLINK won't update the flash configuration field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Please also note, even your secure the SWD, but you still can use the SWD to unlock it, if you enable the mass erase bit. this is correct. But others can't read or write directly through the SWD if it is unlocked, unlock is just the mass erase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&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, 26 Jul 2018 08:34:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832540#M50368</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-07-26T08:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832541#M50369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Besides, when you use the JLINK, as you know, there will have a chip partnumber select, &lt;STRONG&gt;you need to select the partnumber with allow security,&lt;/STRONG&gt; that means when you use the JLINK, the flash configuration field can be modified, otherwise JLINK won't update the flash configuration field.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;What do you mean by this exactly? When I use J-Link commander below is an image of my typical settings, is there something I'm missing?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/66563i7FFC3CD805CA4550/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How can I confirm this? This image tells me the address, but I do not see where this is.&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/66600iEAB474CCE6A43D43/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;&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/66564i86C19830D74526B4/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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 14:26:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832541#M50369</guid>
      <dc:creator>burgeh</dc:creator>
      <dc:date>2018-07-26T14:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832542#M50370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christopher,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Your selection is not correct, please check my side:&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/73195i8DDEC90A9B75A958/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;You can find two items, one is allow security, another won't allow security, this is the JLINK driver. If you don't select the allow security, even you secure the chip, when you download the code, the JLINK debugger will still won't modify the flash configuration field.&lt;/P&gt;&lt;P&gt;&amp;nbsp; So, please select the chip as MK22FN256xxx12(allow security), then try it again.&lt;/P&gt;&lt;P&gt;&amp;nbsp; About your hex, your picture still not in the 0X400 side, it is just contains 0x40 address. You can share me your whole .hex file.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Please note, in the IDE JLINK inteface, you also need to select the chip as MK22FN256xxx12(allow security), this is very important.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&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>Tue, 31 Jul 2018 09:21:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832542#M50370</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-07-31T09:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Securing K22 Code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832543#M50371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect, I was unaware of that setting with the J-Link. Almost there! The image below shows my attempt at flashing. As you can see the chip is now secure, however, I am having an issue with the backdoor key. I believe it is enabled, I have my flash config in the second image below, and according the image 3 it should be enable. Also I do not wish to disable the mass erase, to clarify, I want to not allow others to mass erase without the backdoor key.&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/73209i29F0F6ADB465A8D3/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;Image 1. Successful FSEC setting, but not Backdoor Key&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/73210i7EF8149EFE5ACA26/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Image 2. Code used I believe to set FSEC and KEYEN. "0xBD" is &lt;STRONG&gt;10&lt;/STRONG&gt; 11 11 &lt;STRONG&gt;01&amp;nbsp;&lt;/STRONG&gt;to enable FSEC and KEYEN&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/73211iD5AF977E9D8F4586/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2018 17:03:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Securing-K22-Code/m-p/832543#M50371</guid>
      <dc:creator>burgeh</dc:creator>
      <dc:date>2018-07-31T17:03:56Z</dc:date>
    </item>
  </channel>
</rss>

