cancel
Showing results for 
Search instead for 
Did you mean: 

I got PANIC at PC : 0x2ffec98b - Why?

DMårt
Lead

I made a custom board with the processor STM32MP151AAC3 and own firmwire https://github.com/DanielMartensson/STM32-Computer/tree/main/STM32CubeIDE/STM32-Computer-Firmware . I have compiled the TF-A by using STM32CubeIDE. It was some bugs with the TF-A configuration, but it seems I fixed them in this thread: 

Solved: BUG: Label or path X_pins_y not found - Compiling ... - STMicroelectronics Community

 

PANIC at PC : 0x2ffec98b

Exception mode=0x00000016 at: 0x2ffec98b

 

I have tried to flash it with firmware of STM32MP157 with another I2C4 pin configuration. And it failed. 

 

NOTICE:  CPU: STM32MP151AAC Rev.Z
NOTICE:  Model: STMicroelectronics STM32MP157A eval daughter on eval mother
ERROR:   I2C device not ready
PANIC at PC : 0x2fff101b

Exception mode=0x00000016 at: 0x2fff101b

Trying the Flashout Delete All DK1 STM32MP157a.
Exception mode=0x00000016 at: 0x2fff101b

NOTICE:  CPU: STM32MP151AAC Rev.Z
NOTICE:  Model: STMicroelectronics STM32MP157A-DK1 Discovery Board
ERROR:   I2C device not ready
PANIC at PC : 0x2fff101b

 

That means the following:

  1. The HSE clock is working
  2. The HSE clock is soldered correctly
  3. The I2C is working, even if it was not ready for communication (wrong pins)

Question:

This new error must lead to an answer. What can it be?

 

 

 

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer
33 REPLIES 33
DMårt
Lead

@PatrickF 

I found the solution! The solution is this.

 

Add this to your stm32mp15xx-<project name->-mx.dts inside the tf-a device tree.

/* USER CODE BEGIN includes */
#include "stm32mp15xx-dkx.dtsi"
#include "stm32mp15-pinctrl.dtsi"
/* USER CODE END includes */

and this

	/* USER CODE BEGIN root */
	
	aliases {
		serial0 = &uart4;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};
	/* USER CODE END root */

 

	clocks {
		/* USER CODE BEGIN clocks */
		clk_hsi: clk-hsi {
			clock-frequency = <64000000>;

			/* USER CODE BEGIN clk_hsi */
			/* USER CODE END clk_hsi */
		};
		clk_lse: clk-lse {
			clock-frequency = <32768>;
			st,drive = < LSEDRV_MEDIUM_HIGH >;

			/* USER CODE BEGIN clk_lse */
			/* USER CODE END clk_lse */
		};
		clk_hse: clk-hse {
			clock-frequency = <24000000>;
			st,digbypass;

			/* USER CODE BEGIN clk_hse */
			/* USER CODE END clk_hse */
		};
		/* USER CODE END clocks */
	};

Last thing is to add cpu1 inside the stm32mp151.dtsi file in the fdts folder inside tf-a folder. Or else, you get one error when you're compiling.

	cpus {
		#address-cells = <1>;
		#size-cells = <0>;

		cpu0: cpu@0 {
			compatible = "arm,cortex-a7";
			device_type = "cpu";
			reg = <0>;
			nvmem-cells = <&part_number_otp>;
			nvmem-cell-names = "part_number";
		};
		
		cpu1: cpu@1 {
			/* EMPTY */
		};
	};

 Anyway!

With my FlashLayout, I only run to Id = 0x8 because I haven't done any more.

#Opt	Id	Name	Type	IP	Offset	Binary
-	0x01	fsbl-boot	Binary	none	0x0	arm-trusted-firmware/debug/debug-tf-a-stm32mp151a-stm32-computer-firmware-mx-usb.stm32
-	0x03	fip-boot	FIP	none	0x0	fip/fip-stm32mp151a-stm32-computer-firmware-mx-optee-emmc.bin
P	0x04	fsbl1	Binary	mmc2	boot1	arm-trusted-firmware/tf-a-stm32mp151a-stm32-computer-firmware-mx-optee-emmc.stm32
P	0x05	fsbl2	Binary	mmc2	boot2	arm-trusted-firmware/tf-a-stm32mp151a-stm32-computer-firmware-mx-optee-emmc.stm32
P	0x06	metadata1	FWU_MDATA	mmc1	0x00080000	arm-trusted-firmware/metadata.bin
P	0x07	metadata2	FWU_MDATA	mmc1	0x00100000	arm-trusted-firmware/metadata.bin
P	0x08	fip-a	FIP	mmc2	0x00180000	fip/fip-stm32mp151a-stm32-computer-firmware-mx-optee-emmc.bin
PED	0x09	fip-b	FIP	mmc2	0x00580000	none
PED	0x0A	u-boot-env	ENV	mmc1	0x00980000	none
P	0x10	bootfs	System	mmc1	0x00A00000	st-image-bootfs-openstlinux-weston-stm32mp1.ext4
P	0x11	vendorfs	FileSystem	mmc1	0x04A00000	st-image-vendorfs-openstlinux-weston-stm32mp1.ext4
P	0x12	rootfs	FileSystem	mmc1	0x05A00000	st-image-weston-openstlinux-weston-stm32mp1.ext4
P	0x13	userfs	FileSystem	mmc1	0xC5A00000	st-image-userfs-openstlinux-weston-stm32mp1.ext4

This is the UART output. It seems that 

  • I started the SYSRAM
  • My STM32MP151AAC3 can communicate with my PMIC.

I think that the memory configuration is not correct, because I have 4GB RAM.

NOTICE:  CPU: STM32MP151AAC Rev.Z
NOTICE:  Model: STMicroelectronics custom STM32CubeMX board - openstlinux-6.1-yocto-mickledore-mpu-v24.06.26
INFO:    PMIC version = 0x21
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:    FCONF: Reading firmware configuration information for: stm32mp_fuse
INFO:    Using USB
INFO:      Instance 2
INFO:    Boot used partition fsbl1
NOTICE:  BL2: v2.8-stm32mp1-r2.0(debug):9b8d7c5be-dirty(9b8d7c5b)
NOTICE:  BL2: Built : 20:53:22, Aug  3 2024
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 c714f9a2
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 - 0xde00001c
INFO:    OPTEE ep=0xde000000
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 0xde000000
INFO:    Image id=8 loaded: 0xde000000 - 0xde028e08
INFO:    BL2: Skip loading image id 9
INFO:    BL2: Loading image id 2
INFO:    Loading image id=2 at address 0xc0500000
INFO:    Image id=2 loaded: 0xc0500000 - 0xc0511bd8
INFO:    BL2: Skip loading image id 16
INFO:    BL2: Loading image id 5
INFO:    Loading image id=5 at address 0xc0100000
INFO:    Image id=5 loaded: 0xc0100000 - 0xc0214c94
NOTICE:  BL2: Booting BL32
INFO:    Entry point address = 0xde000000
INFO:    SPSR = 0x1d3
I/TC: Early console on UART#4
I/TC: 
I/TC: Embedded DTB found
I/TC: OP-TEE version: f8cb4e8d8-dev (gcc version 12.3.0 (GCC)) #5 Sat Aug  3 23:25:35 UTC 2024 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: Platform stm32mp1: flavor PLATFORM_FLAVOR - DT stm32mp151a-stm32-computer-firmware-mx.dts
I/TC: OP-TEE ST profile: system_services
E/TC:0 0 probe_dt_drivers:795 Probe sequence result: 0x80000000
E/TC:0 0 Panic

 

Conclusion:

I think I have answered my own question.

The problem was that SYSRAM did not start. But now it seems that I have made progress. 

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer
DMårt
Lead

@PatrickF 

I found the solution! The solution is this.

 

Add this to your stm32mp15xx-<project name->-mx.dts inside the tf-a device tree.

 

/* USER CODE BEGIN includes */
#include "stm32mp15xx-dkx.dtsi"
#include "stm32mp15-pinctrl.dtsi"
/* USER CODE END includes */

 

and this

 

	/* USER CODE BEGIN root */
	
	aliases {
		serial0 = &uart4;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};
	/* USER CODE END root */

 

 

 

	clocks {
		/* USER CODE BEGIN clocks */
		clk_hsi: clk-hsi {
			clock-frequency = <64000000>;

			/* USER CODE BEGIN clk_hsi */
			/* USER CODE END clk_hsi */
		};
		clk_lse: clk-lse {
			clock-frequency = <32768>;
			st,drive = < LSEDRV_MEDIUM_HIGH >;

			/* USER CODE BEGIN clk_lse */
			/* USER CODE END clk_lse */
		};
		clk_hse: clk-hse {
			clock-frequency = <24000000>;
			st,digbypass;

			/* USER CODE BEGIN clk_hse */
			/* USER CODE END clk_hse */
		};
		/* USER CODE END clocks */
	};

 

Last thing is to add cpu1 inside the stm32mp151.dtsi file in the fdts folder inside tf-a folder. Or else, you get one error when you're compiling.

 

	cpus {
		#address-cells = <1>;
		#size-cells = <0>;

		cpu0: cpu@0 {
			compatible = "arm,cortex-a7";
			device_type = "cpu";
			reg = <0>;
			nvmem-cells = <&part_number_otp>;
			nvmem-cell-names = "part_number";
		};
		
		cpu1: cpu@1 {
			/* EMPTY */
		};
	};

 

 Anyway!

With my FlashLayout, I only run to Id = 0x8 because I haven't done any more.

 

#Opt	Id	Name	Type	IP	Offset	Binary
-	0x01	fsbl-boot	Binary	none	0x0	arm-trusted-firmware/debug/debug-tf-a-stm32mp151a-stm32-computer-firmware-mx-usb.stm32
-	0x03	fip-boot	FIP	none	0x0	fip/fip-stm32mp151a-stm32-computer-firmware-mx-optee-emmc.bin
P	0x04	fsbl1	Binary	mmc2	boot1	arm-trusted-firmware/tf-a-stm32mp151a-stm32-computer-firmware-mx-optee-emmc.stm32
P	0x05	fsbl2	Binary	mmc2	boot2	arm-trusted-firmware/tf-a-stm32mp151a-stm32-computer-firmware-mx-optee-emmc.stm32
P	0x06	metadata1	FWU_MDATA	mmc1	0x00080000	arm-trusted-firmware/metadata.bin
P	0x07	metadata2	FWU_MDATA	mmc1	0x00100000	arm-trusted-firmware/metadata.bin
P	0x08	fip-a	FIP	mmc2	0x00180000	fip/fip-stm32mp151a-stm32-computer-firmware-mx-optee-emmc.bin
PED	0x09	fip-b	FIP	mmc2	0x00580000	none
PED	0x0A	u-boot-env	ENV	mmc1	0x00980000	none
P	0x10	bootfs	System	mmc1	0x00A00000	st-image-bootfs-openstlinux-weston-stm32mp1.ext4
P	0x11	vendorfs	FileSystem	mmc1	0x04A00000	st-image-vendorfs-openstlinux-weston-stm32mp1.ext4
P	0x12	rootfs	FileSystem	mmc1	0x05A00000	st-image-weston-openstlinux-weston-stm32mp1.ext4
P	0x13	userfs	FileSystem	mmc1	0xC5A00000	st-image-userfs-openstlinux-weston-stm32mp1.ext4

 

This is the UART output. It seems that 

  • I started the SYSRAM
  • My STM32MP151AAC3 can communicate with my PMIC.

I think that the memory configuration is not correct, because I have 4GB RAM.

NOTICE:  CPU: STM32MP151AAC Rev.Z
NOTICE:  Model: STMicroelectronics custom STM32CubeMX board - openstlinux-6.1-yocto-mickledore-mpu-v24.06.26
INFO:    PMIC version = 0x21
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:    FCONF: Reading firmware configuration information for: stm32mp_fuse
INFO:    Using USB
INFO:      Instance 2
INFO:    Boot used partition fsbl1
NOTICE:  BL2: v2.8-stm32mp1-r2.0(debug):9b8d7c5be-dirty(9b8d7c5b)
NOTICE:  BL2: Built : 20:53:22, Aug  3 2024
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 c714f9a2
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 - 0xde00001c
INFO:    OPTEE ep=0xde000000
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 0xde000000
INFO:    Image id=8 loaded: 0xde000000 - 0xde028e08
INFO:    BL2: Skip loading image id 9
INFO:    BL2: Loading image id 2
INFO:    Loading image id=2 at address 0xc0500000
INFO:    Image id=2 loaded: 0xc0500000 - 0xc0511bd8
INFO:    BL2: Skip loading image id 16
INFO:    BL2: Loading image id 5
INFO:    Loading image id=5 at address 0xc0100000
INFO:    Image id=5 loaded: 0xc0100000 - 0xc0214c94
NOTICE:  BL2: Booting BL32
INFO:    Entry point address = 0xde000000
INFO:    SPSR = 0x1d3
I/TC: Early console on UART#4
I/TC: 
I/TC: Embedded DTB found
I/TC: OP-TEE version: f8cb4e8d8-dev (gcc version 12.3.0 (GCC)) #5 Sat Aug  3 23:25:35 UTC 2024 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: Platform stm32mp1: flavor PLATFORM_FLAVOR - DT stm32mp151a-stm32-computer-firmware-mx.dts
I/TC: OP-TEE ST profile: system_services
E/TC:0 0 probe_dt_drivers:795 Probe sequence result: 0x80000000
E/TC:0 0 Panic

Conclusion:

I think I have answered my own question.

The problem was that SYSRAM did not start. But now it seems that I have made progress. 

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer

Hi @DMårt 

Have you moved forward with your board running process? I am in exactly the same place as your log snip shows. I have the following output:

I/TC: OP-TEE ST profile: system_services
E/TC:0 0 probe_dt_drivers:795 Probe sequence result: 0x80000000
E/TC:0 0 Panic

 

@rgruberski 

Do you have the same processor as In do?

If yes, check your my custom board. It's working like a charm!

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer

Thank you for the quick reply! I have quite a similar processor, STM32MP151FAD. Is it the correct repository https://github.com/DanielMartensson/STM32-Computer/?

@DMårt 

Do you know what the error below means? I found nothing about that, so I'm not sure what to look for or where to start debugging. Thank you!

 

I/TC: OP-TEE ST profile: system_services
E/TC:0 0 probe_dt_drivers:795 Probe sequence result: 0x80000000
E/TC:0 0 Panic

 

@rgruberski 

Yes it's the repository. Notice it's for MP15XXAC, but if you copy the device tree and change the pins, then it will work.

Make sure you get the schematic from Circuitmaker as well.

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer

@DMårt 

Now, my results are as follows:

 

INFO:    Image id=2 loaded: 0xc0500000 - 0xc051aba0
INFO:    BL2: Skip loading image id 16
INFO:    BL2: Loading image id 5
INFO:    Loading image id=5 at address 0xc0100000
INFO:    Image id=5 loaded: 0xc0100000 - 0xc0214c94
NOTICE:  BL2: Booting BL32
INFO:    Entry point address = 0xde000000
INFO:    SPSR = 0x1d3
I/TC: Early console on UART#4
I/TC: 
I/TC: Embedded DTB found
I/TC: OP-TEE version: Unknown_3.19 (gcc version 12.3.0 (GCC)) #8 Wed Sep 11 18:34:40 UTC 2024 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: Platform stm32mp1: flavor PLATFORM_FLAVOR - DT stm32mp151f-mp151fadx-mx.dts
I/TC: OP-TEE ST profile: system_services
I/TC: DTB disables console

 

I don't know what is wrong and how to move forward. Can you recommend something? I am still learning, so I know my knowledge is incomplete

@rgruberski 

You need to enable debugg for Opt-ee.

Very easy! Go to Makefile.sdk in Optee and change to DEBUG=y and DEBUG_LEVEL=4. It's currently on 2 (I/TC) for the moment.

 

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer

@DMårt 

Thank you! I moved forward but still don't know how to run it. I have a lot of logs, but I can't see anything wrong. Would you look at it and make any suggestions? Sorry for bothering you, but you are the only person who can help me. I can find nothing on the Internet, and the materials are minimal.

I don't know where you are from, but we can drink something if we meet one time Thank you for being so supportive! Please share if you know something you can recommend to learn more about the STM31MP1 series.

I attached the complete log from the booting process.

The problem I have is the flashing process hanging after the 0x3 stage. Please look at the following log:

# STM32_Programmer_CLI -c port=usb1 -d arm-trusted-firmware/tf-a-stm32mp151f-mp151fadx-mx-usb.stm32 0x1 -s 0x1 -d fip/fip-stm32mp151f-mp151fadx-mx-optee-emmc.bin 0x3 -s 0x3
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.16.0                  
      -------------------------------------------------------------------



USB speed   : High Speed (480MBit/s)
Manuf. ID   : STMicroelectronics
Product ID  : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
SN          : 004100423239510B37383434
DFU protocol: 1.1
Board       : --
Device ID   : 0x0500
Device name : STM32MP15xx
Device type : MPU
Revision ID : --  
Device CPU  : Cortex-A7


Memory Programming ...
Opening and parsing file: tf-a-stm32mp151f-mp151fadx-mx-usb.stm32
  File          : tf-a-stm32mp151f-mp151fadx-mx-usb.stm32
  Size          : 220,41 KB 
  Partition ID  : 0x01 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:01.609

RUNNING Program ... 
  Address:      : 0x1
Start operation achieved successfully


Memory Programming ...
Opening and parsing file: fip-stm32mp151f-mp151fadx-mx-optee-emmc.bin
  File          : fip-stm32mp151f-mp151fadx-mx-optee-emmc.bin
  Size          : 1,60 MB 
  Partition ID  : 0x03 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:02.028

RUNNING Program ... 
  Address:      : 0x3

Reconnecting the device ...

Error: Unable to reconnect the target device: time out expired
Error: Start operation failed