cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP15x lines: Enable back OP-TEE secure services by executin OP-TEE in SYSRAM

Auoryus
Associate

Hi. I guess I need some help with flashing the STM32MP157F-DK2. I wanted to use the PKCS#11 TA. But calling

$ pkcs11-tool --show-info --module /usr/lib/libckteec.so.0

gives me the error that no pkcs11-tool is found. After some research I found out that secure services are disabled by default for the ecosystem >= 5.0.0. To renable them one has to build OP-TEE and TF-A with CFG_STM32MP1_OPTEE_IN_SYSRAM=y and STM32MP1_OPTEE_IN_SYSRAM=1. After doing so and making sure that the files are built with those flags I wanted to flash the board with the new files. But when I flash the board I receive the following output:

Exception mode=0x00000016 at: 0x2ffec907
NOTICE: CPU: STM32MP157FAC Rev.Z
NOTICE: Model: STMicroelectronics STM32MP157F-DK2 Discovery Board
NOTICE: Board: MB1272 Var4.0 Rev.C-03
INFO: PMIC version = 0x21
INFO: TF-A Reset Reason Called TXNX
INFO: Reset reason (0x15):
INFO: Power-on Reset (rst_por)
INFO: FCONF: Reading TB_FW firmware configuration file from: 0x2ffe2000
INFO: FCONF: Reading firmware configuration information for: stm32mp_io
INFO: Using USB
INFO: Instance 2
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.8-stm32mp1-r1.0(debug):c1a09d428-dirty(c1a09d42)
NOTICE: BL2: Built : 08:45:21, Sep 20 2023
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-DDR3L 16bits 533000kHz
INFO: Memory size = 0x20000000 (512 MB)
INFO: DFU USB START...
INFO: phase ID :3, Manifestation 3 at c718618a
INFO: Send detach request
INFO: Receive DFU Detach
INFO: DFU USB STOP...
INFO: BL2: Loading image id 1
INFO: Loading image id=1 at address 0x2ffff000
INFO: Image id=1 loaded: 0x2ffff000 - 0x2ffff1ea
INFO: FCONF: Reading FW_CONFIG firmware configuration file from: 0x2ffff000
INFO: FCONF: Reading firmware configuration information for: dyn_cfg
INFO: FCONF: Reading firmware configuration information for: stm32mp1_firewall
INFO: BL2: Loading image id 4
INFO: Loading image id=4 at address 0xde000000
INFO: Image id=4 loaded: 0xde000000 - 0xde00002c
INFO: OPTEE ep=0xde000000
INFO: OPTEE header info:
INFO: magic=0x4554504f
INFO: version=0x2
INFO: arch=0x0
INFO: flags=0x0
INFO: nb_images=0x2
WARNING: The load address in optee header 0x2ffc0000 - 0x2ffd38e0 is not in reserved area: 0xde000000 - 0xe0000000.
ERROR: OPTEE header parse error.
PANIC at PC : 0x2ffec907

My guess is that the new load address from the optee header is invalid. What is the right way to fix this? Thanks in advance.

 

1 REPLY 1
Olivier GALLIEN
ST Employee

Hi @Auoryus ,

 

I can"t comment for PKCS11, for OPTEE mapping please have a look to wiki How to configure a 256MB DDR mapping from STM32 MPU Distribution Package - stm32mpu and cross check that configuration is complete and consistent in all BSP component 

Let me know if it help

 

Olivier   

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.