<?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 A/B swap bootloader. Update/Erase Firmware header in S32K</title>
    <link>https://community.nxp.com/t5/S32K/A-B-swap-bootloader-Update-Erase-Firmware-header/m-p/1213318#M9628</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="firware_updates.PNG" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/135055iBCB676AE00D98497/image-size/large?v=v2&amp;amp;px=999" role="button" title="firware_updates.PNG" alt="firware_updates.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This Update_FW_header() function is from s32k144_fota_bootloader for A/B bootloder functionality.&lt;/P&gt;&lt;P&gt;My question is that why has been old firmware header erased two times???&amp;nbsp;&lt;/P&gt;&lt;P&gt;AND&lt;/P&gt;&lt;P&gt;we are downloading firmware to flash_new_address_block so we need to erase the header present at this address(means flash_new_address_block).Erasing the header at this address is done by 1st erase function which is correct but 2nd erase function is erasing header of firmware where we are not updating new firmware so there is no need to erase the header.&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jan 2021 11:49:26 GMT</pubDate>
    <dc:creator>kishore_nxp</dc:creator>
    <dc:date>2021-01-18T11:49:26Z</dc:date>
    <item>
      <title>A/B swap bootloader. Update/Erase Firmware header</title>
      <link>https://community.nxp.com/t5/S32K/A-B-swap-bootloader-Update-Erase-Firmware-header/m-p/1213318#M9628</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="firware_updates.PNG" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/135055iBCB676AE00D98497/image-size/large?v=v2&amp;amp;px=999" role="button" title="firware_updates.PNG" alt="firware_updates.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This Update_FW_header() function is from s32k144_fota_bootloader for A/B bootloder functionality.&lt;/P&gt;&lt;P&gt;My question is that why has been old firmware header erased two times???&amp;nbsp;&lt;/P&gt;&lt;P&gt;AND&lt;/P&gt;&lt;P&gt;we are downloading firmware to flash_new_address_block so we need to erase the header present at this address(means flash_new_address_block).Erasing the header at this address is done by 1st erase function which is correct but 2nd erase function is erasing header of firmware where we are not updating new firmware so there is no need to erase the header.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 11:49:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/A-B-swap-bootloader-Update-Erase-Firmware-header/m-p/1213318#M9628</guid>
      <dc:creator>kishore_nxp</dc:creator>
      <dc:date>2021-01-18T11:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: A/B swap bootloader. Update/Erase Firmware header</title>
      <link>https://community.nxp.com/t5/S32K/A-B-swap-bootloader-Update-Erase-Firmware-header/m-p/1217830#M9658</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, I'm working from home and I do not have the equipment to debug the code, however:&lt;/P&gt;
&lt;P&gt;When you check the code you can see that the "Flash_Block_to_Update();" function is called for the first time. This function set&amp;nbsp;&lt;EM&gt;flash_new_image_address_block&lt;/EM&gt; and &lt;EM&gt;flash_old_image_address_block&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;So, in the "&lt;SPAN&gt;Update_FW_header()&lt;/SPAN&gt;" is not erased the same address two times&lt;/P&gt;
&lt;DIV id="tinyMceEditordianabatrlova_4" 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="dianabatrlova_0-1611134161913.png" style="width: 626px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/135288i5AC3A86421CB3D0F/image-dimensions/626x168?v=v2" width="626" height="168" role="button" title="dianabatrlova_0-1611134161913.png" alt="dianabatrlova_0-1611134161913.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The functionality is described in the &lt;A href="https://www.nxp.com/docs/en/application-note/AN12323.pdf" target="_self"&gt;AN12323&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dianabatrlova_1-1611135472319.png" style="width: 561px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/135289iDB73C2DDC8C5525B/image-dimensions/561x226?v=v2" width="561" height="226" role="button" title="dianabatrlova_1-1611135472319.png" alt="dianabatrlova_1-1611135472319.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;gt;Erasing the header at this address is done by 1st erase function which is correct but 2nd erase function is erasing header of firmware where we are not updating new firmware so there is no need to erase the header.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Since the app key is stored at the end address of the latest fw header the oldest header is erased.&lt;/P&gt;
&lt;P&gt;After that, you can recognize the new one fw from the old one fw. However, the SW is counting with the case that both fw headers have app key as is described in the above excerpt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is just an example project and you can modify it as you need according to your application requirements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope it helps.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Diana&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 09:55:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/A-B-swap-bootloader-Update-Erase-Firmware-header/m-p/1217830#M9658</guid>
      <dc:creator>dianabatrlova</dc:creator>
      <dc:date>2021-01-20T09:55:49Z</dc:date>
    </item>
  </channel>
</rss>

