<?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 MXRT1020 usb device on internal flexspi, secure source code part on flexspi in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/MXRT1020-usb-device-on-internal-flexspi-secure-source-code-part/m-p/1383343#M184133</link>
    <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Hello. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;The task is to make it possible to run the application on the imxt1020 board. The source code will be placed in the first half of the flash(internal flexspi), the second half will be available via usb (phat file system). I did this part using examples with the file system and creating a USB device. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;The second part of the task is to encrypt the flash area with the source code(encrypt only half flexspi internal flash). Using &lt;A href="https://github.com/JayHeng/NXP-MCUBootUtility" target="_blank" rel="noopener"&gt;https://github.com/JayHeng/NXP-MCUBootUtility&lt;/A&gt; and the NXP-MCUBootUtility app started to figure it out. Based on the description, in order to encrypt only part of the flash, I need to use BEE / OTFAD encryption. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Tried to download from &lt;A href="https://www.cnblogs.com/henjay724/p/10189602.html" target="_blank" rel="noopener"&gt;https://www.cnblogs.com/henjay724/p/10189602.html&lt;/A&gt; image_enc and image_enc2. Nothing comes out. Can you provide access to these archives? &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;The next question is why is the Windows application used for flashing the board and encrypting the uboot? I work on the Linux platform, now I have not found a way, except how to use a script to flash the board: 1)./sdphost -t 50000 -p / dev / ttyACM0,115200 write-file 0x20208000 ivt_flashloader.bin - load bootloader to RAM&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;2) ./sdphost -t 50000 -p / dev / ttyACM0,115200 jump-address 0x20208400 - start bootloader&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;3) sleep 2- simple timeout&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;4) ./blhost -p / dev / ttyACM0.115200 fill-memory 0x2000 4 0xc0000007- configure FlexSpi&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;5) ./blhost -p / dev / ttyACM0,115200 configure-memory 0x9 0x2000 &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;6) ./blhost -p / dev / ttyACM0.115200 flash-erase-region 0x60000000 0x10000 &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;7) ./blhost -p / dev / ttyACM0.115200 write-memory 0x60000000 examples / flexspi_nor_edma_transfer.bin - program source code to flash.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;sdphost and blhost for Linux. I program in uart mode. Is there a mbedwinSerial_1466 driver for Linux to flash the board in usb mode? &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Can I flash board by mfgtool under Linux? I did not find such vid pid in supported devices.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Is there a similar NXP-MCUBootUtility application for Linux? Since, for example, to use the HAB encryption function, you need to do a lot of manipulations - &lt;A href="https://www.cnblogs.com/henjay724/p/10219459.html" target="_blank" rel="noopener"&gt;https://www.cnblogs.com/henjay724/p/10219459.html&lt;/A&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 08 Dec 2021 10:15:36 GMT</pubDate>
    <dc:creator>vladimir_dolzhe</dc:creator>
    <dc:date>2021-12-08T10:15:36Z</dc:date>
    <item>
      <title>MXRT1020 usb device on internal flexspi, secure source code part on flexspi</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MXRT1020-usb-device-on-internal-flexspi-secure-source-code-part/m-p/1383343#M184133</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Hello. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;The task is to make it possible to run the application on the imxt1020 board. The source code will be placed in the first half of the flash(internal flexspi), the second half will be available via usb (phat file system). I did this part using examples with the file system and creating a USB device. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;The second part of the task is to encrypt the flash area with the source code(encrypt only half flexspi internal flash). Using &lt;A href="https://github.com/JayHeng/NXP-MCUBootUtility" target="_blank" rel="noopener"&gt;https://github.com/JayHeng/NXP-MCUBootUtility&lt;/A&gt; and the NXP-MCUBootUtility app started to figure it out. Based on the description, in order to encrypt only part of the flash, I need to use BEE / OTFAD encryption. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Tried to download from &lt;A href="https://www.cnblogs.com/henjay724/p/10189602.html" target="_blank" rel="noopener"&gt;https://www.cnblogs.com/henjay724/p/10189602.html&lt;/A&gt; image_enc and image_enc2. Nothing comes out. Can you provide access to these archives? &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;The next question is why is the Windows application used for flashing the board and encrypting the uboot? I work on the Linux platform, now I have not found a way, except how to use a script to flash the board: 1)./sdphost -t 50000 -p / dev / ttyACM0,115200 write-file 0x20208000 ivt_flashloader.bin - load bootloader to RAM&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;2) ./sdphost -t 50000 -p / dev / ttyACM0,115200 jump-address 0x20208400 - start bootloader&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;3) sleep 2- simple timeout&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;4) ./blhost -p / dev / ttyACM0.115200 fill-memory 0x2000 4 0xc0000007- configure FlexSpi&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;5) ./blhost -p / dev / ttyACM0,115200 configure-memory 0x9 0x2000 &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;6) ./blhost -p / dev / ttyACM0.115200 flash-erase-region 0x60000000 0x10000 &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;7) ./blhost -p / dev / ttyACM0.115200 write-memory 0x60000000 examples / flexspi_nor_edma_transfer.bin - program source code to flash.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;sdphost and blhost for Linux. I program in uart mode. Is there a mbedwinSerial_1466 driver for Linux to flash the board in usb mode? &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Can I flash board by mfgtool under Linux? I did not find such vid pid in supported devices.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Is there a similar NXP-MCUBootUtility application for Linux? Since, for example, to use the HAB encryption function, you need to do a lot of manipulations - &lt;A href="https://www.cnblogs.com/henjay724/p/10219459.html" target="_blank" rel="noopener"&gt;https://www.cnblogs.com/henjay724/p/10219459.html&lt;/A&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Dec 2021 10:15:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MXRT1020-usb-device-on-internal-flexspi-secure-source-code-part/m-p/1383343#M184133</guid>
      <dc:creator>vladimir_dolzhe</dc:creator>
      <dc:date>2021-12-08T10:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: MXRT1020 usb device on internal flexspi, secure source code part on flexspi</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MXRT1020-usb-device-on-internal-flexspi-secure-source-code-part/m-p/1383920#M184175</link>
      <description>&lt;P&gt;Hi，&lt;BR /&gt;Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.&lt;BR /&gt;To provide the fastest possible support, I'd highly recommend you use the &lt;A href="https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-secure-provisioning-tool:MCUXPRESSO-SECURE-PROVISIONING" target="_self"&gt;MCUXpresso Secure Provisioning tool&lt;/A&gt; instead of NXP-MCUBootUtility on Linux OS.&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&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&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 09:20:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MXRT1020-usb-device-on-internal-flexspi-secure-source-code-part/m-p/1383920#M184175</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2021-12-09T09:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: MXRT1020 usb device on internal flexspi, secure source code part on flexspi</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MXRT1020-usb-device-on-internal-flexspi-secure-source-code-part/m-p/1383969#M184179</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Thanks for the answer.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN&gt;I will try this method.&lt;/SPAN&gt;&lt;/SPAN&gt; I use SDK for arm gcc. &lt;SPAN class=""&gt;&lt;SPAN&gt;Now my example works fine without using encryption.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN&gt;Brief instruction:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1) Install arm gcc for cortex-m7&lt;BR /&gt;wget &lt;A href="https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2" target="_blank" rel="noopener"&gt;https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2&lt;/A&gt;&lt;BR /&gt;mkdir ~/opt&lt;BR /&gt;cp gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 ~/opt&lt;BR /&gt;cd ~/opt&lt;BR /&gt;tar -xvf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2&lt;BR /&gt;export ARMGCC_DIR=~/opt/gcc-arm-none-eabi-9-2019-q4-major&lt;/P&gt;&lt;P&gt;2) Build flexspi demo app (CMake 3.10 require)&lt;BR /&gt;cd SDK/boards/evkmimxrt1020/driver_examples/flexspi/nor/edma_transfer/armgcc&lt;BR /&gt;./build_all.sh&lt;/P&gt;&lt;P&gt;3) Generate bin file from elf&lt;BR /&gt;cd flexspi_nor_release&lt;BR /&gt;~/opt/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-objcopy -O binary flexspi_nor_edma_transfer.elf flexspi_nor_edma_transfer.bin&lt;/P&gt;&lt;P&gt;4) Serial mode ON&lt;BR /&gt;Set board to serial mode and ON board. Check /dev/ttyACM0 is exist&lt;/P&gt;&lt;P&gt;5) Flash demo app to board&lt;BR /&gt;Load flashloader to memory&lt;BR /&gt;./sdphost -t 50000 -p /dev/ttyACM0,115200 write-file 0x20208000 ivt_flashloader.bin&lt;BR /&gt;Execute flashloader&lt;BR /&gt;./sdphost -t 50000 -p /dev/ttyACM0,115200 jump-address 0x20208400&lt;BR /&gt;Fill and configure memory for FLEXSPI NOR&lt;BR /&gt;./blhost -p /dev/ttyACM0,115200 fill-memory 0x2000 4 0xc0000007&lt;BR /&gt;./blhost -p /dev/ttyACM0,115200 configure-memory 0x9 0x2000&lt;BR /&gt;Erase memory region&lt;BR /&gt;./blhost -p /dev/ttyACM0,115200 flash-erase-region 0x60000000 0x10000&lt;BR /&gt;Write demo app&lt;BR /&gt;./blhost -p /dev/ttyACM0,115200 write-memory 0x60000000 flexspi_nor_edma_transfer.bin&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;This part work good.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;After that I want to try bee encrypt: &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;6) Flash demo bee encrypt to board&lt;BR /&gt;Encrypt flexspi region from offset 0x1000 with size 0x3FF000 and AES KEY 0123456789abcdeffedcba9876543210&lt;BR /&gt;image_enc.exe hw_eng=bee ifile=flexspi_nor_edma_transfer.bin ofile=flexspi_nor_edma_transfer_bee_encrypted.bin base_addr=0x60000000 region0_key=0123456789abcdeffedcba9876543210 region0_arg=1,[0x60001000,0x3FF000,0] region0_lock=0 use_zero_key=1 is_boot_image=1&lt;/P&gt;&lt;P&gt;Remove padding 1K size&lt;BR /&gt;dd if=flexspi_nor_edma_transfer_bee_encrypted.bin of=flexspi_nor_edma_transfer_bee_encrypted_remove1K.bin skip=1 bs=1024 count=200&lt;/P&gt;&lt;P&gt;Generate encrypt sb file&lt;BR /&gt;elftosb -f kinetis -V -c program_imxrt1020_qspi_encrypt_sw_gp2.bd -o boot_image_encrypt.sb flexspi_nor_edma_transfer_bee_encrypted_remove1K.bin&lt;/P&gt;&lt;P&gt;Generate burn_fuse sb file&lt;BR /&gt;elftosb -f kinetis -V -c burn_fuse.bd -o burn_fuse.sb&lt;/P&gt;&lt;P&gt;Flash images&lt;BR /&gt;./sdphost -t 50000 -p /dev/ttyACM0,115200 write-file 0x20208000 ivt_flashloader.bin&lt;BR /&gt;./sdphost -t 50000 -p /dev/ttyACM0,115200 jump-address 0x20208400&lt;BR /&gt;./blhost -p /dev/ttyACM0,115200 receive-sb-file burn_fuse.sb&lt;BR /&gt;./blhost -p /dev/ttyACM0,115200 reset&lt;BR /&gt;./blhost -p /dev/ttyACM0,115200 receive-sb-file boot_image_encrypt.sb&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;As far as I understand, polyfuse will be programmed here, will it be possible to return to normal boot later if something goes wrong? &lt;SPAN class=""&gt;In this example, zero keys are used, how do I use my keys? Is it possible to compile the image_enc utility for Linux, there are sources for it. The customer wants to program the boards in a minimal way, using their encryption keys. To do this, he needs a minimal set of utilities (now it is: sdphost, blhost, elftosb, image_enc.exe). &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;My burn_fuse.bd:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sources {&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;constants {&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;section (0) {&lt;/P&gt;&lt;P&gt;# program SW_GP2&lt;BR /&gt;load fuse 0x76543210 &amp;gt; 0x29;&lt;BR /&gt;load fuse 0xfedcba98 &amp;gt; 0x2a;&lt;BR /&gt;load fuse 0x89abcdef &amp;gt; 0x2b;&lt;BR /&gt;load fuse 0x01234567 &amp;gt; 0x2c;&lt;BR /&gt;&lt;BR /&gt;# Program BEE_KEY0_SEL&lt;BR /&gt;load fuse 0x00003000 &amp;gt; 0x6;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;load fuse 0x00003000 &amp;gt; 0x6 - Is that correct to use only region0? what does it mean?(may be have any datasheet for that)&lt;/P&gt;&lt;P&gt;program_imxrt1020_qspi_encrypt_sw_gp2.bd:&lt;/P&gt;&lt;P&gt;sources {&lt;BR /&gt;myBinFile = extern (0);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;section (0) {&lt;BR /&gt;load 0xc0000007 &amp;gt; 0x2000;&lt;BR /&gt;enable flexspinor 0x2000;&lt;BR /&gt;erase 0x60000000..0x60010000;&lt;BR /&gt;load 0xf000000f &amp;gt; 0x3000;&lt;BR /&gt;enable flexspinor 0x3000;&lt;BR /&gt;load myBinFile &amp;gt; 0x60000400;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Is that correct bd file?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 10:17:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MXRT1020-usb-device-on-internal-flexspi-secure-source-code-part/m-p/1383969#M184179</guid>
      <dc:creator>vladimir_dolzhe</dc:creator>
      <dc:date>2021-12-09T10:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: MXRT1020 usb device on internal flexspi, secure source code part on flexspi</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MXRT1020-usb-device-on-internal-flexspi-secure-source-code-part/m-p/1384047#M184186</link>
      <description>&lt;P&gt;Try, it works all fine by mine instruction. &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;I think one key aes will be enough for the customer(i don't use SRK hash yet - maybe later). image_enc build from source code, use mbetdtls github for dependency. All work's fine, thanks.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 13:02:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MXRT1020-usb-device-on-internal-flexspi-secure-source-code-part/m-p/1384047#M184186</guid>
      <dc:creator>vladimir_dolzhe</dc:creator>
      <dc:date>2021-12-09T13:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: MXRT1020 usb device on internal flexspi, secure source code part on flexspi</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MXRT1020-usb-device-on-internal-flexspi-secure-source-code-part/m-p/1384096#M184195</link>
      <description>&lt;P&gt;Encrypt images with AES CTR: &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;it seems like it works. But data in encrypted.bin file not changed after 0x1000 offset. Write only enc_region_hdr to offset 0x400. I change aes key many times, data was not changed after 0x1000 offset, source code in flex not encrypt by image_enc utility.....&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1) I try to use AES ECB. Data changed, but nothing work:&lt;/P&gt;&lt;P&gt;./image_enc ifile=flexspi_nor_edma_transfer.bin ofile=flexspi_nor_edma_transfer_bee_encrypted.bin base_addr=0x60000000 region0_key=0123456789abcdeffedcba9876543210 region0_arg=0,[0x60001000,0x3FF000,0] region0_lock=0 use_zero_key=1 is_boot_image=1&lt;/P&gt;&lt;P&gt;Remove padding 1K size&lt;BR /&gt;dd if=flexspi_nor_edma_transfer_bee_encrypted.bin of=flexspi_nor_edma_transfer_bee_encrypted_remove1K.bin skip=1 bs=1024 count=200&lt;/P&gt;&lt;P&gt;Generate encrypt sb file&lt;BR /&gt;./elftosb -f kinetis -V -c program_imxrt1020_qspi_encrypt_sw_gp2.bd -o boot_image_encrypt.sb flexspi_nor_edma_transfer_bee_encrypted_remove1K.bin&lt;/P&gt;&lt;P&gt;./sdphost -t 50000 -p /dev/ttyACM0,115200 write-file 0x20208000 ivt_flashloader.bin&lt;BR /&gt;./sdphost -t 50000 -p /dev/ttyACM0,115200 jump-address 0x20208400&lt;BR /&gt;./blhost -p /dev/ttyACM0,115200 receive-sb-file burn_fuse.sb&lt;BR /&gt;./blhost -p /dev/ttyACM0,115200 receive-sb-file boot_image_encrypt.sb - NOT WORK AFTER LOAD BOARD FROM FLEXSPI.&lt;/P&gt;&lt;P&gt;2)I try to use AES CTR :&lt;/P&gt;&lt;P&gt;./image_enc ifile=flexspi_nor_edma_transfer.bin ofile=flexspi_nor_edma_transfer_bee_encrypted.bin base_addr=0x60000000 region0_key=0123456789abcdeffedcba9876543210 region0_arg=1,[0x60001000,0x3FF000,0] region0_lock=0 use_zero_key=1 is_boot_image=1&lt;/P&gt;&lt;P&gt;Remove padding 1K size&lt;BR /&gt;dd if=flexspi_nor_edma_transfer_bee_encrypted.bin of=flexspi_nor_edma_transfer_bee_encrypted_remove1K.bin skip=1 bs=1024 count=200&lt;/P&gt;&lt;P&gt;Generate encrypt sb file&lt;BR /&gt;./elftosb -f kinetis -V -c program_imxrt1020_qspi_encrypt_sw_gp2.bd -o boot_image_encrypt.sb flexspi_nor_edma_transfer_bee_encrypted_remove1K.bin&lt;/P&gt;&lt;P&gt;./sdphost -t 50000 -p /dev/ttyACM0,115200 write-file 0x20208000 ivt_flashloader.bin&lt;BR /&gt;./sdphost -t 50000 -p /dev/ttyACM0,115200 jump-address 0x20208400&lt;BR /&gt;./blhost -p /dev/ttyACM0,115200 receive-sb-file burn_fuse.sb&lt;BR /&gt;./blhost -p /dev/ttyACM0,115200 receive-sb-file boot_image_encrypt.sb - WORK AFTER LOAD BOARD FROM FLEXSPI.&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;The only difference is that I am using the parameter&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; AES mode for image_enc...burn_fuse.bd and program_imxrt1020_qspi_encrypt_sw_gp2.bd &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;used the same(AES key and params for region0 used the same).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; Why AES CTR work with this parameters, but AES ECB don't work? Why AES CTR mode do not encrypt data in region, only write enc_region hdr to offset 0x400? I tried change aes key in AES CTR mode, but change only header at offset 0x400, data do not changed....&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;The customer needs a simple option, encrypt the source code with an AES algorithm, place the keys in the OTP&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 14:43:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MXRT1020-usb-device-on-internal-flexspi-secure-source-code-part/m-p/1384096#M184195</guid>
      <dc:creator>vladimir_dolzhe</dc:creator>
      <dc:date>2021-12-09T14:43:23Z</dc:date>
    </item>
  </channel>
</rss>

