背景:
直接在bootlaoder中编译生成u-boot.bin下载到RAM中运行,u-boot无法正常运行。
在u-boot中添加代码(不含打印)可以直接在RAM中加载运行,只要添加了puts或者printf就无法正常运行。
解决:
不要直接使用u-boot.bin,使用xxx.imx标识的u-boot。若环境是android,那在android体系下,进行编译最好。
原因:
The difference between u-boot.bin and u-boot.imx is the IVT header.
and put it in front of u-boot.bin. This IVT header is for our boot ROM to
identify the u-boot's location & function etc...
The parameter "imximage" means telling mkimage tool to generate a
imx uboot image, which means to put a header defined by image_type_params,
it is actually u-boot.bin with a imx IVT header which include header, DCD/plugin.
For more detail, you can refer to:
tools/imximage.c
ROM will read first IVT header to identify which mode need to execute,
DCD or PLUG, if DCD mode, then where to find the DRAM config data,
and after DRAM