https://github.com/nxp-imx/linux-imx
这里我们使用 lf-6.1.55-2.2.2 分支开始
首先通过硬件原理图找出 ZLG imx287 和 官方开发板 mx28evk 的差异
- 调试串口
mx28evk
ZLG287
这里可以看到官方板用的GPIO3_16/17作为调试串口,ZLG287 GPIO3_16/17被用作I2C,没有接口引出,DUART使用的GPIO3_2/3
boot-imx 主线移植
下载 https://github.com/nxp-imx/uboot-imx 中的 https://github.com/nxp-imx/uboot-imx/archive/refs/tags/lf-6.1.55-2.2.2.tar.gz
直接编译
make ARCH=arm CROSS_COMPILE=arm-linux- mx28evk_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux- -j8
make ARCH=arm CROSS_COMPILE=arm-linux- u-boot.sb
直接uuu烧录
.\uuu.exe .\u-boot.sb
串口打印
H0x80501006
看起来直接寄了,经查
error '0x80501006' error (Key dictionary lookup failed).
H0x80501006,H表示固件已读取,0x80501006为固件签名校验不过,NXP论坛找到以下信息:
error '0x80501006' error (Key dictionary lookup failed).NXP Employee
"In default build, the '-z' option is passed to the elftosb utility and a default zero key is
added to the boot image. It is because the default zero key does not match with the
CRYPTO_KEY OTP fuses on your device, this firmware will not boot.After ENABLE_UNENCRYPTED_BOOT fuse is blown, the ROM expects an image either is encrypted
with a correct crypto key or not encrypted by any key. Thus both encrypted/unencrypted images arevalid to boot when this fuse is blown.To generate an unencrypted image, please remove the "-z" option [...] of elftosb."
要求使用正确的加密密钥加密
或者未使用任何密钥加密
,在elftosb
生成sb文件时取消-z
选项,即不使用加密签名:
查看ZLG imx287的imx-bootlets-src
脚本中确实也去掉了-z
:
找到老版本的ZLG资料显示,开发板出厂已使能未签名固件启动
,不能再使用零密钥
签名固件:
找到 uboot-imx-lf-6.1.55-2.2.2
中的 tools/mxsimage.c
函数 sb_prefill_image_header
显示:
/* FIXME -- We support only default key */hdr->key_count = 1;
.....最新uboot只支持default key
签名方式,凉凉......
接下来有两条路继续修改:
- 修改tools/mxsimage.c,使其支持
未签名固件
- 如果芯片OTP密钥未修改,可关闭
未签名固件启动
设置