JohnBabrick
JohnBabrick

Reputation: 61

U-boot for Beaglebone Black won't build - target CPU does not support THUMB instructions

I am trying to build u-boot for beagle bone black following instructions in "Mastering Embedded Linux Programming" by Chris Simmonds. I have built the cross toolchain and am now trying to build Das U-boot with that tool chain and the build fails due to THUMB instructions not being supported (by the compiler? by the BeagleBone?). I am using the latest released from Denx's git repository v2018.05. Building on Ubuntu 18.04.

Below is the console output:

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

Upvotes: 3

Views: 1209

Answers (2)

Lewis Z
Lewis Z

Reputation: 494

I am reading the book too and got the same error. I solved the problem by using the master branch of U-Boot (Date: 2019-03-19, OS: Ubuntu: 18.04).

However, the master branch of U-Boot doesn't have am335x_boneblack_defconfig. I used am335x_evm_defconfig instead.

In spite of those compiling issues, the book is excellent.

EDIT:

After further investigations, I found the root cause was the fpu-type needed to be set to 'neon-vfpv3' using ./ct-ng menuconfig.

As the book instructed to set the float-abi to hard, the fpu-type should be set to neon-vfpv3 too. Otherwise, both the Linux kernel and Barebox/U-boot will not be compiled.

Upvotes: 4

Xypron
Xypron

Reputation: 2483

Could it be that you are using the wrong cross compiler?

On Debian Buster using package gcc-7-arm-linux-gnueabihf

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

runs like a charm.

The package I have been using is also available in Ubuntu 18.04: https://launchpad.net/ubuntu/bionic/+package/gcc-7-arm-linux-gnueabihf

Upvotes: 0

Related Questions