<?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: KL03 ROM bootloader inconsistent behavior in MCU Bootloader</title>
    <link>https://community.nxp.com/t5/MCU-Bootloader/KL03-ROM-bootloader-inconsistent-behavior/m-p/649691#M279</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mr.&amp;nbsp;Santiago J. González Fabián has just let me know about &lt;A href="http://www.nxp.com/assets/documents/data/en/errata/KL03Z_1N86K.pdf"&gt;errata ID 8060&lt;/A&gt; which is the likely culprit here. Looks like I will have to explicitly retry to work around this bug. Thanks a ton, Santiago!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 May 2017 13:39:43 GMT</pubDate>
    <dc:creator>laszlomonda</dc:creator>
    <dc:date>2017-05-23T13:39:43Z</dc:date>
    <item>
      <title>KL03 ROM bootloader inconsistent behavior</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/KL03-ROM-bootloader-inconsistent-behavior/m-p/649690#M278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm running the ROM bootloader of the&amp;nbsp;MKL03Z32VFK4 and noticed something very weird. The first time I run the "blhost --usb --buspal i2c -d flash-erase-all-unsecure"&amp;nbsp;command, it fails, but the second time it succeeds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st blhost invocation:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;$ blhost --usb --buspal i2c -d flash-erase-all-unsecure&lt;BR /&gt;Inject pre-config command 'i2c'&lt;BR /&gt;[01 00 0c 00 c1 00 00 02 10 00 00 00 64 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 c1 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 'i2c'&lt;BR /&gt; - took 0.000 seconds&lt;BR /&gt;Response status = 0 (0x0) Success.&lt;BR /&gt;Inject command 'flash-erase-all-unsecure'&lt;BR /&gt;[01 00 04 00 0d 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 00 00 0d 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&amp;gt;&lt;BR /&gt;usbhid: received data phase abort&lt;BR /&gt;&amp;lt;&amp;gt;&lt;BR /&gt;sendCommandGetResponse.readPacket error 5.&lt;BR /&gt;processResponse: null packet&lt;BR /&gt; - took 0.000 seconds&lt;BR /&gt;Response status = 10004 (0x2714) No response packet from target device.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;2nd blhost invocation:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;$ blhost --usb --buspal i2c -d flash-erase-all-unsecure&lt;BR /&gt;Inject pre-config command 'i2c'&lt;BR /&gt;[01 00 0c 00 c1 00 00 02 10 00 00 00 64 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 c1 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 'i2c'&lt;BR /&gt; - took 0.000 seconds&lt;BR /&gt;Response status = 0 (0x0) Success.&lt;BR /&gt;Inject command 'flash-erase-all-unsecure'&lt;BR /&gt;[01 00 04 00 0d 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 0d 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 'flash-erase-all-unsecure'&lt;BR /&gt; - took 0.000 seconds&lt;BR /&gt;Response status = 0 (0x0) Success.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I've put the I2C protocol dump of the first and second blhost invocations side by side. Please note that the first invocation is directly followed by the second invocation. There is no extra communication in between.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="blhost-dump.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14162iC90A9E4107FC2F72/image-size/large?v=v2&amp;amp;px=999" role="button" title="blhost-dump.png" alt="blhost-dump.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to the above, the KL03 ROM bootloader fails to answer the first invocation but works perfectly for the second invocation. Upon subsequent calls, this pattern continues:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;KL03 ROM bootloader starts up&lt;/LI&gt;&lt;LI&gt;blhost --usb --buspal i2c -d flash-erase-all-unsecure -&amp;gt; FAIL&lt;/LI&gt;&lt;LI&gt;blhost --usb --buspal i2c -d flash-erase-all-unsecure -&amp;gt; SUCCESS&lt;/LI&gt;&lt;LI&gt;blhost --usb --buspal i2c -d flash-erase-all-unsecure -&amp;gt; FAIL&lt;/LI&gt;&lt;LI&gt;blhost --usb --buspal i2c -d flash-erase-all-unsecure -&amp;gt; SUCCESS&lt;/LI&gt;&lt;LI&gt;blhost --usb --buspal i2c -d flash-erase-all-unsecure -&amp;gt; FAIL&lt;/LI&gt;&lt;LI&gt;blhost --usb --buspal i2c -d flash-erase-all-unsecure -&amp;gt; SUCCESS&lt;/LI&gt;&lt;LI&gt;...&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lastly, I must also note&amp;nbsp;that I had to &lt;A href="https://github.com/UltimateHackingKeyboard/firmware/blob/f46832d840beab6752f6067ddee6051f8733515d/right/src/buspal/command.c#L509-L510"&gt;add 2 lines of code to BusPal&lt;/A&gt; to go this far. Without the extra read that I added, it always fails because it considers the extra 0 byte that the bootloader sends part of the framing packet. According to the protocol documentation, "0x00 will be sent as the response to host if the target is busy with processing or&lt;BR /&gt;preparing data", so it seems to be legit, but it's a bit strange that it's always sent, even when the communication speed is set to 1kHz in which case the bootloader should have plenty of time to do processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please somebody explain the above to me. I need the bootloader to behave consistently, and I cannot give any meaningful explanation other than the KL03 ROM bootloader is buggy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;- Laci&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Apr 2017 01:00:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/KL03-ROM-bootloader-inconsistent-behavior/m-p/649690#M278</guid>
      <dc:creator>laszlomonda</dc:creator>
      <dc:date>2017-04-28T01:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: KL03 ROM bootloader inconsistent behavior</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/KL03-ROM-bootloader-inconsistent-behavior/m-p/649691#M279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mr.&amp;nbsp;Santiago J. González Fabián has just let me know about &lt;A href="http://www.nxp.com/assets/documents/data/en/errata/KL03Z_1N86K.pdf"&gt;errata ID 8060&lt;/A&gt; which is the likely culprit here. Looks like I will have to explicitly retry to work around this bug. Thanks a ton, Santiago!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2017 13:39:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/KL03-ROM-bootloader-inconsistent-behavior/m-p/649691#M279</guid>
      <dc:creator>laszlomonda</dc:creator>
      <dc:date>2017-05-23T13:39:43Z</dc:date>
    </item>
  </channel>
</rss>

