Skip to main content
Associate II
July 5, 2023
Question

STM32MP135 ST PMIC Driver panic

  • July 5, 2023
  • 7 replies
  • 15696 views

We designed a STM32MP135 based SOM, without using the ST I2C PMIC,  I was able to disable the PMIC driver in TF-A by removing the i2c 4 node in TF-A's dts file, while I could not get the same result for optee-os,  even I removed the i2c-4 node in optee-os' dts file, I still got message saying panic, following is the full log:

 

NOTICE: CPU: STM32MP135D Rev.Y
NOTICE: Model: STMicroelectronics STM32MP135F-DK Discovery Board
WARNING: VDD unknown
INFO: Reset reason (0x4):
INFO: Pad Reset from NRST
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):2021.05-5963-ga40218f3c9(a40218f3)
NOTICE: BL2: Built : 09:55:01, Jul 5 2023
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-1066 bin F 1x4Gb 533MHz v1.53
INFO: Memory size = 0x20000000 (512 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
INFO: BL2: Loading image id 8
INFO: Loading image id=8 at address 0xde200000
INFO: Image id=8 loaded: 0xde200000 - 0xde27e250
INFO: BL2: Loading image id 2
INFO: Loading image id=2 at address 0xc0400000
INFO: Image id=2 loaded: 0xc0400000 - 0xc040f750
INFO: BL2: Skip loading image id 16
INFO: BL2: Loading image id 5
INFO: Loading image id=5 at address 0xc0000000
INFO: Image id=5 loaded: 0xc0000000 - 0xc00e4444
NOTICE: BL2: Booting BL32
INFO: Entry point address = 0xde200000
INFO: SPSR = 0x1d3
E/TC:0 0 Panic at core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pmic.c:218 <initialize_pmic_i2c>
E/TC:0 0 TEE load address @ 0xde200000
E/TC:0 0 Call stack:
E/TC:0 0 0xde203f19
E/TC:0 0 0xde21da13
E/TC:0 0 0xde20910f
E/TC:0 0 0xde21c4b3
E/TC:0 0 0xde21c57d
E/TC:0 0 0xde21cd03
E/TC:0 0 0xde21e6f9
E/TC:0 0 0xde203dff
E/TC:0 0 0xde200198

Any one have suggestion on this?

 

This topic has been closed for replies.

7 replies

Macdog
Associate III
July 7, 2023

You will most likely need to take STMicro's OPTEE reference software and make some changes.    It may be possible to remove the power management features using a build configuration flag, but it may require some code changes as well.   I ran into a similar issue when removing secure storage support from OPTEE.     Looking at this file for the version you are using might help with some configurations to search for.

core/arch/arm/plat-stm32mp1/conf.mk

 

Associate
July 11, 2023

Dear Mr. Macdog, following your prompt, I found the conf.mk file and modified it to add my own device tree. My board uses STPMIC1D, and I still have the same problem as this post.

Associate
July 11, 2023

Hello, Mr. efancier, I have the same problem as you, the same panic. Have you modified it now? Ask for your advice

efancierAuthor
Associate II
July 13, 2023

Hi lebeer, I am still working on it, will let you know if there's any progress.

Associate
July 11, 2023

NOTICE: CPU: STM32MP135F Rev.Y
NOTICE: Model: STMicroelectronics STM32MP135F-DK Discovery Board
INFO: PMIC version = 0x21
INFO: Reset reason (0x35):
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 USB
INFO: Instance 2
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.6-stm32mp1-r2.0(debug):()
NOTICE: BL2: Built : 05:53:17, Jul 6 2023
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-DDR3L 16bits 533000kHz
DDR expected freq 533000 kHz, current is 533000 kHz
INFO: Memory size = 0x40000000 (1024 MB)
INFO: DFU USB START...
INFO: handle USB : Suspend int
INFO: USB Suspend mode
INFO: handle USB : Reset
INFO: handle USB : Reset
INFO: handle USB : Reset
INFO: handle USB : Reset
INFO: handle USB : Reset
INFO: phase ID :3, Manifestation 0 at c716c4fe
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 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 0xfe200000
INFO: Image id=4 loaded: 0xfe200000 - 0xfe20001c
INFO: OPTEE ep=0xfe200000
INFO: OPTEE header info:
INFO: magic=0x4554504f
INFO: version=0x2
INFO: arch=0x0
INFO: flags=0x0
INFO: nb_images=0x1
INFO: BL2: Loading image id 8
INFO: Loading image id=8 at address 0xfe200000
INFO: Image id=8 loaded: 0xfe200000 - 0xfe2792e8
INFO: BL2: Loading image id 2
INFO: Loading image id=2 at address 0xc0400000
INFO: Image id=2 loaded: 0xc0400000 - 0xc040e958
INFO: BL2: Skip loading image id 16
INFO: BL2: Loading image id 5
INFO: Loading image id=5 at address 0xc0000000
INFO: Image id=5 loaded: 0xc0000000 - 0xc00e4534
NOTICE: BL2: Booting BL32
INFO: Entry point address = 0xfe200000
INFO: SPSR = 0x1d3
I/TC: Early console on UART#4
I/TC:
I/TC: Non-secure external DT found
I/TC: Embedded DTB found
I/TC: OP-TEE version: Unknown_3.16 (gcc version 11.3.0 (GCC)) #75 Thu Jul 6 05:57:21 UTC 2023 arm
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: WARNING: All debug access are allowed
E/TC:0 0 Panic at core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pmic.c:218 <initialize_pmic_i2c>
E/TC:0 0 TEE load address @ 0xfe200000
E/TC:0 0 Call stack:
E/TC:0 0 0xfe203cd5
E/TC:0 0 0xfe21bced
E/TC:0 0 0xfe208cdb
E/TC:0 0 0xfe21a8d3
E/TC:0 0 0xfe21a99d
E/TC:0 0 0xfe21b093
E/TC:0 0 0xfe21c8b5
E/TC:0 0 0xfe203b17
E/TC:0 0 0xfe200198

Associate
July 11, 2023

I hope the great God in the forum can help me, point out my mistakes or need to be modified, thank you!!

Erwan SZYMANSKI
Technical Moderator
July 17, 2023

Hello @lebeer@efancier ,
Did you manage to solve your issue ? If not let me know it ASAP to solve it together.

Kind regards,
Erwan.

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.
efancierAuthor
Associate II
July 17, 2023

@Erwan SZYMANSKI , Hi Erwan, thank you for asking, unfortunately the problem still exists. 

debugging
Lead
September 25, 2023

CFG_STPMIC1?=y  in conf.mk solved the panic for me. (also discrete board) (was using a clean developer tree( it seem the conf.ml defaults to PMIC?=y because ST DK/EV boards use PMIC) This fix should be the accepted answer.

Associate
October 4, 2023

Hi @debugging ,

Thanks for your help but error is still here.

In optee-os/stm32mp135f-my_board.dts file, reconfiguration of I2C4 is done as on TF-A (this part is successfully loaded) but in stm32_i2c.C function

 

bool stm32_i2c_is_device_ready(struct i2c_handle_s *hi2c, uint32_t dev_addr,
 unsigned int trials, unsigned int timeout_ms)

 

error is displayed when OPTEE is loaded.

Do you have any idea to solve this problem?

Thanks

Associate II
February 2, 2024

I have the same issue. This seems to be pretty common one as I found many posts on this. I have the PB7 and PE15 as my I2C, TFA boots correctly but OPTEE panics 

Visitor II
April 24, 2024

I am experiencing similar problem. Can you tell me how you solved it?

Visitor II
April 24, 2024

@Vince60 Can you tell me how you solved it?

Associate
April 24, 2024

Hi @angelet86 ,

In STM32CubeMX you can activate I2C4 in secure context (A7S OP-TEE). Then generate code and import it under your Yocto project.

Regards