<?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 Factory Flashloader + SB File with Reset Command in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Factory-Flashloader-SB-File-with-Reset-Command/m-p/694810#M42780</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just received some PCBs with KM22F512VLH12 microcontrollers. I'm figuring out how to use the RAM based Flashloader (the bootloader that comes from factory) in order to make our production process easier and I stepped into a possible bug (on the Flashloader or one of the tools I'll describe).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm currently using Windows 10 64b, so the two tools I'm using (elftosb and blhost) are the binaries that came with the KBOOT package (FSL_Kinetis_Bootloader_2.0.0.zip).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before the boards went to production, I emulated the Flashloader using the flashloader and flashloader_loader provided by the KBOOT package. My objective was:&lt;/P&gt;&lt;P&gt;1. Use the elftosb to create a SB file that would: erase the flash, program my application, reset the microcontroller so my application would start.&lt;/P&gt;&lt;P&gt;2. Use the blhost to "send" the SB file to the Flashloader over an USB-HID connection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The command file sent to build the SB file with my application is quite simple:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;sources {&lt;BR /&gt;app_file = extern(0);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// create a section&lt;BR /&gt;section (0) {&lt;BR /&gt;erase 0x0000000..0x0080000; //erase the whole memory&lt;BR /&gt;load app_file &amp;gt; 0x00000000; // load the application&amp;nbsp;to the beginning of the memory&lt;BR /&gt;reset;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is how I create the SB file:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;elftosb.exe -o app.sb -c commands.txt app.bin&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is how I send the SB file to the flashloader:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;blhost.exe -u 0x15a2,0x0073 receive-sb-file app.sb&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is what the blhost shows me:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Inject command 'receive-sb-file'&lt;BR /&gt;Preparing to send 85776 (0x14f10) bytes to the target.&lt;BR /&gt;Successful generic response to command 'receive-sb-file'&lt;BR /&gt;(1/1)99%usb hid detected receiver data abort&lt;BR /&gt;Data phase write aborted by status 0x2712 kStatus_AbortDataPhase&lt;BR /&gt;Possible JUMP or RESET command received.&lt;BR /&gt;Response status = 10107 (0x277b) kStatusRomLdrUnknownCommand&lt;BR /&gt;Wrote 85760 of 85776 bytes.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This means the reset command in the SB file is not recognized by the Flashloader, but the application was written to the memory, thus the microcontroller is still in "Flashloader mode". If I force a reset using the following command, the application starts correctly.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;blhost.exe -u 0x15a2,0x0073 reset&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I got a new board (also "virgin", as it came from factory) and tried to send a SB file with *just* the RESET command. That means I used the elftosb with the following command file:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;sources {&lt;BR /&gt;file = extern(0);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;section(0) {&lt;BR /&gt;reset;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The following message was printed by the blhost tool (similar command line command was used):&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Inject command 'receive-sb-file'&lt;BR /&gt;Preparing to send 176 (0xb0) bytes to the target.&lt;BR /&gt;Successful generic response to command 'receive-sb-file'&lt;BR /&gt;(1/1)90%usb hid detected receiver data abort&lt;BR /&gt;Data phase write aborted by status 0x2712 kStatus_AbortDataPhase&lt;BR /&gt;Possible JUMP or RESET command received.&lt;BR /&gt;Response status = 10107 (0x277b) kStatusRomLdrUnknownCommand&lt;BR /&gt;Wrote 160 of 176 bytes.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So I ran the blhost with the debug (-d) flag and got the following&amp;nbsp;messages printed:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Inject command 'receive-sb-file'&lt;BR /&gt;Preparing to send 176 (0xb0) bytes to the target.&lt;BR /&gt;[01 00 08 00 08 01 00 01 b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]&lt;BR /&gt;&amp;lt;03 00 0c 00 a0 00 00 02 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&amp;gt;&lt;BR /&gt;Successful generic response to command 'receive-sb-file'&lt;BR /&gt;&amp;lt;&amp;gt;&lt;BR /&gt;[02 00 20 00 e9 fa e7 22 fa b2 5f a9 16 e6 89 2b d1 c3 3d 91 5b 62 b7 04 53 54 4d 50 01 02 00 00 0b 00 00 00]&lt;BR /&gt;(1/1)18%&amp;lt;&amp;gt;&lt;BR /&gt;[02 00 20 00 07 00 00 00 00 00 00 00 00 00 07 00 06 00 01 00 01 00 43 3f 73 67 74 6c 80 f8 ca 3a 70 fb 01 00]&lt;BR /&gt;(1/1)36%&amp;lt;&amp;gt;&lt;BR /&gt;[02 00 20 00 09 99 00 00 09 99 00 00 09 99 00 00 09 99 00 00 09 99 00 00 09 99 00 00 00 00 fc a4 87 73 4d 54]&lt;BR /&gt;(1/1)54%&amp;lt;&amp;gt;&lt;BR /&gt;[02 00 20 00 00 00 00 00 08 00 00 00 01 00 00 00 01 00 00 00 5e 01 01 00 00 00 00 00 01 00 00 00 01 00 00 00]&lt;BR /&gt;(1/1)72%&amp;lt;&amp;gt;&lt;BR /&gt;[02 00 20 00 62 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9a f9 dc 18 57 57 ab b5 1c fe 9e 76 6a ff 06 e1]&lt;BR /&gt;(1/1)90%&amp;lt;03 00 00 00 62 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9a f9 dc 18 57 57 ab b5 1c fe 9e 76 6a ff 06 e1&amp;gt;&lt;BR /&gt;usb hid detected receiver data abort&lt;BR /&gt;Data phase write aborted by status 0x2712 kStatus_AbortDataPhase&lt;BR /&gt;Possible JUMP or RESET command received.&lt;BR /&gt;&amp;lt;03 00 0c 00 a0 00 00 02 7b 27 00 00 08 00 00 00 00 00 00 00 9a f9 dc 18 57 57 ab b5 1c fe 9e 76 6a ff 06 e1&amp;gt;&lt;BR /&gt; - took 0.117 seconds&lt;BR /&gt;Response status = 10107 (0x277b) kStatusRomLdrUnknownCommand&lt;BR /&gt;Wrote 160 of 176 bytes.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The reset command sent by the blhost directly (without a SB file) prints the following message (with -d flag):&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Inject command 'reset'&lt;BR /&gt;[01 00 04 00 0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]&lt;BR /&gt;&amp;lt;03 00 0c 00 a0 00 00 02 00 00 00 00 0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&amp;gt;&lt;BR /&gt;Successful generic response to command 'reset'&lt;BR /&gt; - took 0.021 seconds&lt;BR /&gt;Response status = 0 (0x0) Success.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same reset SB File works as expected with the flashloader from the KBOOT package, as well as with the FLASH based Bootloader.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Summary: reset command from a SB file to the factory flashloader doesn't &amp;nbsp;work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on where is the problem?&lt;/P&gt;&lt;P&gt;Is the elftosb creating a faulty SB file? Then the Flash based bootloader wouldn't work.&lt;/P&gt;&lt;P&gt;Is the blhost sending wrong commands to the microcontroller? The the Flash based bootloader wouldn't work too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I currently believe this is a problem with the factory bootloader.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Bruno Albrecht&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Sep 2017 13:25:24 GMT</pubDate>
    <dc:creator>brunoalbrecht</dc:creator>
    <dc:date>2017-09-05T13:25:24Z</dc:date>
    <item>
      <title>Factory Flashloader + SB File with Reset Command</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Factory-Flashloader-SB-File-with-Reset-Command/m-p/694810#M42780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just received some PCBs with KM22F512VLH12 microcontrollers. I'm figuring out how to use the RAM based Flashloader (the bootloader that comes from factory) in order to make our production process easier and I stepped into a possible bug (on the Flashloader or one of the tools I'll describe).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm currently using Windows 10 64b, so the two tools I'm using (elftosb and blhost) are the binaries that came with the KBOOT package (FSL_Kinetis_Bootloader_2.0.0.zip).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before the boards went to production, I emulated the Flashloader using the flashloader and flashloader_loader provided by the KBOOT package. My objective was:&lt;/P&gt;&lt;P&gt;1. Use the elftosb to create a SB file that would: erase the flash, program my application, reset the microcontroller so my application would start.&lt;/P&gt;&lt;P&gt;2. Use the blhost to "send" the SB file to the Flashloader over an USB-HID connection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The command file sent to build the SB file with my application is quite simple:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;sources {&lt;BR /&gt;app_file = extern(0);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// create a section&lt;BR /&gt;section (0) {&lt;BR /&gt;erase 0x0000000..0x0080000; //erase the whole memory&lt;BR /&gt;load app_file &amp;gt; 0x00000000; // load the application&amp;nbsp;to the beginning of the memory&lt;BR /&gt;reset;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is how I create the SB file:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;elftosb.exe -o app.sb -c commands.txt app.bin&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is how I send the SB file to the flashloader:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;blhost.exe -u 0x15a2,0x0073 receive-sb-file app.sb&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is what the blhost shows me:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Inject command 'receive-sb-file'&lt;BR /&gt;Preparing to send 85776 (0x14f10) bytes to the target.&lt;BR /&gt;Successful generic response to command 'receive-sb-file'&lt;BR /&gt;(1/1)99%usb hid detected receiver data abort&lt;BR /&gt;Data phase write aborted by status 0x2712 kStatus_AbortDataPhase&lt;BR /&gt;Possible JUMP or RESET command received.&lt;BR /&gt;Response status = 10107 (0x277b) kStatusRomLdrUnknownCommand&lt;BR /&gt;Wrote 85760 of 85776 bytes.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This means the reset command in the SB file is not recognized by the Flashloader, but the application was written to the memory, thus the microcontroller is still in "Flashloader mode". If I force a reset using the following command, the application starts correctly.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;blhost.exe -u 0x15a2,0x0073 reset&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I got a new board (also "virgin", as it came from factory) and tried to send a SB file with *just* the RESET command. That means I used the elftosb with the following command file:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;sources {&lt;BR /&gt;file = extern(0);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;section(0) {&lt;BR /&gt;reset;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The following message was printed by the blhost tool (similar command line command was used):&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Inject command 'receive-sb-file'&lt;BR /&gt;Preparing to send 176 (0xb0) bytes to the target.&lt;BR /&gt;Successful generic response to command 'receive-sb-file'&lt;BR /&gt;(1/1)90%usb hid detected receiver data abort&lt;BR /&gt;Data phase write aborted by status 0x2712 kStatus_AbortDataPhase&lt;BR /&gt;Possible JUMP or RESET command received.&lt;BR /&gt;Response status = 10107 (0x277b) kStatusRomLdrUnknownCommand&lt;BR /&gt;Wrote 160 of 176 bytes.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So I ran the blhost with the debug (-d) flag and got the following&amp;nbsp;messages printed:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Inject command 'receive-sb-file'&lt;BR /&gt;Preparing to send 176 (0xb0) bytes to the target.&lt;BR /&gt;[01 00 08 00 08 01 00 01 b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]&lt;BR /&gt;&amp;lt;03 00 0c 00 a0 00 00 02 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&amp;gt;&lt;BR /&gt;Successful generic response to command 'receive-sb-file'&lt;BR /&gt;&amp;lt;&amp;gt;&lt;BR /&gt;[02 00 20 00 e9 fa e7 22 fa b2 5f a9 16 e6 89 2b d1 c3 3d 91 5b 62 b7 04 53 54 4d 50 01 02 00 00 0b 00 00 00]&lt;BR /&gt;(1/1)18%&amp;lt;&amp;gt;&lt;BR /&gt;[02 00 20 00 07 00 00 00 00 00 00 00 00 00 07 00 06 00 01 00 01 00 43 3f 73 67 74 6c 80 f8 ca 3a 70 fb 01 00]&lt;BR /&gt;(1/1)36%&amp;lt;&amp;gt;&lt;BR /&gt;[02 00 20 00 09 99 00 00 09 99 00 00 09 99 00 00 09 99 00 00 09 99 00 00 09 99 00 00 00 00 fc a4 87 73 4d 54]&lt;BR /&gt;(1/1)54%&amp;lt;&amp;gt;&lt;BR /&gt;[02 00 20 00 00 00 00 00 08 00 00 00 01 00 00 00 01 00 00 00 5e 01 01 00 00 00 00 00 01 00 00 00 01 00 00 00]&lt;BR /&gt;(1/1)72%&amp;lt;&amp;gt;&lt;BR /&gt;[02 00 20 00 62 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9a f9 dc 18 57 57 ab b5 1c fe 9e 76 6a ff 06 e1]&lt;BR /&gt;(1/1)90%&amp;lt;03 00 00 00 62 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9a f9 dc 18 57 57 ab b5 1c fe 9e 76 6a ff 06 e1&amp;gt;&lt;BR /&gt;usb hid detected receiver data abort&lt;BR /&gt;Data phase write aborted by status 0x2712 kStatus_AbortDataPhase&lt;BR /&gt;Possible JUMP or RESET command received.&lt;BR /&gt;&amp;lt;03 00 0c 00 a0 00 00 02 7b 27 00 00 08 00 00 00 00 00 00 00 9a f9 dc 18 57 57 ab b5 1c fe 9e 76 6a ff 06 e1&amp;gt;&lt;BR /&gt; - took 0.117 seconds&lt;BR /&gt;Response status = 10107 (0x277b) kStatusRomLdrUnknownCommand&lt;BR /&gt;Wrote 160 of 176 bytes.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The reset command sent by the blhost directly (without a SB file) prints the following message (with -d flag):&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Inject command 'reset'&lt;BR /&gt;[01 00 04 00 0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]&lt;BR /&gt;&amp;lt;03 00 0c 00 a0 00 00 02 00 00 00 00 0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&amp;gt;&lt;BR /&gt;Successful generic response to command 'reset'&lt;BR /&gt; - took 0.021 seconds&lt;BR /&gt;Response status = 0 (0x0) Success.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same reset SB File works as expected with the flashloader from the KBOOT package, as well as with the FLASH based Bootloader.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Summary: reset command from a SB file to the factory flashloader doesn't &amp;nbsp;work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on where is the problem?&lt;/P&gt;&lt;P&gt;Is the elftosb creating a faulty SB file? Then the Flash based bootloader wouldn't work.&lt;/P&gt;&lt;P&gt;Is the blhost sending wrong commands to the microcontroller? The the Flash based bootloader wouldn't work too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I currently believe this is a problem with the factory bootloader.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Bruno Albrecht&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2017 13:25:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Factory-Flashloader-SB-File-with-Reset-Command/m-p/694810#M42780</guid>
      <dc:creator>brunoalbrecht</dc:creator>
      <dc:date>2017-09-05T13:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Factory Flashloader + SB File with Reset Command</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Factory-Flashloader-SB-File-with-Reset-Command/m-p/694811#M42781</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;First of all, sorry for the later reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do a similar test with TWR-K22F120M board.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&amp;gt;&amp;nbsp; I use [flashloader_loader.srec] image located at ..\NXP_Kinetis_Bootloader_2_0_0\targets\MK22F51212\iar\binaries folder pre-programmed to MK22FN512VMC12 chip.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2&amp;gt; Then, I select to use the led_demo image file &amp;lt;led_demo_tower_0000.bin&amp;gt;, which located at ..\NXP_Kinetis_Bootloader_2_0_0\apps\led_demo\MK22F51212\iar\binaries as my application file.&lt;/P&gt;&lt;P&gt;I modify the &amp;lt;led_demo_tower_0000.bin&amp;gt; file name to &amp;lt;app.bin&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3&amp;gt; I use the same command file and named to &amp;lt;commands.txt&amp;gt;&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/28270i2B98559DDA898E60/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;/P&gt;&lt;P&gt;4&amp;gt; After that, using [elftosb.exe] tool to generate the attached &amp;lt;app.sb&amp;gt; file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5&amp;gt; Using the [blhost.exe] tool to load the &amp;lt;app.sb&amp;gt; file to&amp;nbsp; MK22FN512VMC12&amp;nbsp; chip.&lt;/P&gt;&lt;P&gt;I checked the MK22FN512VMC12&amp;nbsp; chip reference manual, the Flashloader doesn't support USB port.&lt;/P&gt;&lt;P&gt;So, I select to use UART port to load the &amp;lt;app.sb&amp;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/28315iABB38165AB30FE41/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;Please check the result below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/28364iF58CC17428D1AD72/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;There "Wrote 2144 of 2192 bytes".&lt;/P&gt;&lt;P&gt;I check the TWR-K22F120M board, the boards leds start to blink alternately.&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/28412iFFB8F0C6765D6607/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_6.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/28461i80A0B8ADB414A3A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_6.png" alt="pastedImage_6.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_7.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/28498i411EC4BE217A38BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_7.png" alt="pastedImage_7.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_8.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/28549i1E2A052224F7B93C/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_8.png" alt="pastedImage_8.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reset command works as expected.&lt;/P&gt;&lt;P&gt;Thank you for the attention.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ma Hui&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, 08 Sep 2017 07:38:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Factory-Flashloader-SB-File-with-Reset-Command/m-p/694811#M42781</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2017-09-08T07:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Factory Flashloader + SB File with Reset Command</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Factory-Flashloader-SB-File-with-Reset-Command/m-p/694812#M42782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Hui_Ma for your answer.&lt;/P&gt;&lt;P&gt;As I said in my post:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;The same reset SB File works as expected with the flashloader from the KBOOT package, as well as with the FLASH based Bootloader.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6; color: #3d3d3d;"&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked the flashloader version that came with the microcontroller from factory and it says 1.5.1. The version from the KBOOT package is 2.0.0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess the older version don't understand the reset command in a SB file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The workaround is to send a reset command directly with the blhost application, so instead of just one command to send the SB file, I'll have two.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2017 08:45:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Factory-Flashloader-SB-File-with-Reset-Command/m-p/694812#M42782</guid>
      <dc:creator>brunoalbrecht</dc:creator>
      <dc:date>2017-09-08T08:45:22Z</dc:date>
    </item>
  </channel>
</rss>

