<?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: K22F Flash Security in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-Flash-Security/m-p/1150170#M58019</link>
    <description>&lt;P&gt;Hi，&lt;/P&gt;
&lt;P&gt;Because the fopt was loaded by core, and the core will load it to flash when flash initializing.After reset ,the processor will not load fopt ,it set up PC ,stack,LR for running application.&lt;/P&gt;
&lt;P&gt;As you said , the x and y's FOPT will be ignored .&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/124603i19E670A0CD4D097B/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.png" alt="3.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="tinyMceEditornxf58904_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 10pt;"&gt;Jianyu:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;Have a great day,&lt;BR /&gt;TIC&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&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;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Sep 2020 07:54:44 GMT</pubDate>
    <dc:creator>nxf58904</dc:creator>
    <dc:date>2020-09-08T07:54:44Z</dc:date>
    <item>
      <title>K22F Flash Security</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-Flash-Security/m-p/1149527#M58000</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a K22F device which contains :&lt;/P&gt;&lt;P&gt;loader application at offset &lt;STRONG&gt;0x00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;primary application at offset &lt;STRONG&gt;x&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;secondary application at offset &lt;STRONG&gt;y&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Default startup file provided by mcuxpresso contains Flash configuration block of four words which is placed at relative offset of 0x400 and contains Backdoor key/Program protection adn Fsec settings.&lt;/P&gt;&lt;P&gt;I wan to secure the device according to the following settings:&lt;/P&gt;&lt;P&gt;- Backdoor Key disabled&lt;BR /&gt;- Mass Erase disabled&lt;BR /&gt;- Freescale factory access is denied&lt;BR /&gt;- Flash security is enabled ( Jtag/Swd is disabled )&lt;/P&gt;&lt;P&gt;This implies that FSEC needs to be set to 0xC4.&amp;nbsp; So as far as I understand&amp;nbsp; flash configuration in the startup file needs to be modified to:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;__attribute__ ((used,section(".FlashConfig"))) const struct {
    unsigned int word1;
    unsigned int word2;
    unsigned int word3;
    unsigned int word4;
} Flash_Config = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFC4};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I do not understand is if these settings needs to be applied to x+400 and y+400 too or only to loader part of flash region 0+400?&amp;nbsp; My reasoning is as follows:&lt;/P&gt;&lt;P&gt;1. MCU goes out of reset and Flash Security is configured according to settings stored at 0x00+0x400&lt;/P&gt;&lt;P&gt;2. Loader application jumps to application at offset x or y depending on configuration&lt;/P&gt;&lt;P&gt;3. Flash Security is reconfigured according to settings stored at x+400 or y+400?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My primary objective is to disable access to device (flash-dump, swd/jtag access)&lt;/P&gt;</description>
      <pubDate>Mon, 07 Sep 2020 07:42:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-Flash-Security/m-p/1149527#M58000</guid>
      <dc:creator>whata</dc:creator>
      <dc:date>2020-09-07T07:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: K22F Flash Security</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-Flash-Security/m-p/1149971#M58010</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;As the follow picture shows,the Flash configure area (FOPT) was loaded on reset.&lt;/P&gt;
&lt;P&gt;You have a loader application, X and Y applications in flash,but you should only set&amp;nbsp; FOPT at 0x0+0x400(loader application).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxf58904_0-1599532988275.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/124557i659794E9633676EB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxf58904_0-1599532988275.png" alt="nxf58904_0-1599532988275.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxf58904_1-1599533492217.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/124558iA171440A8E85E788/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxf58904_1-1599533492217.png" alt="nxf58904_1-1599533492217.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 10pt;"&gt;Jianyu:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;Have a great day,&lt;BR /&gt;TIC&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&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;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 02:59:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-Flash-Security/m-p/1149971#M58010</guid>
      <dc:creator>nxf58904</dc:creator>
      <dc:date>2020-09-08T02:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: K22F Flash Security</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-Flash-Security/m-p/1150086#M58017</link>
      <description>&lt;P&gt;TIC,&lt;/P&gt;&lt;P&gt;Thanks for prompt reply. But what happens exactly after jump to x or y application, they do contain FOPT bytes at their relative offset of 400. Are they simply ignored?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 06:21:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-Flash-Security/m-p/1150086#M58017</guid>
      <dc:creator>whata</dc:creator>
      <dc:date>2020-09-08T06:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: K22F Flash Security</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-Flash-Security/m-p/1150170#M58019</link>
      <description>&lt;P&gt;Hi，&lt;/P&gt;
&lt;P&gt;Because the fopt was loaded by core, and the core will load it to flash when flash initializing.After reset ,the processor will not load fopt ,it set up PC ,stack,LR for running application.&lt;/P&gt;
&lt;P&gt;As you said , the x and y's FOPT will be ignored .&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/124603i19E670A0CD4D097B/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.png" alt="3.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="tinyMceEditornxf58904_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 10pt;"&gt;Jianyu:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;Have a great day,&lt;BR /&gt;TIC&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0cm;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&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;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 07:54:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22F-Flash-Security/m-p/1150170#M58019</guid>
      <dc:creator>nxf58904</dc:creator>
      <dc:date>2020-09-08T07:54:44Z</dc:date>
    </item>
  </channel>
</rss>

