Error Building ATF and Trusty on Xavier NX (32.4.4)

Error Building ATF and Trusty on Xavier NX (32.4.4)

I am trying to build both the ATF and the Trusty OS, but I am encountering errors. I am following the instructions presented in the “Linux for Tegra Building ATF and Trusty README” document.

I set the environment variables CROSS_COMPILE_AARCH64 and CROSS_COMPILE_ARM to point to the AArch64 toolchain and the armhf toolchain respectively.

export CROSS_COMPILE_AARCH64=$HOME/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-

export CROSS_COMPILE_ARM=/home/dcapers/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-

I downloaded the toolchains from following:

http://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/ gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz

http://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/arm-linux-gnueabihf/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz

I then extracted the ATF and Trusty source packages

tar xpf ~/Linux_for_Tegra/source/public/atf_src.tbz2 -C atf_and_trusty/atf/

tar xpf ~/Linux_for_Tegra/source/public/trusty_src.tbz2 -C atf_and_trusty/trusty/

After extracting the source I attempted to build both the ATF and Trusty source code… This is where I ran into problems.

When building the ATF Source code I navigated to the ATF directory ant ran make:

cd atf_and_~/trusty/atf/arm-trusted-firmware
make BUILD_BASE=./t194ref
CROSS_COMPILE=“${CROSS_COMPILE_AARCH64}”
DEBUG=0 LOG_LEVEL=20 PLAT=tegra SPD=trusty TARGET_SOC=t194 V=0

Below is the output from the ATF build

Including services/spd/trusty/trusty.mk
Building tegra
CC drivers/delay_timer/delay_timer.c
warning: TCG doesn’t support requested feature: CPUID.01H:ECX.vmx [bit 5]
/lib64/ld-linux-x86-64.so.2: No such file or directory
Makefile:580: recipe for target ‘t194ref/tegra/t194/release/bl31/delay_timer.o’ failed
make: *** [t194ref/tegra/t194/release/bl31/delay_timer.o] Error 255

When building the Trusty Source code I navigated to the Trusty directory ant ran make:

cd ~/atf_and_trusty/trusty/trusty
make t186 PROJECT=t186 TARGET=t186 BUILDROOT=./t194ref
TOOLCHAIN_PREFIX=“${CROSS_COMPILE_AARCH64}”
ARCH_arm_TOOLCHAIN_PREFIX=“${CROSS_COMPILE_ARM}”
ARCH_arm64_TOOLCHAIN_PREFIX=“${CROSS_COMPILE_AARCH64}”
DEBUG=0 DEBUG_LVL=0 DEFAULT_OTE_APP_DEBUGLEVEL=1 NOECHO=@
TRUSTY_VARIANT=l4t-public TRUSTY_MULTI_GUEST_CONFIGURATION=
TARGET_SOC=t194

Below is the output from the Trusty build

make[1]: Entering directory ‘/home/dcapers/atf_and_trusty/trusty/trusty’
make[2]: Entering directory ‘/home/dcapers/atf_and_trusty/trusty/trusty’
PROJECT = t186
PLATFORM = t18x
TARGET = t186
TOOLCHAIN_PREFIX = /home/dcapers/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
warning: TCG doesn’t support requested feature: CPUID.01H:ECX.vmx [bit 5]
/lib64/ld-linux-x86-64.so.2: No such file or directory
including app dev dev/interrupt/arm_gic dev/timer/arm_generic kernel lib/boot_profiler lib/memlog lib/sm lib/trusty platform target
including kernel/vm lib/debug lib/fixed_point lib/heap lib/libc lib/syscall lib/uthread lib/version
Include Trusty user tasks support
warning: TCG doesn’t support requested feature: CPUID.01H:ECX.vmx [bit 5]
/lib64/ld-linux-x86-64.so.2: No such file or directory
XBIN_TOOLCHAIN_PREFIX = /home/dcapers/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
XBIN_LIBGCC =
including app/trusty lib/libc-trusty
including lib/libc
warning: TCG doesn’t support requested feature: CPUID.01H:ECX.vmx [bit 5]
/lib64/ld-linux-x86-64.so.2: No such file or directory
XBIN_TOOLCHAIN_PREFIX = /home/dcapers/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
XBIN_LIBGCC =
including app/trusty lib/libc-trusty
including lib/libc
warning: TCG doesn’t support requested feature: CPUID.01H:ECX.vmx [bit 5]
/lib64/ld-linux-x86-64.so.2: No such file or directory
XBIN_TOOLCHAIN_PREFIX = /home/dcapers/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
XBIN_LIBGCC =
including app/trusty lib/libc-trusty lib/openssl
including lib/libc lib/openssl-stubs
including lib/rng
including interface/hwrng
LIBGCC =
GLOBAL_COMPILEFLAGS = -g -fno-builtin -finline -include ./t194ref/build-t186/config.h -W -Wall -Wno-multichar -Wno-unused-parameter -Wno-nonnull-compare -ffunction-sections -fdata-sections
GLOBAL_OPTFLAGS = -O2
generating t194ref/build-t186/tegra/public/platform/t18x/module_config.h
generating t194ref/build-t186/config.h
generating t194ref/build-t186/user_tasks/sample/ipc-unittest/main/config.h
generating t194ref/build-t186/user_tasks/sample/ipc-unittest/srv/config.h
generating t194ref/build-t186/user_tasks/sample/hwkey-agent/config.h
compiling tegra/public/platform/t18x/platform.c
warning: TCG doesn’t support requested feature: CPUID.01H:ECX.vmx [bit 5]
/lib64/ld-linux-x86-64.so.2: No such file or directory
make/compile.mk:41: recipe for target ‘t194ref/build-t186/tegra/public/platform/t18x/platform.o’ failed
make[2]: *** [t194ref/build-t186/tegra/public/platform/t18x/platform.o] Error 255
make[2]: Leaving directory ‘/home/dcapers/atf_and_trusty/trusty/trusty’
lk/common/engine.mk:28: recipe for target ‘make-make’ failed
make[1]: *** [make-make] Error 2
make[1]: Leaving directory ‘/home/dcapers/atf_and_trusty/trusty/trusty’
makefile:27: recipe for target ‘t186’ failed
make: *** [t186] Error 2

hello dcapers44,

could you please refer to below discussion thread, we had confirmed we could build trusty sources,
thanks

Hello JerryChang,

The steps that you referred me to in How to use OpenSSL RSA in trusty? - #8 by JerryChang

are the steps that I originally followed. That is why I have requested help on this issue. I understand that following these steps should build ATF and Trusty on my Jetson Xavier NX, but it’s not. So where do I go from here?

hello dcapers44,

may I know what’s the code modification you’d done,
we had confirmed we could build trusty sources, since specify armhf (32-bit) toolchain could fix the building failures.
thanks

I have not made any code modifications. I followed the “Quick Start Guide” and “Setting Up Your File System” in the NVIDIA Jetson Linux Developer Guide. Then I extracted “L4T Driver Package (BSP) Sources” - (https://developer.nvidia.com/embedded/L4T/r32_Release_v4.4/r32_Release_v4.4-GMC3/Sources/T186/public_sources.tbz2)

Now I am trying to follow the steps towards building ATF and Trusty…

yes, please follow the steps for building ATF and Trusty.

I am following the stes for building ATF and Trusty… It is not building as instructed. I stated that in my initial message. That is the problem that I am asking for help on.

Hi dcapers44,

Confirmed we can build ATF and Trusty with r32.4.4 on Ubuntu 16.04 host machine success.
Please make sure your toolchain paths are set correct, try use absolute path and build again.

$ export CROSS_COMPILE_AARCH64=$HOME/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-

replace to:

$ export CROSS_COMPILE_AARCH64=/home/dcapers/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-

I’ve replaced my toolchain paths with the absolute path… and verified it using printenv. Below is what was output for CROSS_COMPILE_AARCH64 and CROSS_COMPILE_ARM

CROSS_COMPILE_AARCH64=/home/dcapers/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
CROSS_COMPILE_ARM=/home/dcapers/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-

I’m still getting the same result.

Hi dcapers44,

Where are you build the ATF and Trusty?

I attempted to build the ATF in following path:

   ~/atf_and_trusty/atf/arm-trusted-firmware

I attempted to build the Trusty in the following path:

   ~/atf_and_trusty/trusty/trusty

hello dcapers44,

since there’s no such file or directory failures.
could you please examine you’re actually having those libraries.
for example,
$ sudo find / -name ld-linux-x86-64.so.2

dcapers@JXNX-Alpha:~$ sudo find / -name ld-linux-x86-64.so.2
find: ‘/run/user/120/gvfs’: Permission denied

dcapers@JXNX-Alpha:~$ sudo ls -lisa /run/user/120/
ls: cannot access ‘/run/user/120/gvfs’: Permission denied
total 0
38355 0 drwx------ 10 gdm gdm 240 Jan 12 19:43 .
26294 0 drwxr-xr-x 4 root root 80 Jan 13 22:14 …
39058 0 srw-rw-rw- 1 gdm gdm 0 Jan 12 19:43 bus
39227 0 drwx------ 3 gdm gdm 60 Jan 12 19:43 dbus-1
40199 0 drwx------ 2 gdm gdm 60 Jan 12 19:43 dconf
38589 0 drwx–x–x 2 gdm gdm 60 Jan 12 19:43 gdm
40600 0 drwx------ 3 gdm gdm 60 Jan 12 19:43 gnome-shell
38507 0 drwx------ 2 gdm gdm 140 Jan 12 19:43 gnupg
? ? d??? ? ? ? ? ? gvfs
39053 0 drwx------ 2 gdm gdm 80 Jan 12 19:43 pulse
39045 0 srw-rw-rw- 1 gdm gdm 0 Jan 12 19:43 snapd-session-agent.socket
38523 0 drwxr-xr-x 2 gdm gdm 80 Jan 12 19:43 systemd

So I’ve done what you have asked me to … where do I go from here?

hello dcapers44,

could you please have a try to build ATF and Trusty sources on your host machine (i.e. ubuntu OS)?
thanks

Hi dcapers44,

Are you build ATF and Trusty on Jetson-Xavier?
Please use x86_64 ubuntu host machine to do cross compile and build.
Thanks!

I was attempting to build ATF and Trusty on Jetson-Xavier. So I now understand that this can not be done. Going forward, what are the necessary specifications of the host machine in order to use SDK Manager. I believe the RAM has to be at least 8GB… is there any additional requirements necessary? Also, is there an x86_64 pc that can be used as a host machine that greatly recommended? And can this host machine be setup via a Virtual Machine?

hello dcapers44,

please check NVIDIA SDK Manager for system requirements. we don’t suggest to use Virtual Machine since it got unexpected result sometimes.
thanks