<?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: blhost reliable-update command not working in MCU Bootloader</title>
    <link>https://community.nxp.com/t5/MCU-Bootloader/blhost-reliable-update-command-not-working/m-p/1735253#M1422</link>
    <description>&lt;P&gt;Here are the commands I'm using:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;C:\nxp\MCUX_Provi_v7\bin\tools\openssl\1.1.1o\win32&amp;gt;blhost -p COM5 flash-erase-all-unsecure
Ping responded in 1 attempt(s)
Inject command 'flash-erase-all-unsecure'
Successful generic response to command 'flash-erase-all-unsecure'
Response status = 0 (0x0) Success.

C:\nxp\MCUX_Provi_v7\bin\tools\openssl\1.1.1o\win32&amp;gt;blhost -p COM5 write-memory 0x0000 blinky_slow.bin
Ping responded in 1 attempt(s)
Inject command 'write-memory'
Preparing to send 12024 (0x2ef8) bytes to the target.
Successful generic response to command 'write-memory'
(1/1)100% Completed!
Successful generic response to command 'write-memory'
Response status = 0 (0x0) Success.
Wrote 12024 of 12024 bytes.

C:\nxp\MCUX_Provi_v7\bin\tools\openssl\1.1.1o\win32&amp;gt;blhost -p COM5 write-memory 0x80000 blinky_fast.bin
Ping responded in 1 attempt(s)
Inject command 'write-memory'
Preparing to send 12024 (0x2ef8) bytes to the target.
Successful generic response to command 'write-memory'
(1/1)100% Completed!
Successful generic response to command 'write-memory'
Response status = 0 (0x0) Success.
Wrote 12024 of 12024 bytes.

C:\nxp\MCUX_Provi_v7\bin\tools\openssl\1.1.1o\win32&amp;gt;blhost -p COM5 reliable-update 0x7FF00
Ping responded in 1 attempt(s)
Inject command 'reliable-update'
Response status = 10603 (0x296b) kStatus_ReliableUpdateBackupApplicationInvalid&lt;/LI-CODE&gt;</description>
    <pubDate>Sun, 08 Oct 2023 05:29:17 GMT</pubDate>
    <dc:creator>Samson88</dc:creator>
    <dc:date>2023-10-08T05:29:17Z</dc:date>
    <item>
      <title>blhost reliable-update command not working</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/blhost-reliable-update-command-not-working/m-p/1735250#M1421</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to implement reliable update on the FRDM-K32L3A6 board.&amp;nbsp; I have two applications that flash a red LED:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;blinky_slow.bin&lt;/EM&gt;&amp;nbsp; (flashes LED slowly)&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;blinky_fast.bin&lt;/EM&gt;&amp;nbsp;&amp;nbsp; (flashes LED rapidly)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Each of these apps has the Bootloader Configuration Area at address 0x3C0 configured so that ROM bootloader will do a CRC check (see attached pic).&amp;nbsp; If I load the apps individually at start of flash 0x0000, the ROM bootloader CRC check passes and the image boots.&amp;nbsp; Works great for both!&lt;/P&gt;&lt;P&gt;But if I load &lt;EM&gt;blinky_slow.bin&lt;/EM&gt; into lower half of flash at address 0x00000, then I load &lt;EM&gt;blinky_fast.bin&lt;/EM&gt; into upper half of flash at address 0x80000, and issue this command:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;blhost -p COM5 reliable-udpate 0x7FF00 &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I expect this command to swap the upper and lower flash regions such that after reset the backup image in upper flash (&lt;EM&gt;blinky_fast.bin&lt;/EM&gt;) will run.&amp;nbsp; But I get this error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Response status = 10603 (0x296b) kStatus_ReliableUpdateBackupApplicationInvalid&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It seems like the ROM bootloader is checking the CRC of the backup image (&lt;EM&gt;blinky_fast.bin&lt;/EM&gt;) and it fails.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But how can this be?&amp;nbsp; The CRC for &lt;EM&gt;blinky_fast.bin&lt;/EM&gt; passes if I load it into 0x00000.&amp;nbsp; Can "BackupApplicationInvalid" mean something else besides CRC check fail?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;&lt;BR /&gt;Sam&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 03:00:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/blhost-reliable-update-command-not-working/m-p/1735250#M1421</guid>
      <dc:creator>Samson88</dc:creator>
      <dc:date>2023-10-09T03:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: blhost reliable-update command not working</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/blhost-reliable-update-command-not-working/m-p/1735253#M1422</link>
      <description>&lt;P&gt;Here are the commands I'm using:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;C:\nxp\MCUX_Provi_v7\bin\tools\openssl\1.1.1o\win32&amp;gt;blhost -p COM5 flash-erase-all-unsecure
Ping responded in 1 attempt(s)
Inject command 'flash-erase-all-unsecure'
Successful generic response to command 'flash-erase-all-unsecure'
Response status = 0 (0x0) Success.

C:\nxp\MCUX_Provi_v7\bin\tools\openssl\1.1.1o\win32&amp;gt;blhost -p COM5 write-memory 0x0000 blinky_slow.bin
Ping responded in 1 attempt(s)
Inject command 'write-memory'
Preparing to send 12024 (0x2ef8) bytes to the target.
Successful generic response to command 'write-memory'
(1/1)100% Completed!
Successful generic response to command 'write-memory'
Response status = 0 (0x0) Success.
Wrote 12024 of 12024 bytes.

C:\nxp\MCUX_Provi_v7\bin\tools\openssl\1.1.1o\win32&amp;gt;blhost -p COM5 write-memory 0x80000 blinky_fast.bin
Ping responded in 1 attempt(s)
Inject command 'write-memory'
Preparing to send 12024 (0x2ef8) bytes to the target.
Successful generic response to command 'write-memory'
(1/1)100% Completed!
Successful generic response to command 'write-memory'
Response status = 0 (0x0) Success.
Wrote 12024 of 12024 bytes.

C:\nxp\MCUX_Provi_v7\bin\tools\openssl\1.1.1o\win32&amp;gt;blhost -p COM5 reliable-update 0x7FF00
Ping responded in 1 attempt(s)
Inject command 'reliable-update'
Response status = 10603 (0x296b) kStatus_ReliableUpdateBackupApplicationInvalid&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 08 Oct 2023 05:29:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/blhost-reliable-update-command-not-working/m-p/1735253#M1422</guid>
      <dc:creator>Samson88</dc:creator>
      <dc:date>2023-10-08T05:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: blhost reliable-update command not working</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/blhost-reliable-update-command-not-working/m-p/1736065#M1424</link>
      <description>&lt;P&gt;Hello, I reviewed the reference manual to check if that command is supported, unfortunately, the Reliable Update is not supported.&lt;/P&gt;
&lt;P&gt;Page 642.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pavel_Hernandez_0-1696889587321.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/244171i502405A1609A5EC0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Pavel_Hernandez_0-1696889587321.png" alt="Pavel_Hernandez_0-1696889587321.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Pavel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 22:13:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/blhost-reliable-update-command-not-working/m-p/1736065#M1424</guid>
      <dc:creator>Pavel_Hernandez</dc:creator>
      <dc:date>2023-10-09T22:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: blhost reliable-update command not working</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/blhost-reliable-update-command-not-working/m-p/1736269#M1425</link>
      <description>&lt;P&gt;Hello Pavel&lt;/P&gt;&lt;P&gt;Thank you for this information.&amp;nbsp; It's helpful.&amp;nbsp; But actually, I had flash security disabled, so the reliable update command was available.&amp;nbsp; So that was not the cause of the problem.&lt;BR /&gt;&lt;BR /&gt;I found the solution though!&amp;nbsp; I discovered that the ROM bootloader behaves a little differently upon reset than it does when doing a reliable update.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To be specific, I had the CRC start address on the Bootloader Configuration Area (BCA) set to 0x400.&amp;nbsp; In other words, I was telling the bootloader to start the CRC check just after the BCA.&amp;nbsp; When you do a reset, this is allowed.&amp;nbsp; But when doing a reliable update, it is &lt;U&gt;&lt;STRONG&gt;NOT&lt;/STRONG&gt;&lt;/U&gt; allowed.&amp;nbsp; Reliable update requires that the CRC check start at the very beginning of the application (in my case 0x0000). &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So in the BCA, I changed the CRC start address to 0x0000 and increased the CRC byte count to be the size of the whole image (from 0x2AF8 to 2EF8) and this solved it.&amp;nbsp; The reliable-update command now works.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;NOTE:&amp;nbsp; From&amp;nbsp; &lt;SPAN class=""&gt;MCU Bootloader v2.5.0 Reference Manual, Rev. 1, Chapter 12 (Reliable Update), page 154 :&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;the bootloader continues to validate the integrity of the backup&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;application by checking: the following&lt;/EM&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;1. Is crcStartAddress is equal to the start address of the vector table of the application.&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;2. Is crcByteCount (considered as the size of backup application) is less than or equal to&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;the maximum allowed backup application size.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;3. Is the calculated CRC checksum is equal to the checksum provided in backup&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;application, given that the above conditions are met. &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 06:06:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/blhost-reliable-update-command-not-working/m-p/1736269#M1425</guid>
      <dc:creator>Samson88</dc:creator>
      <dc:date>2023-10-10T06:06:13Z</dc:date>
    </item>
  </channel>
</rss>

