【问题标题】:U-boot for Beaglebone Black won't build - target CPU does not support THUMB instructions无法构建 Beaglebone Black 的 U-boot - 目标 CPU 不支持 THUMB 指令
【发布时间】:2019-03-29 14:25:33
【问题描述】:

我正在尝试按照 Chris Simmonds 的“掌握嵌入式 Linux 编程”中的说明为 beagle bone black 构建 u-boot。我已经构建了交叉工具链,现在正尝试使用该工具链构建 Das U-boot,但由于不支持 THUMB 指令(编译器?BeagleBone?),构建失败。我正在使用 Denx 的 git 存储库 v2018.05 发布的最新版本。基于 Ubuntu 18.04 构建。

下面是控制台输出:

johann@mars:~/uboot-work/u-boot$ make CROSS_COMPILE=arm-cortex_a8-linux-gnueabihf- am335x_evm_defconfig
#
# configuration written to .config
#
johann@mars:~/uboot-work/u-boot$ make CROSS_COMPILE=arm-cortex_a8-linux-gnueabihf- 
scripts/kconfig/conf  --silentoldconfig Kconfig
CHK     include/config.h
UPD     include/config.h
CFG     u-boot.cfg
GEN     include/autoconf.mk
GEN     include/autoconf.mk.dep
CFG     spl/u-boot.cfg
GEN     spl/include/autoconf.mk
CHK     include/config/uboot.release
CHK     include/generated/version_autogenerated.h
CHK     include/generated/timestamp_autogenerated.h
UPD     include/generated/timestamp_autogenerated.h
CC      lib/asm-offsets.s
cc1: warning: target CPU does not support THUMB instructions
CHK     include/generated/generic-asm-offsets.h
CC      arch/arm/lib/asm-offsets.s
cc1: warning: target CPU does not support THUMB instructions
CHK     include/generated/asm-offsets.h
HOSTCC  scripts/dtc/dtc.o
HOSTCC  scripts/dtc/flattree.o
HOSTCC  scripts/dtc/fstree.o
HOSTCC  scripts/dtc/data.o
HOSTCC  scripts/dtc/livetree.o
HOSTCC  scripts/dtc/treesource.o
HOSTCC  scripts/dtc/srcpos.o
HOSTCC  scripts/dtc/checks.o
HOSTCC  scripts/dtc/util.o
SHIPPED scripts/dtc/dtc-lexer.lex.c
SHIPPED scripts/dtc/dtc-parser.tab.h
HOSTCC  scripts/dtc/dtc-lexer.lex.o
SHIPPED scripts/dtc/dtc-parser.tab.c
HOSTCC  scripts/dtc/dtc-parser.tab.o
HOSTLD  scripts/dtc/dtc
HOSTCC  tools/mkenvimage.o
HOSTCC  tools/lib/crc32.o
HOSTLD  tools/mkenvimage
HOSTCC  tools/common/bootm.o
HOSTCC  tools/lib/fdtdec.o
HOSTCC  tools/fit_image.o
HOSTCC  tools/image-host.o
HOSTCC  tools/dumpimage.o
HOSTLD  tools/dumpimage
HOSTCC  tools/mkimage.o
HOSTLD  tools/mkimage
CC      arch/arm/cpu/armv7/cache_v7.o
cc1: warning: target CPU does not support THUMB instructions
{standard input}: Assembler messages:
{standard input}:42: Error: selected processor does not support `dsb sy' in ARM mode

make[1]: *** [arch/arm/cpu/armv7/cache_v7.o] Error 1
Makefile:1363: recipe for target 'arch/arm/cpu/armv7' failed

make: *** [arch/arm/cpu/armv7] Error 2

【问题讨论】:

    标签: arm beagleboneblack u-boot


    【解决方案1】:

    我也在看这本书,遇到了同样的错误。我通过使用U-Boot的master分支解决了这个问题(日期:2019-03-19,操作系统:Ubuntu:18.04)。

    但是,U-Boot 的 master 分支没有 am335x_boneblack_defconfig。我改用 am335x_evm_defconfig。

    尽管有这些编译问题,这本书还是很棒的。

    编辑:

    经过进一步调查,我发现根本原因是需要使用 ./ct-ng menuconfig 将 fpu-type 设置为 'neon-vfpv3'。

    正如书中指示将 float-abi 设置为 hard,fpu-type 也应设置为 neon-vfpv3。否则,Linux 内核和 Barebox/U-boot 都不会被编译。

    【讨论】:

    • 非常感谢您的回答。我会试试这个并在这里发布。
    • 我改变了 fpu 类型并让它工作了!非常感谢,伙计。替我回答!
    • 虽然从 sd 卡启动不走运!我无法将 BBB 视为 /dev/ttyUSB
    • ct-ng menuconfig 选项在“Target options ---> Use specific FPU”下可用(crosstool-ng-1.24.0)
    【解决方案2】:

    会不会是你使用了错误的交叉编译器?

    在使用包 gcc-7-arm-linux-gnueabihf 的 Debian Buster 上

    make am335x_evm_defconfig
    export CROSS_COMPILE=arm-linux-gnueabihf-
    make -j6
    

    像魅力一样运行。

    我一直使用的包在 Ubuntu 18.04 中也可以使用:https://launchpad.net/ubuntu/bionic/+package/gcc-7-arm-linux-gnueabihf

    【讨论】:

    • 我正在尝试按照 Chris Simmonds 的“掌握嵌入式 Linux 编程”中的说明为 beagle bone black 构建 u-boot。我尽可能仔细地按照说明操作并遇到了这个问题。所以,这本书似乎是错误的,可能是关于在构建 crosstools-ng 时从哪个配置文件开始。我将改用 am335x_evm_defconfig 重建。谢谢。
    • 你好@JohnBabrick,之后你能从sd卡启动吗?
    猜你喜欢
    • 2021-02-03
    • 2015-05-10
    • 1970-01-01
    • 1970-01-01
    • 2015-10-04
    • 2021-08-24
    • 2020-07-03
    • 2014-08-26
    • 2017-09-19
    相关资源
    最近更新 更多