<?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: HAB, loading to OCRAM and software update in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/HAB-loading-to-OCRAM-and-software-update/m-p/972772#M144807</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I should add that when I changed the load address, I also changed the address in the CSF [Authenticate Data] section.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Sep 2019 14:07:18 GMT</pubDate>
    <dc:creator>matias_larsson</dc:creator>
    <dc:date>2019-09-11T14:07:18Z</dc:date>
    <item>
      <title>HAB, loading to OCRAM and software update</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/HAB-loading-to-OCRAM-and-software-update/m-p/972771#M144806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We have an i.MX7D and are using HAB on it. I have a couple of questions and hope&amp;nbsp;someone can help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;First question.&amp;nbsp;&lt;/STRONG&gt;We have until now loaded the&amp;nbsp;first-stage&amp;nbsp;bootloader to &lt;STRONG&gt;OCRAM&lt;/STRONG&gt; (0x918000) and booted from there. (This is a custom bootloader for what it's worth mentioning.) When booting a signed bootloader with SRK eFuses burned, we get the&amp;nbsp;&lt;STRONG&gt;HAB_INV_ADDRESS&lt;/STRONG&gt; event with&amp;nbsp;&lt;STRONG&gt;HAB_CTX_TARGET&lt;/STRONG&gt; as context. If I change the linker script so that the bootloader is loaded to DRAM, everything is fine, I get no HAB events. I&amp;nbsp;have checked that&amp;nbsp;the OCRAM address does not overlap with&amp;nbsp;&lt;EM&gt;HAB persistent memory region&amp;nbsp;&lt;/EM&gt;according to&amp;nbsp;&lt;A class="link-titled" href="https://www.nxp.com/docs/en/application-note/AN12263.pdf" title="https://www.nxp.com/docs/en/application-note/AN12263.pdf"&gt;https://www.nxp.com/docs/en/application-note/AN12263.pdf&lt;/A&gt;. One curious thing that I noticed in the event data is that HAB apparently tries to validate the region with a length of 0x10000000. See the event data below.&lt;/P&gt;&lt;P&gt;event data:&lt;BR /&gt; 0xdb 0x00 0x14 0x42 0x33 0x22 0x33 0x00&lt;BR /&gt; 0x00 0x00 0x00 0x0f 0x00 0x91 0x80 0x00&lt;BR /&gt; 0x10 0x00 0x00 0x00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What could be the reason to this behavior from HAB? How does HAB decide the memory region length used in this operation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;By "firmware" I mean whatever the bootloader loads, i.e. non-bootloader software.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Second question.&lt;/STRONG&gt;&amp;nbsp;Do you have any recommendations for how to handle a firmware update?&amp;nbsp;We would like to authenticate the image before flashing and of course before execution. I can come up with at least one solution but I wonder if there's a better/easier way. &lt;STRONG&gt;My&amp;nbsp;solution is as follows&lt;/STRONG&gt;. Make a separate (signed) image of the firmware &lt;EM&gt;updater&lt;/EM&gt; code and load it to a known address in RAM that will not overlap with firmware. Then the new, updated firmware image can be loaded to&amp;nbsp;the authenticated memory region (as specified in the CSF) and we can just call authenticate_image() from the &lt;EM&gt;updater&lt;/EM&gt; code. This way we only need to authenticate the region where we inted to execute the firmware and nothing else. But then we need to maintain this extra&amp;nbsp;&lt;EM&gt;updater&lt;/EM&gt; image and handle its updates somehow as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you think, how should we handle the firmware updates?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matias Larsson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2019 12:59:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/HAB-loading-to-OCRAM-and-software-update/m-p/972771#M144806</guid>
      <dc:creator>matias_larsson</dc:creator>
      <dc:date>2019-09-11T12:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: HAB, loading to OCRAM and software update</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/HAB-loading-to-OCRAM-and-software-update/m-p/972772#M144807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I should add that when I changed the load address, I also changed the address in the CSF [Authenticate Data] section.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2019 14:07:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/HAB-loading-to-OCRAM-and-software-update/m-p/972772#M144807</guid>
      <dc:creator>matias_larsson</dc:creator>
      <dc:date>2019-09-11T14:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: HAB, loading to OCRAM and software update</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/HAB-loading-to-OCRAM-and-software-update/m-p/972773#M144808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; please look at my comments below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; The size of 0x10000000 is very big, generally the CSF file informs about checked areas.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Please double verify the CSF.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; The idea of using special updater looks reasonable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Have a great day,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Yuri&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;-------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Note:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2019 07:47:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/HAB-loading-to-OCRAM-and-software-update/m-p/972773#M144808</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2019-09-12T07:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: HAB, loading to OCRAM and software update</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/HAB-loading-to-OCRAM-and-software-update/m-p/972774#M144809</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;Thank you for your response. Below&amp;nbsp;are&amp;nbsp;the &lt;STRONG&gt;[Authenticate Data]&lt;/STRONG&gt; sections from my CSF files for OCRAM and DRAM. The only difference between the two files is in&amp;nbsp;that section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OCRAM&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[Authenticate Data]
 Verification index = 2
 Blocks = 0x918400 0x400 0x13f8 "preboot.tmp"&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DRAM&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[Authenticate Data]
 Verification index = 2
 Blocks = 0x80001400 0x400 0x13f8 "preboot.tmp"&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are also the &lt;STRONG&gt;boot data&lt;/STRONG&gt;&amp;nbsp;contents as output by the below od command.&lt;/P&gt;&lt;PRE&gt;od -t x4 -j 0x420 -N 0xc bin/preboot-signed.y&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;OCRAM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;00918000 00003800 00000000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DRAM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;80001000 00003800 00000000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;File sizes are as follows.&lt;/P&gt;&lt;P&gt;preboot.tmp:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6136 = 0x17f8 bytes&lt;/P&gt;&lt;P&gt;preboot-signed.y: 14328 = 0x37f8 bytes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't see where the length of 0x10000000 bytes comes from.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About the updater,&amp;nbsp;can you think of some other way than what I suggested to handle a software update so that the image is authenticated by the update process? I'm looking for alternatives, preferably ones that&amp;nbsp;require less effort.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Sep 2019 10:18:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/HAB-loading-to-OCRAM-and-software-update/m-p/972774#M144809</guid>
      <dc:creator>matias_larsson</dc:creator>
      <dc:date>2019-09-16T10:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: HAB, loading to OCRAM and software update</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/HAB-loading-to-OCRAM-and-software-update/m-p/972775#M144810</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;&amp;nbsp; I've sent You some comments directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Yuri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2019 04:58:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/HAB-loading-to-OCRAM-and-software-update/m-p/972775#M144810</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2019-09-17T04:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: HAB, loading to OCRAM and software update</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/HAB-loading-to-OCRAM-and-software-update/m-p/972776#M144811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have come accross another possible solution for firmware update that I'll share in case anyone else interested is reading this. Also any comments would be appreciated. This solution is simpler than the one I presented earlier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the new firmware image is signed, the signed image is also signed, resulting in one "inner" and one "outer" signature. This way the "outer" HAB data blob can contain a different&amp;nbsp;RAM address to authenticate than the inner one. This means that the image to be updated to doesn't have to be loaded to the code entry address. The outer signature has to be discarded at flashing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="double-signature_190917.png"&gt;&lt;IMG alt="double-signature_190917.png" src="https://community.nxp.com/t5/image/serverpage/image-id/87677i34EC5B4E6F2661E6/image-size/large?v=v2&amp;amp;px=999" title="double-signature_190917.png" /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;This idea is still at a very theoretical level but we will take it into consideration at least.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:29:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/HAB-loading-to-OCRAM-and-software-update/m-p/972776#M144811</guid>
      <dc:creator>matias_larsson</dc:creator>
      <dc:date>2020-11-02T14:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: HAB, loading to OCRAM and software update</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/HAB-loading-to-OCRAM-and-software-update/m-p/972777#M144812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can confirm now that this solution works. The trick is to have enough RAM to be able to reserve a region solely for the purpose of authenticating an update image.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2019 11:56:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/HAB-loading-to-OCRAM-and-software-update/m-p/972777#M144812</guid>
      <dc:creator>matias_larsson</dc:creator>
      <dc:date>2019-10-03T11:56:45Z</dc:date>
    </item>
  </channel>
</rss>

