<?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: Signature and encrypt XIP in i.MX RT Crossover MCUs</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Signature-and-encrypt-XIP/m-p/1011025#M6472</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Kerry! I have got all answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Mar 2020 04:57:57 GMT</pubDate>
    <dc:creator>ffloree</dc:creator>
    <dc:date>2020-03-13T04:57:57Z</dc:date>
    <item>
      <title>Signature and encrypt XIP</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Signature-and-encrypt-XIP/m-p/1011021#M6468</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 are running into a problem in RT1052 platform, my software system is &lt;EM&gt;bootloader + application, run as XIP,&lt;/EM&gt; which both reside in flash but not next to each other. After running bootloader, MCU will jump to application area to run.&lt;/P&gt;&lt;P&gt;Bootloader has been encrypted by HAB signature, but which encryption&amp;nbsp;method is available for my application? After reading your AN12079, I have some questions:&lt;/P&gt;&lt;P&gt;1. if BEE encryption (encrypt/decrypt XIP)&amp;nbsp;has been applied&amp;nbsp;on the application,&amp;nbsp;can I download a plain image and debug it in this area by JTAG?&lt;/P&gt;&lt;P&gt;2. Does encrypt XIP happen at bootable image download?&lt;/P&gt;&lt;P&gt;3. If the application is only encrypted by signature, is it&amp;nbsp;possible&amp;nbsp;to make bootloader tell MCU to check the signature before jumping?&lt;/P&gt;&lt;P&gt;I just want to figure out how to encrypt a XIP application, any suggestions? Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2020 09:56:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Signature-and-encrypt-XIP/m-p/1011021#M6468</guid>
      <dc:creator>ffloree</dc:creator>
      <dc:date>2020-03-10T09:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Signature and encrypt XIP</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Signature-and-encrypt-XIP/m-p/1011022#M6469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="308322" data-username="ffloree" href="https://community.nxp.com/people/ffloree" style="color: #3d9ce7; background-color: #ffffff; border: 0px; font-weight: 600; text-decoration: underline; font-size: 11.9994px;"&gt;tom fang&lt;/A&gt;&lt;SPAN style="background-color: #ffffff; color: #646464; "&gt;，&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;1. if BEE encryption (encrypt/decrypt XIP)&amp;nbsp;has been applied&amp;nbsp;on the application,&amp;nbsp;can I download a plain image and debug it in this area by JTAG?&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Answer: If your chip already do the BEE encryption(already set the fuse), the directly debug in the flash through the SWD/JTAG will have problems, so I suggest you download the code with MCUBootUtility tools, which can select the encrypted flash area.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;MCUbootUtility tool download link:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;A href="https://github.com/JayHeng/NXP-MCUBootUtility/archive/v2.2.0.zip"&gt;https://github.com/JayHeng/NXP-MCUBootUtility/archive/v2.2.0.zip&lt;/A&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;the related user manual is:&lt;BR /&gt;&lt;A href="https://github.com/JayHeng/NXP-MCUBootUtility"&gt;https://github.com/JayHeng/NXP-MCUBootUtility&lt;/A&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;2. Does encrypt XIP happen at bootable image download?&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Answer:&amp;nbsp; Encrypted XIP code will be downloaded to your code, then after boot, the code will do the&amp;nbsp;Encrypted XIP boot.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;You can try the MCUbootUtility tool, download the firmware, and readout the flash image, you will know the encrypted image details.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;3. If the application is only encrypted by signature, is it&amp;nbsp;possible&amp;nbsp;to make bootloader tell MCU to check the signature before jumping?&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Answer: If you do the HAB signature, the code should be Non XIP code, which should run in the RAM, you can refer to the&amp;nbsp;AN12681 and&amp;nbsp;&lt;SPAN&gt;AN12079, you can find the flashloader also need to do the signed operation at first.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN&gt;If you want to just do the app firmware encrypted, you can use the&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;MCUbootUtility&amp;nbsp;tool just select the related app image address do the BEE encrypted operation.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="background-color: #ffffff; "&gt;Wish it helps you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="background-color: #ffffff; "&gt;If you still have questions about it, please kindly let me know.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&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;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2020 07:04:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Signature-and-encrypt-XIP/m-p/1011022#M6469</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2020-03-11T07:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Signature and encrypt XIP</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Signature-and-encrypt-XIP/m-p/1011023#M6470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry, good to see you again! Thanks for your answers, I have been using NXP-MCUBootUtility and reading AN12079,&amp;nbsp;based on your answers, still many confusing here.&lt;/P&gt;&lt;P&gt;1. This is my understanding of XIP encryption process, is it correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 1) PC side: an unsigned image (plain image) -&amp;gt;add&amp;nbsp;BEE configuration-&amp;gt;.sb file (it isn't encrypted)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 2) download process: .sb file is being downloaded to flash, but data belonging to the ranges of BEE&amp;nbsp;indicated will be encrypted while writing, so the file in flash would be different from the original one ( in step 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 3) bootup process: after a reboot, MCU will run the image, but once it runs code belonging to the special ranges must be decrypted firstly.&lt;/P&gt;&lt;P&gt;2. My bootloader did have done the HAB signature and run in flash as XIP, yes, flashloader was signed as well, but it did run as XIP. So according to your answers, it seems APP couldn't do signature encryption, because it needs a signed flashloader to work together, and only ROM code can do that, am I right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2020 08:35:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Signature-and-encrypt-XIP/m-p/1011023#M6470</guid>
      <dc:creator>ffloree</dc:creator>
      <dc:date>2020-03-11T08:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Signature and encrypt XIP</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Signature-and-encrypt-XIP/m-p/1011024#M6471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="308322" data-username="ffloree" href="https://community.nxp.com/people/ffloree" style="color: #3d9ce7; background-color: #ffffff; border: 0px; font-weight: 200; text-decoration: underline; font-size: 1.286rem;"&gt;tom fang&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Glad to see you, you are always welcome!&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Answer your questions:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;1. This is my understanding of XIP encryption process, is it correct?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; &amp;nbsp; 1) PC side: an unsigned image (plain image) -&amp;gt;add&amp;nbsp;BEE configuration-&amp;gt;.sb file (it isn't encrypted)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; &amp;nbsp; 2) download process: .sb file is being downloaded to flash, but data belonging to the ranges of BEE&amp;nbsp;indicated will be encrypted while writing, so the file in flash would be different from the original one ( in step 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; &amp;nbsp; 3) bootup process: after a reboot, MCU will run the image, but once it runs code belonging to the special ranges must be decrypted firstly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Answer: The PC side use the unsigned image, then it should add the BEE encrypted code, then download the encrypted code directly. You have checked&amp;nbsp;AN12079, you can find when generate the .sb files, it is using:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;elftosb.exe -f kinetis -V -c program_flexspinor_image_hyperflash_encrypt.bd -o boot_image.sb ivt_application_unsigned_nopadding.bin&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;It means, the boot_image.sb already the encrypted code, then use the MFGtool, just need to download the code.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&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/100076iCED6315F0AE800E3/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 style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;You can find when do the download, it just download&amp;nbsp; the&amp;nbsp;flashloader, the fuse and the .sb files.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;This is my understanding. If you have the interest, you also can try the BEE encrypted operation details, then check each steps generated files, and compare with your last downloaded and flash readout memory. You can check my HAB operation process, may useful to your understanding:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;A href="https://community.nxp.com/docs/DOC-344919"&gt;RT1050 HAB Encrypted Image Generation and Analysis&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;BEE is simliar.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp; When do the BEE boot, the spcial ranges which is encrypted must do decrypted at first. BEE is runing while decrypted directly. Not like the HAB encrypted, which will copy to the internal RAM, and do the decrypted, then run from RAM driectly.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;2. My bootloader did have done the HAB signature and run in flash as XIP, yes, flashloader was signed as well, but it did run as XIP. So according to your answers, it seems APP couldn't do signature encryption, because it needs a signed flashloader to work together, and only ROM code can do that, am I right?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Answer:&amp;nbsp; Please note, HAB signature and encrypted just to the Non XIP code. If it is the XIP code, you need to use the BEE. Non XIP code means the real app code in the internal RAM. The signed flashloader needs the ROM code to do it.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Wish it helps you!&lt;/P&gt;&lt;DIV style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;&lt;DIV class="" style="border: 0px; font-weight: inherit; margin: 20px 0px;"&gt;&lt;P style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&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;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV class="" style="border: 0px; font-weight: inherit; font-size: 14px; margin: 20px 0px 0px;"&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2020 04:32:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Signature-and-encrypt-XIP/m-p/1011024#M6471</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2020-03-12T04:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Signature and encrypt XIP</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Signature-and-encrypt-XIP/m-p/1011025#M6472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Kerry! I have got all answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2020 04:57:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Signature-and-encrypt-XIP/m-p/1011025#M6472</guid>
      <dc:creator>ffloree</dc:creator>
      <dc:date>2020-03-13T04:57:57Z</dc:date>
    </item>
  </channel>
</rss>

