binman的用法记录
详细说明请打开uboot源码文档:uboot_src/tool/binman/binman.rst
有时,将 ‘binman’ 节点添加到每个板的 .dts 文件中很不方便。这可以通过使用 #include 引入一个公共文件来完成。 U-Boot 构建系统支持的另一种方法是自动包含一个通用头文件。然后,您可以将 binman 节点(以及特定于 U-Boot 的任何其他内容,例如 bootph-all 属性)放在该头文件中。
Binman 将在 arch//dts:中搜索以下文件:
<CONFIG_SYS_SOC>-u-boot.dtsi
<CONFIG_SYS_CPU>-u-boot.dtsi
<CONFIG_SYS_VENDOR>-u-boot.dtsi
u-boot.dtsi
U-Boot 只会使用它找到的第一个。如果需要包含更通用的文件,可以使用 #include 从更具体的文件中执行此操作。 如果你弄清楚发生了什么问题,你可以在构建中使用:DEVICE_TREE_DEBUG=1
make DEVICE_TREE_DEBUG=1 ARCH=xxx CROSS_COMPILE=xxx
orangepi zero3的代码,uboot v2024.01版本就是用了binman,描述文件为arch/arm/dts/sunxi-u-boot.dtsi
使用命令查看信息,报错,还不知道原因。
./tools/binman/binman ls -i u-boot-sunxi-with-spl.bin
binman: Cannot find FDT map in image
2024年10月30日更新
binman: name ‘ELFError’ is not defined
安装:
sudo apt install python3-pyelftools
或者:
pip3 install jsonschema
pip3 install pyelftools
参考:https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1273477/faq-j721exsomxevm-9-0-sdk-make-u-boot-build-failure
编译uboot 2024.01的命令
make ARCH=arm distclean
make ARCH=arm orangepi_zero3_defconfig
make ARCH=arm menuconfig
make ARCH=arm CROSS_COMPILE=/work/orange_zero_3/buildroot/output/host/bin/aarch64-linux- BL31=./bl31.bin SCP=/dev/null -j12
注意编译器要使用绝对路径。