UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
738 Views
Registered: ‎10-31-2018

making u-boot.elf for xilinx zynq7Z020 (ZedBoard )

Hi All,

We bought new xilink zynq7Z020 (zedboard) for our new project and plan to use it with Linux kernel. As part of this we have installed Ubuntu in virtual box.

I have downloaded "Ubuntu_on_Zync_Tutorial_03.pdf" from Xlinx website and started creating U-boot as instructed in pdf document.

Here during compilation using "make" command I am facing an error says "cc1: error: bad value ('armv5') for '-march=' switch".

 I have verified the same in your form and found some commands to install arm tool chain and did the same. But still I am facing the same issue.

Here are commands whatever I used and error log. Please verify the same and let me know if I miss something or if I need to do any other configurations.

praveen@praveen-VirtualBox:~$ sudo apt-get install arm-linux-gnueabi
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package arm-linux-gnueabi

praveen@praveen-VirtualBox:~$ sudo apt-get install device-tree-overlay
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package device-tree-overlay

praveen@praveen-VirtualBox:~$ export CROSS_COMPILER=arm-linux-gnueabi-
praveen@praveen-VirtualBox:~$ export ARCH=arm

praveen@praveen-VirtualBox:~$ cd u-boot-xlnx/

praveen@praveen-VirtualBox:~/u-boot-xlnx$ make zynq_zed_config
#
# configuration written to .config
#


praveen@praveen-VirtualBox:~/u-boot-xlnx$ make
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: error: bad value ('armv5') for '-march=' switch
cc1: note: valid arguments to '-march=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 bonnell atom silvermont slm knl x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2
Kbuild:43: recipe for target 'lib/asm-offsets.s' failed
make[1]: *** [lib/asm-offsets.s] Error 1
Makefile:1337: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2

 

Regards,

Praveen,

 

0 Kudos
3 Replies
Scholar rfs613
Scholar
693 Views
Registered: ‎05-28-2013

Re: making u-boot.elf for xilinx zynq7Z020 (ZedBoard )

Hi Praveen,

 

The main problem is that you are using the host compiler ('gcc') rather than the cross compiler ('arm-linux-gnueabi-gcc'). The host compiler can only create code for x86 processor, but the zynq uses an ARM processor.

 

To specify the cross compiler, you need to set the CROSS_COMPILE variable, like so:

export CROSS_COMPILE=arm-linux-gnueabi-

Note that it is "CROSS_COMPILE" rather than "CROSS_COMPILER" (you have an extra "R" at the end).

 

Once you fix that, you will likely meet with another error: the "make" will fail with the error "arm-linux-gnueabi-gcc: command not found". This is because your "apt-get install arm-linux-gnueabi" command failed, so you do not actually have a cross compiler installed.

 

I can only guess as to why that failed. Perhaps the package name is not correct. You could try:

sudo apt-get install gcc-arm-linux-gnueabi

If that also fails, you will need to google it ("arm cross compiler on ubuntu"). You can obtain a cross compiler from Xilinx as part of the SDK, or from other sources like Linaro. Note if you install it manually, then you will probably need to modify your PATH setting so that arm-linux-gnueabi-gcc can be found.

 

Last tip: when doing the build of u-boot, I recommend using "make V=1" instead of just "make". This enables verbose output, so you will be able to see the actual command being executed. If it begins with "gcc" then you are using the host compiler. If it begins with "arm-linux-gnueabi-gcc" then it is the cross compiler. In both cases the command must be somewhere on the search PATH, otherwise you will get "command not found" error.

0 Kudos
474 Views
Registered: ‎10-31-2018

Re: making u-boot.elf for xilinx zynq7Z020 (ZedBoard )

Hi rfs613,

 

Thanks for the inputs.

I have tried all below steps, but still i am getting the same error as below.

 

pa@PA-VirtualBox:~/PraveenKumar/Xilinx_ZedBoard/u-boot-xlnx$ make
make: arm_xilinx_linux_gnueabi-gcc: Command not found
/bin/sh: 1: arm_xilinx_linux_gnueabi-gcc: not found
dirname: missing operand
Try 'dirname --help' for more information.
scripts/kconfig/conf  --silentoldconfig Kconfig

*** Error during update of the configuration.

scripts/kconfig/Makefile:46: recipe for target 'silentoldconfig' failed
make[2]: *** [silentoldconfig] Error 1
Makefile:479: recipe for target 'silentoldconfig' failed
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'.  Stop.
pa@PA-VirtualBox:~/PraveenKumar/Xilinx_ZedBoard/u-boot-xlnx$

 

I have correctly installed "arm_xilinx_linux_gnueabi-gcc" as i am able to compile hello world program with this.

But when i am trying to do cross compile, i am facing issue.

I feel i missed some path settings and couldn't find how to add.

I searched in google as well but i didnt find how to do cross compile my project.

 

One more thing, I have installed latest Vivado 2018.3 web pack. Here in installation path i didnt find arm folder in SDK.

As i see many formus said arm_xilinx_linux_gnueabi-gcc will be found in opt/Xilinx/SDK/2018.3/gnu/arm/lin/, instead of "arm" i have "armr5" folder in opt/Xilinx/SDK/2018.3/gnu/armr5/lin/gcc-arm-none-eabi/bin which has "armr5-none-eabi-gcc"

I have tried using this compiler as well, but endup with same results.

As i am very new to Linux, Please suggest me if i miss to add compiler path in any file or suggest if we have any other way to compile u-boot.

 

Regards,

Praveen Kumar.

 

0 Kudos
Scholar rfs613
Scholar
440 Views
Registered: ‎05-28-2013

Re: making u-boot.elf for xilinx zynq7Z020 (ZedBoard )

Hi Praveen,

 

Check carefully the CROSS_COMPILE setting. Normally it is something like arm-xilinx-linux-gnueabi-, with dashes (-)  rather than underscores (_).

 

Regarding your question about Vivado 2018.3 web pack... the armr5 compiler is for Cortex-R5 processor, which is different than Zynq 7000 series used on Zedboard.

 

According to https://www.xilinx.com/html_docs/xilinx2018_2/sdaccel_doc/compiler-toolchain-support-gdz1504034401132.html the compiler to use is gcc-arm-linux-gnueabihf-  (I am using an older version so I cannot confirm this).

 

image.png

0 Kudos