cancel
Showing results for 
Search instead for 
Did you mean: 

OPTEE header parse error on STM32MP135F-DK

JKim.2
Associate III

Hello,

 

I'm changing the DDR3 size from 512MB to 1GB on the STM32MP135F-DK board. The modifications were done as below. After that, I met the OPTEE header parse error. Compilation and updating software on board was conducted according to the ST wiki. ( https://wiki.st.com/stm32mpu/wiki/How_to_cross-compile_with_the_Developer_Package ) Please help me to solve this problem.

change from 0x20000000 to 0x40000000

  • stm32mp135f-dk.dts in Linux Kernel, U-Boot, TF-A, and OP-TEE
  • stm32mp135f-dk-fw-config.dts in TF-A
  • stm32mp13-ddr3-1x8Gb-1066-binF.dtsi in TF-A (DDR_ADDRMAP6 0x0F070707 ==> 0x07070707)
  • conf.mk in OP-TEE

Thanks.


NOTICE: CPU: STM32MP135F Rev.Y
NOTICE: Model: STMicroelectronics STM32MP135F-DK Discovery Board
NOTICE: Board: MB1635 Var1.0 Rev.E-02
INFO: PMIC version = 0x21
INFO: Reset reason (0x35):
INFO: TF-A simple example hello
INFO: Power-on Reset (rst_por)
INFO: FCONF: Reading TB_FW firmware configuration file from: 0x2ffe0000
INFO: FCONF: Reading firmware configuration information for: stm32mp_io
INFO: Using SDMMC
INFO: Instance 1
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.6-stm32mp1-r2.0(debug):()
NOTICE: BL2: Built : 07:56:58, Jul 28 2023
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-1066 bin F 1x8Gb 533MHz v1.53
INFO: Memory size = 0x40000000 (1024 MB)
INFO: BL2: Loading image id 1
INFO: Loading image id=1 at address 0x30006000
INFO: Image id=1 loaded: 0x30006000 - 0x30006246
INFO: FCONF: Reading FW_CONFIG firmware configuration file from: 0x30006000
INFO: FCONF: Reading firmware configuration information for: mce_config
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 0xde200000
INFO: Image id=4 loaded: 0xde200000 - 0xde20001c
INFO: OPTEE ep=0xde200000
INFO: OPTEE header info:
INFO: magic=0x4554504f
INFO: version=0x2
INFO: arch=0x0
INFO: flags=0x0
INFO: nb_images=0x1
WARNING: The load address in optee header 0xfe200000 - 0xfe2792e8 is not in reserved area: 0xde200000 - 0xe0000000.
ERROR: OPTEE header parse error.
PANIC at PC : 0x2ffe82b9

Exception mode=0x00000016 at: 0x2ffe82b9

 

36 REPLIES 36
JKim.2
Associate III

@Bernard PUEL @Olivier GALLIEN Hello, previously I failed with the bigger 1GB. I tried smaller 256MB according to the wiki guidance. (  How to configure a 256MB DDR mapping from STM32 MPU Distribution Package - stm32mpu )

I see the mce_config error as below. Do you have some ideas why the error happens?

Thanks.

Jeff

NOTICE: CPU: STM32MP135F Rev.Y
NOTICE: Model: STMicroelectronics STM32MP135F-DK Discovery Board
NOTICE: Board: MB1635 Var1.0 Rev.E-02
INFO: PMIC version = 0x21
INFO: Reset reason (0x74):
INFO: TF-A simple example hello
INFO: System reset generated by MPU (MPSYSRST)
INFO: FCONF: Reading TB_FW firmware configuration file from: 0x2ffe0000
INFO: FCONF: Reading firmware configuration information for: stm32mp_io
INFO: Using SDMMC
INFO: Instance 1
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.6-stm32mp1-r2.0(debug):()
NOTICE: BL2: Built : 07:56:58, Jul 28 2023
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-1066 bin F 1x2Gb 533MHz v1.53
INFO: Memory size = 0x10000000 (256 MB)
INFO: BL2: Loading image id 1
INFO: Loading image id=1 at address 0x30006000
INFO: Image id=1 loaded: 0x30006000 - 0x30006246
INFO: FCONF: Reading FW_CONFIG firmware configuration file from: 0x30006000
INFO: FCONF: Reading firmware configuration information for: mce_config
ERROR: MCE: start/end address higher than physical end
PANIC at PC : 0x2ffe6f67

Exception mode=0x00000016 at: 0x2ffe6f67

Hello Jeff, I think it is easier for you to keep 1GB DDR size except if you are targeting for your product to reduce the DDR for the final product.
Let me know if this is the case and I will provide some reference DT for a board with 1GB DDR.

About the error above, it is related to MCE. MCE is the IP that will encrypt the DDR during run time. OPTEE use this capability so I guess you did an error in OPTEE DT or maybe your FIP binary was not updated during your build. 

Hello Bernard,

Both 256MB and 1GB are my target to achieve. 1GB was the higher priority to me. If you have a referece files, please let me have them. Thanks.

Bernard PUEL
ST Employee
 
Bernard PUEL
ST Employee

The file above is a tarball + 7zipped of BSP ST internal boards.

Your interest for 1GB reference is:

  • stm32mp135.dtsi + stm32mp13xf.dtsi + stm32mp13-pinctrl.dtsi + stm32mp135f-ede.dts = stm32mp135f-ede board (DDR3 1GB)
  • stm32mp135f-ede.dts + stm32mp15xx-evx.dtsi + stm32mp135f-eve.dts = stm32mp135f-eve board (DDR3 1GB)
Bernard PUEL
ST Employee

Please also check your DDR settings in CubeMx that will generate the DDR ctrl settings files, Especially these settings: 

#define DDR_MEM_SIZE
#define DDR_ADDRMAP6

 

Hello Bernard,

For 1GB, DDR_MEM_SIZE 0x40000000 and DDR_ADDRMAP6 0x07070707 were used accordingly.

I referred to DT files of stm32mp135f-ede.dts in your compressed file. Previously, I add reserved-memory for optee_framebuffer and optee for every device tree. The referece device tree doesn't have the reserved-memory for TF-A DT. I followed the example but it can't be booted as below.

<<<<<<<<<<< u-boot DT >>>>>>>>>>>>>

reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;

optee_framebuffer@fd000000 {
reg = <0xfd000000 0x1000000>;
no-map;
};

optee@fe000000 {
reg = <0xfe000000 0x2000000>;
no-map;
};
};

 

<<<<<<<<<< boot log >>>>>>>>>>>>

NOTICE: CPU: STM32MP135F Rev.Y
NOTICE: Model: STMicroelectronics STM32MP135F-DK Discovery Board
NOTICE: Board: MB1635 Var1.0 Rev.E-02
INFO: PMIC version = 0x21
INFO: Reset reason (0x35):
INFO: TF-A simple example hello
INFO: Power-on Reset (rst_por)
INFO: FCONF: Reading TB_FW firmware configuration file from: 0x2ffe0000
INFO: FCONF: Reading firmware configuration information for: stm32mp_io
INFO: Using SDMMC
INFO: Instance 1
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.6-stm32mp1-r2.0(debug):()
NOTICE: BL2: Built : 07:56:58, Jul 28 2023
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-1066 bin F 1x8Gb 533MHz v1.53
INFO: Memory size = 0x40000000 (1024 MB)
INFO: BL2: Loading image id 1
INFO: Loading image id=1 at address 0x30006000
INFO: Image id=1 loaded: 0x30006000 - 0x30006246
INFO: FCONF: Reading FW_CONFIG firmware configuration file from: 0x30006000
INFO: FCONF: Reading firmware configuration information for: mce_config
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 0xde200000
INFO: Image id=4 loaded: 0xde200000 - 0xde20001c
INFO: OPTEE ep=0xde200000
INFO: OPTEE header info:
INFO: magic=0x4554504f
INFO: version=0x2
INFO: arch=0x0
INFO: flags=0x0
INFO: nb_images=0x1
WARNING: The load address in optee header 0xfe200000 - 0xfe2792e8 is not in reserved area: 0xde200000 - 0xe0000000.
ERROR: OPTEE header parse error.
PANIC at PC : 0x2ffe82b9

Exception mode=0x00000016 at: 0x2ffe82b9