Can't compile u-boot-toradex

Hi, I’m currently trying to get the CAN to work on my Colibri iMX6. For this i’m following the articles CAN and u-boot and kernel.

So far I was able to configure the kernel, but when it comes to the compilation I get the following error:

~/u-boot-toradex$ make -j3 2>&1 | tee build.log
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config.h
  GEN     include/
  CFG     u-boot.cfg
  GEN     include/
  CHK     include/config/uboot.release
  CHK     include/generated/timestamp_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  CHK     include/generated/version_autogenerated.h
  CC      arch/arm/lib/asm-offsets.s
  CC      lib/asm-offsets.s
cc1: error: unknown value ‘armv5’ for -march
cc1: note: valid arguments are: armv8-a armv8.1-a armv8.2-a armv8.3-a; did you mean ‘armv8-a’?
Kbuild:64: recipe for target 'arch/arm/lib/asm-offsets.s' failed
make[1]: *** [arch/arm/lib/asm-offsets.s] Error 1
make[1]: *** Waiting for unfinished jobs....
cc1: error: unknown value ‘armv5’ for -march
cc1: note: valid arguments are: armv8-a armv8.1-a armv8.2-a armv8.3-a; did you mean ‘armv8-a’?
Kbuild:43: recipe for target 'lib/asm-offsets.s' failed
make[1]: *** [lib/asm-offsets.s] Error 1
Makefile:1286: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2

I checked the environment variables ARCH, PATH and CROSS_COMPILE and they are set to the values indicated on the tutorial.

I’m using the gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf

I’d really appreciate some help on the matter.

Kind regards.

P.S: I also would like to ask about the typographic conventions on the articles you have provided for this matter. Since there wasn’t a specification on to where the commands should be run, I run them on my host computer (Ubuntu).

Hi @cae30989

Thanks for writing to the Toradex Community!

Which git branch did you checkout for the compilation?
What is your host distribution ( uname -a)?

Best regards,

Hi @jaski.tx,

my host distribution is:

Linux ubuntu 5.0.0-36-generic #39~18.04.1-Ubuntu SMP Tue Nov 12 11:09:50 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux.

And I used the branch 2016.11-toradex-next.
In the mean time I also tried to configure and compile the Linux kernel and came to a mistake here too. Is there a way to choose which branch I chechout?
I hope this information helps. Thanks.

Best regards.

Hi @cae30989

Thanks for the Information.

Regarding U-Boot compilation, I tried it and it works fine.

Is there a way to choose which branch I checkout?

Yes, you can choose the branch when you check out as described here.

Best regards,

Hi @jaski.tx,

I have tried it a few times, but the same mistakes comes up. Which toolchain are you using? Is there a way to know which toolchain works better?

Did you use:

export CROSS_COMPILE=arm-linux-gnueabihf-


export CROSS_COMPILE=aarch64-linux-gnu-

Thank you. Best regards.

P.S.: Since the typographic conventions is not clarified on this link, I just want to make sure where the commands must go. I have been using them on my host.

I was setting the wrong CROSS_COMPILE. I used:

export CROSS_COMPILE=arm-linux-gnueabihf-

and everything worked from there.

Glad everything worked out for you.

Hi @jeremias.tx,

thank you. But I still would like to get an answer on to, where the commands must be run. The typographic conventions are not clear on all the links provided by Toradex. I’m having the same issue following the CAN(Linux).

I have already sent this comment as a Feedback.

The cross-compiler must be set on your host. On the module, you would do native compilation. The upper command is for ARM 32-bit architecture and the below one is for ARM 64-bit architecture.

Best regards,

Could you ask a new question, please? Thanks.