Hi, I tried to build OPTEE in Jetson orin nano recently with thistutorial , and I encounter some problem.
When I execute the instruction “./optee_src_build…sh -p t234” In the file ‘atf_and_optee_README.txt’.
There is my error report.
How can i fix this problem?
please see-also Topic 294046, comment #5 for the steps to build the ATF and OP-TEE sources.
Thanks for your reply.
According to the post, I got another problem on building nv_public_src_build.sh.
hscc@ubuntu:~/jetson-public-srcs/Linux_for_Tegra/source$ ./nv_public_src_build.sh
nvbuild.sh not found for package ./gst-nvv4l2camera_src.tbz2
Skipping ./gst-nvv4l2camera_src.tbz2 build.
nvbuild.sh not found for package ./libv4l2_nvargus_src.tbz2
Skipping ./libv4l2_nvargus_src.tbz2 build.
nvbuild.sh not found for package ./nvidia-jetson-optee-source.tbz2
Skipping ./nvidia-jetson-optee-source.tbz2 build.
nvbuild.sh not found for package ./kernel_oot_modules_src.tbz2
Skipping ./kernel_oot_modules_src.tbz2 build.
nvbuild.sh not found for package ./gst-nvvidconv_src.tbz2
Skipping ./gst-nvvidconv_src.tbz2 build.
nvbuild.sh not found for package ./gst-nvipcpipeline_src.tbz2
Skipping ./gst-nvipcpipeline_src.tbz2 build.
nvbuild.sh not found for package ./webrtc_argus_camera_app_src.tbz2
Skipping ./webrtc_argus_camera_app_src.tbz2 build.
nvbuild.sh not found for package ./nvsci_samples_src.tbz2
Skipping ./nvsci_samples_src.tbz2 build.
nvbuild.sh not found for package ./nvidia-xconfig_src.tbz2
Skipping ./nvidia-xconfig_src.tbz2 build.
nvbuild.sh not found for package ./libgstnvdrmvideosink_src.tbz2
Skipping ./libgstnvdrmvideosink_src.tbz2 build.
nvbuild.sh not found for package ./gst-nvvideo4linux2_src.tbz2
Skipping ./gst-nvvideo4linux2_src.tbz2 build.
nvbuild.sh not found for package ./libgstnvcustomhelper_src.tbz2
Skipping ./libgstnvcustomhelper_src.tbz2 build.
nvbuild.sh not found for package ./gst-nvarguscamera_src.tbz2
Skipping ./gst-nvarguscamera_src.tbz2 build.
-rwxr-xr-x buildbrain/dip 3426 2024-09-13 11:59 nvbuild.sh
~/jetson-public-srcs/Linux_for_Tegra/source/src_out/atf_src_build ~/jetson-public-srcs/Linux_for_Tegra/source
Building atf sources ..
Building atf sources for t194
make: Entering directory '/home/hscc/jetson-public-srcs/Linux_for_Tegra/source/src_out/atf_src_build/arm-trusted-firmware'
Including services/spd/opteed/opteed.mk
make: Leaving directory '/home/hscc/jetson-public-srcs/Linux_for_Tegra/source/src_out/atf_src_build/arm-trusted-firmware'
make: Entering directory '/home/hscc/jetson-public-srcs/Linux_for_Tegra/source/src_out/atf_src_build/arm-trusted-firmware'
Building tegra
make: Leaving directory '/home/hscc/jetson-public-srcs/Linux_for_Tegra/source/src_out/atf_src_build/arm-trusted-firmware'
make: Entering directory '/home/hscc/jetson-public-srcs/Linux_for_Tegra/source/src_out/atf_src_build/arm-trusted-firmware'
CC bl31/bl31_context_mgmt.c
/home/hscc/jetson-toolchain/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-gcc: 1: Syntax error: word unexpected (expecting ")")
make: *** [Makefile:1343: t234-t194/tegra/t194/release/bl31/bl31_context_mgmt.o] Error 2
make: Leaving directory '/home/hscc/jetson-public-srcs/Linux_for_Tegra/source/src_out/atf_src_build/arm-trusted-firmware'
make: *** Waiting for unfinished jobs....
make: Entering directory '/home/hscc/jetson-public-srcs/Linux_for_Tegra/source/src_out/atf_src_build/arm-trusted-firmware'
CC bl31/bl31_main.c
/home/hscc/jetson-toolchain/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-gcc: 1: Syntax error: word unexpected (expecting ")")
make: *** [Makefile:1343: t234-t194/tegra/t194/release/bl31/bl31_main.o] Error 2
make: Leaving directory '/home/hscc/jetson-public-srcs/Linux_for_Tegra/source/src_out/atf_src_build/arm-trusted-firmware'
make: Entering directory '/home/hscc/jetson-public-srcs/Linux_for_Tegra/source/src_out/atf_src_build/arm-trusted-firmware'
CC bl31/bl31_traps.c
/home/hscc/jetson-toolchain/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-gcc: 1: Syntax error: word unexpected (expecting ")")
make: *** [Makefile:1343: t234-t194/tegra/t194/release/bl31/bl31_traps.o] Error 2
make: Leaving directory '/home/hscc/jetson-public-srcs/Linux_for_Tegra/source/src_out/atf_src_build/arm-trusted-firmware'
hscc@ubuntu:~/jetson-public-srcs/Linux_for_Tegra/source$ /home/hscc/jetson-toolchain/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-gcc --version
bash: /home/hscc/jetson-toolchain/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-gcc: cannot execute binary file: Exec format error
it looks like an incorrect path you’ve exported? please double check the steps.
There are the paths I exported.
I check these by using env instruction.
CROSS_COMPILE_AARCH64=/home/hscc/jetson-toolchain/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
CROSS_COMPILE_AARCH64_PATH=/home/hscc/jetson-toolchain/aarch64--glibc--stable-2022.08-1
CROSS_COMPILE=/home/hscc/jetson-toolchain/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
UEFI_STMM_PATH=/home/hscc/jetson_BSP/Linux_for_Tegra/bootloader/standalonemm_optee_t234.bin
NV_TARGET_BOARD=t234
hello ncuwchenyx,
may I also confirm which L4T release version you’re working with?
assume it’s r36.4 public release, did you extract both atf_src.tbz2
and nvidia-jetson-optee-source.tbz2
source package from Driver Package (BSP) Sources package?
yes, I use r36.4 L4T public releasem, and I do extract those two tbz2 file in atf_and_optee folder like this.
I wonder is there any problem in the toolchain(version: aarch64–glibc–stable-2022.08-1.tar.bz2) I use.
hello ncuwchenyx,
I’m able to build ATF sources correctly.
BTW, I’m running this on the x86 desktop with ubuntu 20.04.
for instance, ./nv_public_src_build.sh
Building atf sources for t194
...
make: Leaving directory '/home/jerry/Downloads/public_sources/r36.4.0/Linux_for_Tegra/source/src_out/atf_src_build/arm-trusted-firmware'
make: Entering directory '/home/jerry/Downloads/public_sources/r36.4.0/Linux_for_Tegra/source/src_out/atf_src_build/arm-trusted-firmware'
Built t234-t234/tegra/t234/release/bl31.bin successfully
ATF sources compiled successfully.
after that,
I’m able to create TOS image by running nv_public_src_build_tos.sh
as well.
for instance,
$ ./nv_public_src_build_tos.sh -p t234 -u ~/nvidia/nvidia_sdk/JetPack_6.1_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra/bootloader/standalonemm_optee_t234.bin -s ~/nvidia/nvidia_sdk/JetPack_6.1_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra/nv_tegra/tos-scripts/gen_tos_part_img.py
Start to create the TOS image...
Generating Trusted OS Partition Image File
Generate TOS Image File for boot-wrapper.
The TOS image(t234) has been created: /home/jerry/Downloads/public_sources/r36.4.0/Linux_for_Tegra/source/src_out/tos-t234.img
$ ls -la src_out/
total 3212
drwxrwxr-x 5 jerry jerry 4096 Dec 31 11:10 .
drwxr-xr-x 5 jerry jerry 4096 Dec 31 10:56 ..
drwxrwxr-x 3 jerry jerry 4096 Dec 31 10:56 atf_src_build
-rw-r--r-- 1 jerry jerry 1632698 Dec 31 11:10 img.bin
drwxrwxr-x 4 jerry jerry 4096 Dec 31 10:59 kernel_src_build
drwxrwxr-x 3 jerry jerry 4096 Dec 31 11:09 optee_src_build
-rw-r--r-- 1 jerry jerry 1633232 Dec 31 11:10 tos-t234.img
please note that,
I’m using r36.4 public release sources package,
and, I’ve specify the path of the UEFI stmm image, also the script gen_tos_part_img.py
from Jetpack-6.1 public release.
Hi,
I can use nv_public_src_build and nv_public_src_build_tos.sh now.
But in the final stage of ‘atf_and_optee_README.txt’.
I used sudo ./flash.sh jetson-orin-nano-devkit mmcblk0p1
to flash the develop board,
and I got an error report.
sesson.txt (56.3 KB)
hello ncuwchenyx,
I saw lots of No such file or directory
failure. did you setup an environment for image flashing?
please refer to developer guide for the steps to untar the files and assemble the rootfs,
for instance, To Flash the Jetson Developer Kit Operating Software.
Hi Jerry,
According to the flash tutorial, when I used sudo ./apply_binaries.sh
after extracting the sample_root_filesystem in rootfs and sudo ./tools/l4t_flash_prerequisites.sh
, I got an error message below.
andy@andy:~/L4T/BSP/Linux_for_Tegra$ sudo ./apply_binaries.sh
Using rootfs directory of: /home/andy/L4T/BSP/Linux_for_Tegra/rootfs
||||||||||||||||||||||| ERROR |||||||||||||||||||||||
-----------------------------------------------------
1. The root filesystem, provided with this package,
has to be extracted to this directory:
/home/andy/L4T/BSP/Linux_for_Tegra/rootfs
-----------------------------------------------------
2. The root filesystem, provided with this package,
has to be extracted with 'sudo' to this directory:
/home/andy/L4T/BSP/Linux_for_Tegra/rootfs
-----------------------------------------------------
Consult the Development Guide for instructions on
extracting and flashing your device.
|||||||||||||||||||||||||||||||||||||||||||||||||||||
hello ncuwchenyx,
did you extract root file system?
for instance, $ sudo tar xpf ${SAMPLE_FS_PACKAGE} -C Linux_for_Tegra/rootfs/
please visit L4T page, jetson-linux-r3640.
you should download both [Driver Package (BSP)] and also [Sample Root Filesystem] for setting up your environment,
or… you may using SDK Manager to download/install Jetpack release image to your host machine.
Hi Jerry, Thanks for your reply, I solved the problem above and flash successfully.
But when I use nvftpm_helper-app -g
command in Jetson Orin Nano.
It shows Segmentation fault (core dumped).
Is that mean I didn’t flash the board propertily?
hello ncuwchenyx,
please file another new discussion thread for follow-up issue.
you may also share the complete reproduce steps, and logs for reference.