cancel
Showing results for 
Search instead for 
Did you mean: 

What would cause the fsbl tf-a bootloader to crash after flashing?

JKell.6
Associate III

I'm using STM32CubeProgrammer to flash my custom target using an STM32MP153AAA MPU. I have onboard a 4GB eMMC memory. During the programming process through DFU all seems good and finishes at 100% but then sits for a bit and I get errors. Seemingly TF-A is crashing or not starting after load. I'm searching for causes and how to fix. Attached is my TSV file using in the programmer. I'm using EcoSystem 4.1.0.

1 ACCEPTED SOLUTION

Accepted Solutions
JKell.6
Associate III

Hi Patrick,

Last week I was able to get past this Device Tree PMIC issue. Turns out there is a way to define power when not using a PMIC. What I found was it has to be defined and then specifying the code below in the device tree works. And it'd be necessary to do this for other device trees as well (e.g. U-Boot, Kernel) in the set.

regulators {
		vddcore: regulator-vdd_core {
			compatible = "regulator-fixed";
			regulator-name = "vddcore";
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-always-on;
		};
		
		vdd_ddr: regulator-vdd_ddr {
			compatible = "regulator-fixed";
			regulator-name = "vdd_ddr";
			regulator-min-microvolt = <1350000>;
			regulator-max-microvolt = <1350000>;
			regulator-always-on;
		};
		
		vdd_usb: regulator-vdd_usb {
			compatible = "regulator-fixed";
			regulator-name = "vdd_usb";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			regulator-always-on;
		};
		
		vdd: regulator-vdd {
			compatible = "regulator-fixed";
			regulator-name = "vdd";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			regulator-always-on;
		};	
	};
 
/* USER CODE BEGIN addons */
&pwr_regulators {
	pwr-supply = <&vdd>;
};
/* USER CODE END addons */

Now onto the next problem, code runs in debugger but not from programming. I'll save that for another thread.

Thanks,

Jim

View solution in original post

9 REPLIES 9
JKell.6
Associate III

Here is a screenshot showing programming and the crash if this provides any further information. Minicom is connected to UART4 from the MPU.

0693W00000Y8YSkQAN.png

PatrickF
ST Employee

Hi @Community member​ 

This kind of crash during Flashing is maybe caused by an I2C STPMIC or DDR issue (TF-A run from SYSRAM and initialize STPMIC using I2C to power-up and init DDR in order to load uBoot on next step).

See https://community.st.com/s/article/FAQ-STM32MP1-Bring-up-procedure

Regards.

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

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.
Olivier GALLIEN
ST Employee

Hi @Community member​ ,

Such an early Panic in TF-A usually highlight about a wrong Device tree settings, for example at clock level.

You might find on this community post about similar issue :

for exemple :

https://community.st.com/s/question/0D53W000005qRjZSAU/cannot-boot-up-custom-board-which-based-on-stm32mp157cdk2-only-get-message-from-uart-panic-at-pc-0x2ffdc323-exception-mode0x00000016-at-0x2ffda000

If you don't find the problem please share your TF-A DT

Hope 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.
JKell.6
Associate III

Thanks Patrick and Oliver your responses are spot on. After posting this I stumbled across those links you proposed and yes this is the likely cause but not due to clocking which I thought at first but I2C4. Apparently TF-A defaults to expecting a STPMIC to be connected to I2C4 which on my target I'm not using. This link as well provides some guidance on this - https://st.my.site.com/community/s/article/FAQ-STM32MP1-bring-up-troubleshooting-guide. I just need to find a way to disable the use of STPMIC by TF-A.

JKell.6
Associate III

Patrick,

In particular, the link you provided has some interesting information about this. Is it true that CubeMX does not generate fully usable device trees and that those device trees must still be manually edited to fit an application?

"To elaborate the device tree file, you start a STM32CubeMX project from STM32CubeMx MCU selector. STM32CubeMX generates partially the device tree.

The device tree files generated by STM32CubeMX are incomplete, it cannot be used as it.

The device tree will contains the GPIO pin muxing, the RCC settings, the DRAM configuration and HW execution context for peripheral isolation. The driver nodes properties are not generated by the tool.

These node parameters must be added manually with the help of the wiki device tree articles above."

And what makes this even more difficult in my case is that I'm not using a PMIC so nodes for I2C4 and PWR in the DTSI file are not there by design. I've been searching for how to disable TF-A from using it. I haven't found anything yet. From what I'm reading I'll need to write code in TF-A source to make it think the PMIC is responding when it really doesn't exist.

Jim

Hi,

I'm not SW expert, but you should not have to change TF-A source code to work without STPMIC.

All is likely to be configured using Device Tree settings.

There is many 3rd party SOM using STM32MP1 without STPMIC and you could find some clues from that.

See for example: https://community.st.com/s/question/0D53W00001pYs9XSAS/in-the-beal-environment-what-files-are-needed-to-generate-fip-after-compiling-optee

Device Tree is central and a complex part, sticking as much as possible close to existing board examples (e.g. DK1/DK2 or EV1) will help to add/edit missing portions from CubeMx generated files.

https://wiki.st.com/stm32mpu/wiki/STM32_MPU_device_tree

Regards.

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.
JKell.6
Associate III

Hi Patrick,

Agreed, that's what I was thinking and hoping. I shouldn't have to start messing around with Linux at that level just to get it to start because of this missing PMIC. Device Tree makes sense but it is quite complex and teetering on coding. The links to the SOM dts'es are helpful though as well as the wiki for device trees. I'll get to digging into these.

My target is based on the DK2. Differences are SDMMC2 for eMMC flash and SDMMC3 for SD Card. SDMMC1 is not used at all due to using LTDC for the display interface and then there's no PMIC. Everything else is the same excluding missing peripherals (e.g. no ethernet, etc.).

Thanks for the guidance,

Jim

JKell.6
Associate III

Hi Patrick,

Last week I was able to get past this Device Tree PMIC issue. Turns out there is a way to define power when not using a PMIC. What I found was it has to be defined and then specifying the code below in the device tree works. And it'd be necessary to do this for other device trees as well (e.g. U-Boot, Kernel) in the set.

regulators {
		vddcore: regulator-vdd_core {
			compatible = "regulator-fixed";
			regulator-name = "vddcore";
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-always-on;
		};
		
		vdd_ddr: regulator-vdd_ddr {
			compatible = "regulator-fixed";
			regulator-name = "vdd_ddr";
			regulator-min-microvolt = <1350000>;
			regulator-max-microvolt = <1350000>;
			regulator-always-on;
		};
		
		vdd_usb: regulator-vdd_usb {
			compatible = "regulator-fixed";
			regulator-name = "vdd_usb";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			regulator-always-on;
		};
		
		vdd: regulator-vdd {
			compatible = "regulator-fixed";
			regulator-name = "vdd";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			regulator-always-on;
		};	
	};
 
/* USER CODE BEGIN addons */
&pwr_regulators {
	pwr-supply = <&vdd>;
};
/* USER CODE END addons */

Now onto the next problem, code runs in debugger but not from programming. I'll save that for another thread.

Thanks,

Jim

Hi JKell.6,

What do you mean with "it has to be defined"... where this definition has to go?. I am into the same issue.

Thank you in advance.