<?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: How to write IFR on K32L3A? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-IFR-on-K32L3A/m-p/1751450#M65670</link>
    <description>&lt;P&gt;Yep, I understand that, which is why I'm trying to use the backdoor key.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also understand the need to write in multiples of 32-bits, the problem is where in that 32-bits do the bits I'm trying to program go? &amp;nbsp; For example when I try to set FSEC KEYEN to 10 (see above)?&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have the IFR write to FSEC:KEYEN correct, why is it not allowing me to unlock using backdoor key?&lt;/P&gt;</description>
    <pubDate>Thu, 02 Nov 2023 23:23:09 GMT</pubDate>
    <dc:creator>Samson88</dc:creator>
    <dc:date>2023-11-02T23:23:09Z</dc:date>
    <item>
      <title>How to write IFR on K32L3A?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-IFR-on-K32L3A/m-p/1748354#M65654</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm using blhost to write IFR 0x80 to put device into unsecured state.&amp;nbsp; To do this I must set bits 1:0&amp;nbsp; in FSEC register to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;10.&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Since blhost requires 4 or 8 bytes, I am guessing the value I should write is: 0xFFFFFFF&lt;STRONG&gt;E, &lt;/STRONG&gt;because&amp;nbsp;the lowest bits in the&amp;nbsp;&lt;STRONG&gt;E&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= 11&lt;STRONG&gt;10&lt;/STRONG&gt;.&amp;nbsp; &amp;nbsp;But this doesn't work.&amp;nbsp; I also tried little endian 0xF&lt;STRONG&gt;E&lt;/STRONG&gt;FFFFFF, it did not work either.&lt;/P&gt;&lt;P&gt;When I read back 0x80 after writing, it looks like it worked.&amp;nbsp; When I reset the device (or cycle power), the state is SECURED.&amp;nbsp; But I expect it to be UNSECURED, since I wrote&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;10&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;blhost -p COM5 flash-program-once 0x80 4 FFFFFFFE&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Ping responded in 1 attempt(s)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Inject command 'flash-program-once'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Successful generic response to command 'flash-program-once'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Response status = 0 (0x0)&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Success.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;blhost -p COM5 flash-read-once 0x80 4&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Ping responded in 1 attempt(s)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Inject command 'flash-read-once'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Response status = 0 (0x0)&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Success&lt;/STRONG&gt;.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Response word 1 = 4 (0x4)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Response word 2 = -2 (&lt;STRONG&gt;0xfffffffe&lt;/STRONG&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;blhost -p COM5 reset&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;Ping responded in 1 attempt(s)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Inject command 'reset'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Successful generic response to command 'reset'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Response status = 0 (0x0) Success.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;blhost -p COM5 get-property 17&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;Ping responded in 1 attempt(s)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Inject command 'get-property'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Response status = 0 (0x0) Success.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Response word 1 = 1 (0x1)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Security State = SECURE&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Samson88_0-1698647100255.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/247384iDB83418067044EA3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Samson88_0-1698647100255.png" alt="Samson88_0-1698647100255.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Samson88_1-1698647121096.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/247385i8550290C556AFAA6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Samson88_1-1698647121096.png" alt="Samson88_1-1698647121096.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 06:27:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-IFR-on-K32L3A/m-p/1748354#M65654</guid>
      <dc:creator>Samson88</dc:creator>
      <dc:date>2023-10-30T06:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to write IFR on K32L3A?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-IFR-on-K32L3A/m-p/1749707#M65659</link>
      <description>&lt;P&gt;To my knowledge the only way to unsecure the device is chip erase or perhaps backdoor key..&lt;/P&gt;&lt;P&gt;0xFFFFFEFF I believe is the byte order.&lt;BR /&gt;&lt;BR /&gt;The documentation often leaves a lot to be desired.&lt;BR /&gt;&lt;BR /&gt;This details the procedure that you are seeking:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.nxp.com/t5/Kinetis-Microcontrollers/Programming-the-K32L3A-MCU-Flash-IFR-Fields/ta-p/1127171" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/Kinetis-Microcontrollers/Programming-the-K32L3A-MCU-Flash-IFR-Fields/ta-p/1127171&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 17:32:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-IFR-on-K32L3A/m-p/1749707#M65659</guid>
      <dc:creator>bobpaddock</dc:creator>
      <dc:date>2023-10-31T17:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to write IFR on K32L3A?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-IFR-on-K32L3A/m-p/1750799#M65667</link>
      <description>&lt;P&gt;Thanks for the reply&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/38376"&gt;@bobpaddock&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I have read the article you linked.&amp;nbsp; The example shown is writing an entire register (FOPT) using a single IFR write to 0x84. It makes sense and it's clear what the bytes/bits mean. But I'm struggling to understand how to write &lt;U&gt;individual bits&lt;/U&gt; in the FSEC register using IFR 0x80-0x83.&lt;/P&gt;&lt;P&gt;Let's take the case of backdoor key to unlock the device (as you suggested).&amp;nbsp; To do that I need to set the backdoor key by writing 8 bytes to IFR&amp;nbsp;0xB0. No problem because it's a "full bytes" type of write, easy to understand. Next I try to set &lt;EM&gt;FSEC:KEYEN&lt;/EM&gt; to 10 by writing IFR 0x83, which is an "individual bits" kind of write, and it doesn't seem to work. See output below.&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;// check that device is unsecure&lt;/P&gt;&lt;P&gt;&lt;EM&gt;blhost -p COM4 -- get-property 17&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Ping responded in 1 attempt(s)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Inject command 'get-property'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Response status = 0 (0x0) Success.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Response word 1 = 0 (0x0)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Security State = UNSECURE&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;// Program FSEC:KEYEN (bits 7:6) to &lt;STRONG&gt;10&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;blhost -p COM4 flash-program-once 0x83 4 FFFFFF&lt;STRONG&gt;B&lt;/STRONG&gt;F&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Ping responded in 1 attempt(s)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Inject command 'flash-program-once'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Successful generic response to command 'flash-program-once'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Response status = 0 (0x0) Success.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;// Program backdoor key to 0xBBBBBBBBBBBBBBBB&lt;/P&gt;&lt;P&gt;&lt;EM&gt;blhost -p COM4 flash-program-once 0xB0 8 BBBBBBBBBBBBBBBB&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Ping responded in 1 attempt(s)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Inject command 'flash-program-once'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Successful generic response to command 'flash-program-once'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Response status = 0 (0x0) Success.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;// Program FSEC:SEC (bits 1:0) to &lt;STRONG&gt;11&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;blhost -p COM4 flash-program-once 0x80 4 FFFFFFF&lt;STRONG&gt;F&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Ping responded in 1 attempt(s)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Inject command 'flash-program-once'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Successful generic response to command 'flash-program-once'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Response status = 0 (0x0) Success.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;// reset so settings will take effect (also tried power cycle)&lt;/P&gt;&lt;P&gt;&lt;EM&gt;blhost -p COM4 reset&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Ping responded in 1 attempt(s)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Inject command 'reset'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Successful generic response to command 'reset'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Response status = 0 (0x0) Success.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;// unlock device with backdoor key&lt;/P&gt;&lt;P&gt;&lt;EM&gt;blhost -p COM4 -- flash-security-disable BBBBBBBBBBBBBBBB&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Ping responded in 1 attempt(s)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Inject command 'flash-security-disable'&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Response status = 103 (0x67) &lt;STRONG&gt;kStatus_FlashAccessError&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 06:27:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-IFR-on-K32L3A/m-p/1750799#M65667</guid>
      <dc:creator>Samson88</dc:creator>
      <dc:date>2023-11-02T06:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to write IFR on K32L3A?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-IFR-on-K32L3A/m-p/1751316#M65669</link>
      <description>The Freescale/NXP implementation of flash write on the M0+ core is always a 32-bit word.&lt;BR /&gt;&lt;BR /&gt;The only way to undo security, besides backdoor, is with a chip erase. Otherwise it would not be very good security.</description>
      <pubDate>Thu, 02 Nov 2023 17:07:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-IFR-on-K32L3A/m-p/1751316#M65669</guid>
      <dc:creator>bobpaddock</dc:creator>
      <dc:date>2023-11-02T17:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to write IFR on K32L3A?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-IFR-on-K32L3A/m-p/1751450#M65670</link>
      <description>&lt;P&gt;Yep, I understand that, which is why I'm trying to use the backdoor key.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also understand the need to write in multiples of 32-bits, the problem is where in that 32-bits do the bits I'm trying to program go? &amp;nbsp; For example when I try to set FSEC KEYEN to 10 (see above)?&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have the IFR write to FSEC:KEYEN correct, why is it not allowing me to unlock using backdoor key?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 23:23:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-IFR-on-K32L3A/m-p/1751450#M65670</guid>
      <dc:creator>Samson88</dc:creator>
      <dc:date>2023-11-02T23:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to write IFR on K32L3A?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-IFR-on-K32L3A/m-p/1755074#M65684</link>
      <description>&lt;P class="lia-align-justify"&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/222522"&gt;@Samson88&lt;/a&gt;,&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Could you please take a look to the following &lt;A href="https://www.nxp.com/docs/en/application-note/AN4507.pdf" target="_self"&gt;AN&lt;/A&gt;? It could be useful.&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Also, have you tried use the &lt;A href="https://community.nxp.com/t5/Kinetis-Microcontrollers/Programming-the-K32L3A-MCU-Flash-IFR-Fields/ta-p/1127171" target="_self"&gt;Option #3: Debugger Script&lt;/A&gt; method?&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Best regards, Raul.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 16:12:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-IFR-on-K32L3A/m-p/1755074#M65684</guid>
      <dc:creator>RaRo</dc:creator>
      <dc:date>2023-11-09T16:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to write IFR on K32L3A?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-IFR-on-K32L3A/m-p/1757375#M65703</link>
      <description>&lt;P&gt;Thanks Raul.&amp;nbsp; Yes, I have already read the AN you pointed me to.&amp;nbsp; It contains useful information but not the specific answer I'm looking for here.&amp;nbsp; Again: what is wrong with the commands I'm using above to unlock device with backdoor key?&amp;nbsp;&lt;/P&gt;&lt;P&gt;NXP cannot provide me a working example of backdoor key using blhost ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seems like for the right Engineer / support person this would be trivial task and only take a few minutes.&lt;/P&gt;&lt;P&gt;Oh well...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 07:14:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-write-IFR-on-K32L3A/m-p/1757375#M65703</guid>
      <dc:creator>Samson88</dc:creator>
      <dc:date>2023-11-15T07:14:29Z</dc:date>
    </item>
  </channel>
</rss>

