Hello together,
I am encountering issues while trying to build the hello_world
example on my host machine for deployment on my Jetson Orin Nano.
By following the section “How to Cross Compile a Trusted Application and Run it on Jetson Devices” in the offical OP-TEE documentation, I was able to compile the hwkey-agent
sample that comes with the BSP source package and get it running successfully with an encrypted eks_t234.img
.
After getting the hwkey-agent
running, I wanted to try another example. I chose the example hello_world from the official OP-TEE sample repository.
To build the hello_world
example, I copied the entire hello_world
folder into the /optee/samples/
directory, where other examples (such as hwkey-agent
) are located. I then ran a simple make -C host
command in the /optee/samples/hello_world
directory to build the host (the make -C ta
worked perfectly already). Unfortunately, this resulted in the following error:
nik71841@lap-morphis:~/jetpack/jp62/target/Linux_for_Tegra/source/jetson-optee-srcs/nvidia-jetson-optee-source/optee/samples/hello_world$ make -C host CROSS_COMPILE=${CROSS_COMPILE_AARCH64} TEEC_EXPORT=${TEEC_EXPORT}
make: Verzeichnis „/home/nik71841/jetpack/jp62/target/Linux_for_Tegra/source/jetson-optee-srcs/nvidia-jetson-optee-source/optee/samples/hello_world/host“ wird betreten
cc -Wall -I../ta/include -I/home/nik71841/jetpack/jp62/target/Linux_for_Tegra/rootfs/usr/include -I./include -c main.c -o main.o
In file included from main.c:29:
/home/nik71841/jetpack/jp62/target/Linux_for_Tegra/rootfs/usr/include/stdio.h:205:27: error: ‘L_tmpnam’ undeclared here (not in a function)
205 | extern char *tmpnam (char[L_tmpnam]) __THROW __wur;
| ^~~~
/home/nik71841/jetpack/jp62/target/Linux_for_Tegra/rootfs/usr/include/stdio.h:210:33: error: ‘L_tmpnam’ undeclared here (not in a function); did you mean ‘tmpnam’?
210 | extern char *tmpnam_r (char __s[L_tmpnam]) __THROW __wur;
| ^~~~
| tmpnam
make: * [Makefile:28: main.o] Fehler 1
make: Verzeichnis „/home/nik71841/jetpack/jp62/target/Linux_for_Tegra/source/jetson-optee-srcs/nvidia-jetson-optee-source/optee/samples/hello_world/host“ wird verlassen
The following environment variables are set, and these worked correctly with the hwkey-agent
example:
export TA_DEV_KIT_DIR=/home/nik71841/jetpack/jp62/target/Linux_for_Tegra/source/jetson-optee-srcs/nvidia-jetson-optee-source/optee/build/t234/export-ta_arm64
export CROSS_COMPILE_AARCH64=/home/nik71841/jetpack/jp62/toolchain/bin/aarch64-buildroot-linux-gnu-
export TEEC_EXPORT=/home/nik71841/jetpack/jp62/target/Linux_for_Tegra/source/jetson-optee-srcs/nvidia-jetson-optee-source/optee/install/t234/usr
I might be oversimplifying things, but I don’t know how to get the example to work. The OP-TEE documentation for a Trusted Application didn’t help me, as the make process is not described there.