OP-TEE hello world script doesn't work

we want to test the OP-TEE functionality and we started with the hello world script as recommend here :
https://optee.readthedocs.io/en/latest/building/gits/optee_examples/optee_examples.html
here is the last few command:

jetsonlab@jetsonlab-desktop:~/temp/optee_examples/hello_world/host$ ls -l
total 28
-rw-rw-r-- 1 jetsonlab jetsonlab 3465 May 16 15:44 main.c
-rw-rw-r-- 1 jetsonlab jetsonlab 3120 May 16 15:45 main.o
-rw-rw-r-- 1 jetsonlab jetsonlab 594 May 16 15:44 Makefile
-rwxrwxr-x 1 jetsonlab jetsonlab 13744 May 16 15:45 optee_example_hello_world
jetsonlab@jetsonlab-desktop:~/temp/optee_examples/hello_world/host$ ./optee_example_hello_world
optee_example_hello_world: TEEC_InitializeContext failed with code 0xffff0008
jetsonlab@jetsonlab-desktop:~/temp/optee_examples/hello_world/host$

we are not sure how to proceed since we tried to follow the devguide here:
https://docs.nvidia.com/jetson/archives/r35.5.0/DeveloperGuide/SD/Security/OpTee.html
and we saw the links to: OP-TEE Documentation — OP-TEE documentation documentation
but it isn’t clear as what steps are needed and what is already built by Nvidia in the nano devkit (using jetson linux 35.5).

we would appreciate your help

Hi yuvalda,

How did you setup the TEE environment on your Orin Nano devkit?

Have you loaded the TEE driver and tee-supplicant correctly?

$ modprobe optee_armtz
$ systemctl start tee-supplicant

hey i tried using the command you wrote here and got error messages, yet while checking for running process i got the following results:


I’m not sure what is the error source, if there is any more data i could provide for troubleshooting please let me know.
thank you

May I know which part of this document you are stuck with?

We would also like to know you use case and the requirement.

as of now we don’t have a specific use case or requirement, the goal is to test the functionality and to learn how to operate this feature.

in the doc it seems that up to here :


there are no steps needed to be taken and that the example should work. even still i tried to follow this doc:

https://optee.readthedocs.io/en/latest/building/gits/optee_examples/optee_examples.html

since I’m getting error messages I assume there are more steps then what written in the dev guide or that i read it in the wrong order. either way it seems like it assume the “user”/developer have knowledge which think I don’t have.

i think I’m not completely understanding the require procedure.
when you ask how i loaded the TEE driver, and how i setup the TEE environment? could please give an example of how i should have done it?
in case i didn’t mentioned it we are using the orin nano dev kit with an SD card with the image of jetpack 5.1.3 image and jetson linux 35.5
thank you very much

after noticing that the process tee-supplicant owned by root i tried running xtest but with sudo and it seems to work fine, here is the log file:
op_tee_log.txt (76.1 KB)

now i tried to run the hello world example according to the doc here:
https://optee.readthedocs.io/en/latest/building/gits/optee_examples/optee_examples.html
i changed the relevant parameter in the make command and indeed i have the correct files
yet still when i try to run it i get error:
jetsonlab@jetsonlab-desktop:~/optee/optee_examples/hello_world/host$ ./optee_example_hello_world
optee_example_hello_world: TEEC_InitializeContext failed with code 0xffff0008

thank you