Skip to main content
Visitor II
May 24, 2024
Question

Questions about TrustZone Configuration on STM32MP135F-DK

  • May 24, 2024
  • 2 replies
  • 2787 views

Hello,

I am currently engaged in a project that involves using TrustZone to securely display an image on the STM32MP135F-DK. I'm facing several challenges, especially in configuring the framebuffer for secure display purposes:

1. Running the 'hello_world' Example: I am experiencing issues with running the TrustZone 'hello_world' example from OP-TEE on the board. I tried to get the OP-TEE version that supports STM32MP1, compile OP-TEE, and copy the output OP-TEE trustzone's hello_world binary to the board. But it cannot be directly executed on the board.

2. Triggering TrustZone: After installing the SDK for STM32MP135F-DK and recompiling the kernel and drivers as per the instructions from the wiki, I am unsure of how to proceed with testing the OP-TEE 'helloworld' example. Should I compile it within the SDK and then transfer the binary to the board?

3. Secure Framebuffer Configuration: I noticed that the dts file for STM32MP135F-DK already defines a secure framebuffer. Does it provide interfaces to write to the framebuffer, or should I consider writing a driver myself?

I would greatly appreciate any advice you could provide on these issues. Thank you for your time!

 

    This topic has been closed for replies.

    2 replies

    ST Employee
    May 24, 2024

    Hi @hema123,

     

    1. I'am not sure to get the point, so here are several questions to help me to understand your problem:

    Could you please share the link of the 'hello_world' Example ? 

    Did you enable TUI ?

    # Enable Trusted User Interface

    -CFG_WITH_TUI ?= n

    +CFG_WITH_TUI ?= y

    When you say "But it cannot be directly executed on the board" : could you please elaborate a bit more (command lines, logs....)

    2. Yes.

    3. The interface to write into secure framebuffer is available in optee-os/lib/libutee/tui/tui_private.h : it will be usefull to write our own TA.

     

    BR,

    Christophe

    hema123Author
    Visitor II
    May 29, 2024

    Hi, the error I got is

    arm-ostl-linux-gnueabi-ld.bfd: ./hello_world_ta.o: in function `test_TEE_TUIDisplayScreen_1':
    /STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Developer-Package/stm32mp1-openstlinux-23.06.21/sources/optee_examples/hello_world/ta/hello_world_ta.c:121: undefined reference to `TEE_TUIGetScreenInfo'

    I also recompile the Kernel and it looks like CFG_WITH_TUI is enabled by default after adopting the patches using the command suggested by the official website?

    "

        $ tar xf ../fonts.tar.gz

        $ for p in `ls -1 ../*.patch`; do git am $p; done

    "

    Thanks for your help and insights.

     

    ST Employee
    May 29, 2024

    Hello @hema123,

     

    TUI is enabled by default for MP13 in OP-TEE since Ecosystem-v5.0.0.

     

    tui_private.h is an internal header file from OP-TEE, and it is not exposed in the SDK, that's why the compilation fails when you want to include it.

    You need to use the TUI API which is available through SDK:

    #include "tee_tui_api.h"

     

    Regarding the error "undefined reference to `TEE_TUIGetScreenInfo'", I need more time and I will come back to you later.

     

    BR,

    Christophe

     

    hema123Author
    Visitor II
    May 26, 2024

    Thanks for your kind help. I am new to STM32 and OP-TEE and I have some follow-up and basic questions about how to write a frame buffer in STM32MP135


    (1) How to include <tui_private.h>? I start with the hello_world example provided by OP-TEE, and tried to include the header in the hello_world_ta.c file. However, I encounter “tui_private.h: No such file or directory”.
    Should I also update Makefile or something to make it work?


    (2)Then I tried some maybe external APIs, and I include <tee_tui_api.h> in the hello_world_ta.c file. No more other changes to other files. Then I tried to play with function call such as TEE_TUIGetScreenInfo() defined in tee_tui_api. The code part doesn't have any specific error. However, during make procedure, I got error like arm-ostl-linux-gnueabi-ld.bfd:/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Developer-Package/stm32mp1-openstlinux-23.06.21/sources/optee_examples/hello_world/ta/hello_world_ta.c:126: undefined reference to `TEE_TUICheckTextFormat'. Should I modify the host side or makefile to make it work?


    Sorry for these basic questions and any help or ideas will be very helpful.