<?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: KEA FTMRH_FSEC[SEC]</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-FTMRH-FSEC-SEC/m-p/1333557#M61398</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/103130"&gt;@sam_lgu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your reply!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that the IDE or the Debug tools&amp;nbsp; are not letting you&amp;nbsp; update the FSEC with your security settings.&lt;/P&gt;
&lt;P&gt;I&amp;nbsp; tried on my side and ran in the same problem , I was not able to update FSEC&amp;nbsp; .&amp;nbsp;&amp;nbsp;I&amp;nbsp; used :&amp;nbsp; &amp;nbsp;the&amp;nbsp; KE04Z ;&amp;nbsp; the MCUXpresso IDE ,&amp;nbsp; my and&amp;nbsp; LPC-Link 2 with Segger J-Link firmware.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It was a bit tricky but I managed to update the FSEC as I wanted, see my procedure below.&lt;/P&gt;
&lt;P&gt;1 I set the FSEC to 11 (secure mode ) at the Flash config structure , in the MCUXpresso this structure it is located in the startup file .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_0-1630529091506.png" style="width: 513px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154835i41FD3A461F86F82B/image-dimensions/513x123?v=v2" width="513" height="123" role="button" title="diego_charles_0-1630529091506.png" alt="diego_charles_0-1630529091506.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; After , that I generated an hex file&amp;nbsp; &amp;nbsp;to verify if the IDE was generating&amp;nbsp; my image with my desired FSEC setting of 0b11. I used Hexedit to validate that I was generating my settings.&amp;nbsp;&lt;/P&gt;
&lt;DIV id="tinyMceEditordiego_charles_7" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_11-1630530779069.png" style="width: 530px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154840iFD86A527C33A8FD5/image-dimensions/530x105?v=v2" width="530" height="105" role="button" title="diego_charles_11-1630530779069.png" alt="diego_charles_11-1630530779069.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;(The flash security bite containing&amp;nbsp; the FSEC is located at the 0x40C)&lt;/P&gt;
&lt;P&gt;3 Then,&amp;nbsp; I programed the application , and using the debugger I checked the value of&amp;nbsp; FSEC ;&amp;nbsp; I wanted it to be 0b11 but it was 0b10 (the default mode with no security ) The same problem&amp;nbsp; you experimented.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_1-1630529416058.png" style="width: 691px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154836iC227FECCE2ED922B/image-dimensions/691x322?v=v2" width="691" height="322" role="button" title="diego_charles_1-1630529416058.png" alt="diego_charles_1-1630529416058.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;4. Then I changed the MCU in the J-Link&amp;nbsp; debug configuration to the &lt;EM&gt;allow security&lt;/EM&gt; version.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_4-1630529587784.png" style="width: 489px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154837i527CFC87B9B89308/image-dimensions/489x438?v=v2" width="489" height="438" role="button" title="diego_charles_4-1630529587784.png" alt="diego_charles_4-1630529587784.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;5. I recompiled the project and debugged one more time. I was able to see that the FSEC now changed to my desired value of 0b11.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_6-1630530543215.png" style="width: 451px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154839iCA0D0233D6210351/image-dimensions/451x240?v=v2" width="451" height="240" role="button" title="diego_charles_6-1630530543215.png" alt="diego_charles_6-1630530543215.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;That is&amp;nbsp; why&amp;nbsp; I say that the debugger may not letting you to update the FSEC,&amp;nbsp; also verify if Code warrior is generating the image with the FSEC.&amp;nbsp; Then check the configurations&amp;nbsp; of your probe firmware.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note :&amp;nbsp; I checked the FSEC during a debug session after programming&amp;nbsp; the MCU with J-Link , but I do not recommend doing that, the best is to read the value of FSEC using code and then display it using a serial terminal , for example.&lt;/P&gt;
&lt;P&gt;Let me know your results, or if you have complications.&lt;/P&gt;
&lt;P&gt;Diego&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Sep 2021 21:34:58 GMT</pubDate>
    <dc:creator>diego_charles</dc:creator>
    <dc:date>2021-09-01T21:34:58Z</dc:date>
    <item>
      <title>KEA FTMRH_FSEC[SEC]</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-FTMRH-FSEC-SEC/m-p/1325435#M61273</link>
      <description>&lt;P&gt;Hi， everyone!&amp;nbsp; I want to&amp;nbsp;limits access to flash resources by sec bits(SEC = 00). however, the swd debug can still work. could anyone tell me why. thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 12:03:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-FTMRH-FSEC-SEC/m-p/1325435#M61273</guid>
      <dc:creator>sam_lgu</dc:creator>
      <dc:date>2021-08-18T12:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: KEA FTMRH_FSEC[SEC]</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-FTMRH-FSEC-SEC/m-p/1326336#M61279</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/103130"&gt;@sam_lgu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope you are doing well!&lt;/P&gt;
&lt;P&gt;Could you help me to confirm the following ?:&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;1 Are you trying to write the to&lt;STRONG&gt; Flash security byte&lt;/STRONG&gt; of the &lt;STRONG&gt;Flash Configuration Field&amp;nbsp; (&lt;/STRONG&gt;generally located in the startup files ) from your image itself? Or are you trying to implement another method?&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;2. Even after a power on reset, the security setting (&lt;SPAN&gt;SEC = 00) is&amp;nbsp; not&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;set , right?&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;3.Additionally, could you let me know your IDE and KEA MCU part number?&lt;/P&gt;
&lt;P&gt;Regarding your question , probably, the Flash config field is not being written as we may expect . As we know&amp;nbsp; from the KEA reference manuals , the&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;FTMRH_FSEC[SEC]&lt;/STRONG&gt; is loaded&amp;nbsp; with&amp;nbsp; the Security byte of the &lt;STRONG&gt;Flash config field&lt;/STRONG&gt; during reset sequence. So,&amp;nbsp; &amp;nbsp;if the&lt;STRONG&gt;&amp;nbsp;Flash config field&lt;/STRONG&gt; does not have the our security settings , the&amp;nbsp;&lt;STRONG&gt;FTMRH_FSEC[SEC]&lt;/STRONG&gt; will not , either.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_0-1629386915117.png" style="width: 620px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/153484i73ABCA3659612B75/image-dimensions/620x272?v=v2" width="620" height="272" role="button" title="diego_charles_0-1629386915117.png" alt="diego_charles_0-1629386915117.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="diego_charles_1-1629386942779.png" style="width: 619px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/153485i6BDDE073208745A5/image-dimensions/619x206?v=v2" width="619" height="206" role="button" title="diego_charles_1-1629386942779.png" alt="diego_charles_1-1629386942779.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Following that idea, my&amp;nbsp; suggestion is that you could try to dump the flash memory contents to&amp;nbsp; check the values of the Flash config field. So we can can have more data , to determine if that is part of the problem , or the problem.&lt;/P&gt;
&lt;P&gt;All the best&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Diego.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 15:39:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-FTMRH-FSEC-SEC/m-p/1326336#M61279</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2021-08-19T15:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: KEA FTMRH_FSEC[SEC]</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-FTMRH-FSEC-SEC/m-p/1327257#M61314</link>
      <description>&lt;P&gt;Hi, &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/89833"&gt;@diego_charles&lt;/a&gt;&amp;nbsp;! Thanks for ur reply!&lt;/P&gt;&lt;P&gt;My IDE is cw11.0, and mcu is KEA128.&lt;/P&gt;&lt;P&gt;It is true that the content of SEC is not being written as expected by checking flash memory. It is always 10b, which is unsecure.&lt;/P&gt;&lt;P&gt;The code which set SEC bits is generated by Processor Expert. SEC bits is written as 00b by code.&lt;/P&gt;&lt;P&gt;Here is code&amp;nbsp; by Processor Expert.&lt;/P&gt;&lt;P&gt;/* Flash configuration field constants */&lt;BR /&gt;#define CPU_FLASH_CONFIG_FIELD \&lt;BR /&gt;/* NV_BACKKEY0: KEY=0xFF */ \&lt;BR /&gt;0xFFU, \&lt;BR /&gt;/* NV_BACKKEY1: KEY=0xFF */ \&lt;BR /&gt;0xFFU, \&lt;BR /&gt;/* NV_BACKKEY2: KEY=0xFF */ \&lt;BR /&gt;0xFFU, \&lt;BR /&gt;/* NV_BACKKEY3: KEY=0xFF */ \&lt;BR /&gt;0xFFU, \&lt;BR /&gt;/* NV_BACKKEY4: KEY=0xFF */ \&lt;BR /&gt;0xFFU, \&lt;BR /&gt;/* NV_BACKKEY5: KEY=0xFF */ \&lt;BR /&gt;0xFFU, \&lt;BR /&gt;/* NV_BACKKEY6: KEY=0xFF */ \&lt;BR /&gt;0xFFU, \&lt;BR /&gt;/* NV_BACKKEY7: KEY=0xFF */ \&lt;BR /&gt;0xFFU, \&lt;BR /&gt;/* Reserved */ \&lt;BR /&gt;0xFFU, \&lt;BR /&gt;/* Reserved */ \&lt;BR /&gt;0xFFU, \&lt;BR /&gt;/* Reserved */ \&lt;BR /&gt;0xFFU, \&lt;BR /&gt;/* Reserved */ \&lt;BR /&gt;0xFFU, \&lt;BR /&gt;/* Reserved */ \&lt;BR /&gt;0xFFU, \&lt;BR /&gt;/* NV_FPROT: FPOPEN=1,??=1,FPHDIS=1,FPHS=0,FPLDIS=1,FPLS=0 */ \&lt;BR /&gt;0xE4U, \&lt;BR /&gt;/* NV_FSEC: KEYEN=3,??=1,??=1,??=1,??=1,SEC=0 */ \&lt;BR /&gt;0xFCU, \&lt;BR /&gt;/* NV_FOPT: ??=1,??=1,??=1,??=1,??=1,??=1,??=1,??=1 */ \&lt;BR /&gt;0xFFU&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;__attribute__ ((section (".cfmconfig"))) const uint8_t _cfm[0x10] = {CPU_FLASH_CONFIG_FIELD};&lt;/P&gt;&lt;P&gt;However, the content of _cfm[14] is not 0xFC, it is 0xFE!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 00:35:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-FTMRH-FSEC-SEC/m-p/1327257#M61314</guid>
      <dc:creator>sam_lgu</dc:creator>
      <dc:date>2021-08-23T00:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: KEA FTMRH_FSEC[SEC]</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-FTMRH-FSEC-SEC/m-p/1333557#M61398</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/103130"&gt;@sam_lgu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your reply!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that the IDE or the Debug tools&amp;nbsp; are not letting you&amp;nbsp; update the FSEC with your security settings.&lt;/P&gt;
&lt;P&gt;I&amp;nbsp; tried on my side and ran in the same problem , I was not able to update FSEC&amp;nbsp; .&amp;nbsp;&amp;nbsp;I&amp;nbsp; used :&amp;nbsp; &amp;nbsp;the&amp;nbsp; KE04Z ;&amp;nbsp; the MCUXpresso IDE ,&amp;nbsp; my and&amp;nbsp; LPC-Link 2 with Segger J-Link firmware.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It was a bit tricky but I managed to update the FSEC as I wanted, see my procedure below.&lt;/P&gt;
&lt;P&gt;1 I set the FSEC to 11 (secure mode ) at the Flash config structure , in the MCUXpresso this structure it is located in the startup file .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_0-1630529091506.png" style="width: 513px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154835i41FD3A461F86F82B/image-dimensions/513x123?v=v2" width="513" height="123" role="button" title="diego_charles_0-1630529091506.png" alt="diego_charles_0-1630529091506.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; After , that I generated an hex file&amp;nbsp; &amp;nbsp;to verify if the IDE was generating&amp;nbsp; my image with my desired FSEC setting of 0b11. I used Hexedit to validate that I was generating my settings.&amp;nbsp;&lt;/P&gt;
&lt;DIV id="tinyMceEditordiego_charles_7" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_11-1630530779069.png" style="width: 530px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154840iFD86A527C33A8FD5/image-dimensions/530x105?v=v2" width="530" height="105" role="button" title="diego_charles_11-1630530779069.png" alt="diego_charles_11-1630530779069.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;(The flash security bite containing&amp;nbsp; the FSEC is located at the 0x40C)&lt;/P&gt;
&lt;P&gt;3 Then,&amp;nbsp; I programed the application , and using the debugger I checked the value of&amp;nbsp; FSEC ;&amp;nbsp; I wanted it to be 0b11 but it was 0b10 (the default mode with no security ) The same problem&amp;nbsp; you experimented.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_1-1630529416058.png" style="width: 691px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154836iC227FECCE2ED922B/image-dimensions/691x322?v=v2" width="691" height="322" role="button" title="diego_charles_1-1630529416058.png" alt="diego_charles_1-1630529416058.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;4. Then I changed the MCU in the J-Link&amp;nbsp; debug configuration to the &lt;EM&gt;allow security&lt;/EM&gt; version.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_4-1630529587784.png" style="width: 489px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154837i527CFC87B9B89308/image-dimensions/489x438?v=v2" width="489" height="438" role="button" title="diego_charles_4-1630529587784.png" alt="diego_charles_4-1630529587784.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;5. I recompiled the project and debugged one more time. I was able to see that the FSEC now changed to my desired value of 0b11.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_6-1630530543215.png" style="width: 451px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154839iCA0D0233D6210351/image-dimensions/451x240?v=v2" width="451" height="240" role="button" title="diego_charles_6-1630530543215.png" alt="diego_charles_6-1630530543215.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;That is&amp;nbsp; why&amp;nbsp; I say that the debugger may not letting you to update the FSEC,&amp;nbsp; also verify if Code warrior is generating the image with the FSEC.&amp;nbsp; Then check the configurations&amp;nbsp; of your probe firmware.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note :&amp;nbsp; I checked the FSEC during a debug session after programming&amp;nbsp; the MCU with J-Link , but I do not recommend doing that, the best is to read the value of FSEC using code and then display it using a serial terminal , for example.&lt;/P&gt;
&lt;P&gt;Let me know your results, or if you have complications.&lt;/P&gt;
&lt;P&gt;Diego&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 21:34:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-FTMRH-FSEC-SEC/m-p/1333557#M61398</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2021-09-01T21:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: KEA FTMRH_FSEC[SEC]</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-FTMRH-FSEC-SEC/m-p/1333647#M61401</link>
      <description>&lt;P&gt;it worked, thank u!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 01:52:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-FTMRH-FSEC-SEC/m-p/1333647#M61401</guid>
      <dc:creator>sam_lgu</dc:creator>
      <dc:date>2021-09-02T01:52:21Z</dc:date>
    </item>
  </channel>
</rss>

