quot;询问全部输入y,注意第一条命令执行后可能需要关闭控制台重新打开。所有命令正常执行结束后便完成了MSYS2的基础更新配置以及用于编译的标准包和gcc的安装。
jay@pc MSYS ~
$ pacman -Syu
$ pacman -Su
$ pacman -S –-needed base-devel
$ pacman -S mingw-w64-i686-gcc
3.2 Compile openssl under MinGW 在MinGW下编译openssl
Then download the openssl source package on the website https://www.openssl.org/, it is recommended to select the 1.0.x version (1.1.x version seems to have issues). We choose openssl-1.0.2q.tar.gz here. After downloading, decompress it and place it in the \NXP-MCUBootUtility\tools\openssl directory. Open the MSYS2 MinGW 32-bit console from the Start menu.
然后在网站 https://www.openssl.org/ 下载openssl的源码包,推荐选择1.0.x版本(1.1.x版本经测试有问题),这里选择的是openssl-1.0.2q.tar.gz,下载完成后将其解压放置到\NXP-MCUBootUtility\tools\openssl\目录下,从开始菜单里打开MSYS2 MinGW 32-bit控制台。
Use the cd command to checkout to the \NXP-MCUBootUtility\tools\openssl\openssl-1.0.2q directory and execute the following three commands in sequence. Note that the second command takes a little longer time (about 10 minutes). Please be patient.
使用cd命令切换到\NXP-MCUBootUtility\tools\openssl\openssl-1.0.2q目录下,依次执行如下三条命令,注意第二条命令执行时间稍长(大约10分钟),请耐心等待。
jay@pc MINGW32 /d/NXP-MCUBootUtility/tools/openssl/openssl-1.0.2q
$ ./config
$ make
$ cp ms/applink.c include/openssl/
3.3 Generate cst.exe under MinGW 在MinGW下生成cst.exe
Use the cd command to checkout to the \NXP-MCUBootUtility\tools\cst\code\back_end\src directory and execute the following two commands in sequence.
继续在MSYS2 MinGW 32-bit控制台下操作,使用cd命令切换到\NXP-MCUBootUtility\tools\cst\code\back_end\src目录下,依次执行如下两条命令。
jay@pc MINGW32 /d/NXP-MCUBootUtility/tools/cst/code/back_end/src
$ gcc *.c -o cst.exe -I ../hdr -I ../../../../openssl/openssl-1.0.2q/include/ -L ../../../mingw32/lib/ -L ../../../../openssl/openssl-1.0.2q -lfrontend -lcrypto -lgdi32 -static
$ cp cst.exe ../../../mingw32/bin/
At this point, the HAB encryption function is also activated. Open the NXP-MCUBootUtility and select the "HAB Encrypted Image Boot" mode in the Secure Boot Type and then enjoy it.
至此NXP-MCUBootUtility的HAB加密功能也被激活了,打开NXP-MCUBootUtility软件,在Secure Boot Type里选择"HAB Encrypted Image Boot"模式试试吧。