cancel
Showing results for 
Search instead for 
Did you mean: 

TF-A halts with an exception during boot of simple device tree?

ADeck
Associate III

I have built a device tree file using the details in wiki in CubeMX. I build with my custom machine using Yocto.

When I run the built TF-A binary I get the following output on UART4:

NOTICE:  CPU: STM32MP157CAD Rev.B
NOTICE:  Model: STMicroelectronics custom STM32CubeMX board
WARNING: VDD unknownINFO:    Reset reason (0x15):
INFO:      Power-on Reset (rst_por)
INFO:    Using USB
INFO:      Instance 2
INFO:    Boot used partition fsbl1
NOTICE:  BL2: v2.2-r2.0(debug):v2.2-dirty
NOTICE:  BL2: Built : 13:36:23, Oct 22 2019
PANIC at PC : 0x2ffd5f27
 
Exception mode=0x00000016 at: 0x2ffd5f27

Any idea what I am doing wrong?

Here is my very simple device tree

/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
/*
 * Copyright (C) STMicroelectronics 2020 - All Rights Reserved
 * Author: STM32CubeMX code generation for STMicroelectronics.
 */
 
/* For more information on Device Tree configuration, please refer to
 * https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration
 */
 
/dts-v1/;
#include <dt-bindings/pinctrl/stm32-pinfunc.h>
#include <dt-bindings/clock/stm32mp1-clksrc.h>
#include <dt-bindings/soc/st,stm32-etzpc.h>
 
#include "stm32mp157.dtsi"
#include "stm32mp15xc.dtsi"
#include "stm32mp15xxad-pinctrl.dtsi"
/* !!! log : Warning - DDR not configured: unknown DDR dtsi  !!! */
/*#include "???-ddr.dtsi"*/
 
/* USER CODE BEGIN includes */
/* USER CODE END includes */
 
/ {
	model = "STMicroelectronics custom STM32CubeMX board";
	compatible = "st,stm32mp157c-toxic-mx", "st,stm32mp157";
 
	aliases {
		serial0 = &uart4;
	};
 
	chosen {
		stdout-path = "serial0:115200n8";
	};
	clocks {
		/* USER CODE BEGIN clocks */
		/* USER CODE END clocks */
 
		clk_lse: clk-lse {
 
			/* USER CODE BEGIN clk_lse */
			/* USER CODE END clk_lse */
		};
 
		clk_hse: clk-hse {
			st,bypass;
 
			/* USER CODE BEGIN clk_hse */
			/* USER CODE END clk_hse */
		};
	};
 
}; /*root*/
 
&pinctrl {
	uart4_pins_mx: uart4_mx-0 {
		pins1 {
			pinmux = <STM32_PINMUX('B', 2, AF8)>; /* UART4_RX */
			bias-disable;
		};
		pins2 {
			pinmux = <STM32_PINMUX('G', 11, AF6)>; /* UART4_TX */
			bias-disable;
			drive-push-pull;
			slew-rate = <0>;
		};
	};
 
	usb_otg_hs_pins_mx: usb_otg_hs_mx-0 {
		pins {
			pinmux = <STM32_PINMUX('A', 10, ANALOG)>; /* USB_OTG_HS_ID */
		};
	};
 
	/* USER CODE BEGIN pinctrl */
	/* USER CODE END pinctrl */
};
 
&pinctrl_z {
	/* USER CODE BEGIN pinctrl_z */
	/* USER CODE END pinctrl_z */
};
 
&rcc {
	st,csi-cal;
	st,hsi-cal;
	st,cal-sec = <60>;
	st,clksrc = <
		CLK_MPU_PLL1P
		CLK_AXI_HSI
		CLK_MCU_HSI
		CLK_PLL12_HSI
		CLK_PLL3_HSI
		CLK_PLL4_HSI
		CLK_RTC_LSI
		CLK_MCO1_DISABLED
		CLK_MCO2_DISABLED
	>;
	st,clkdiv = <
		1 		/*MPU*/
		0 		/*AXI*/
		0 		/*MCU*/
		0 		/*APB1*/
		0 		/*APB2*/
		0 		/*APB3*/
		0 		/*APB4*/
		0 		/*APB5*/
		0 		/*RTC*/
		0 		/*MCO1*/
		0 		/*MCO2*/
	>;
	st,pkcs = <
		CLK_CKPER_DISABLED
		CLK_ETH_DISABLED
		CLK_SDMMC12_DISABLED
		CLK_STGEN_HSI
		CLK_USBPHY_HSE
		CLK_SPI2S1_DISABLED
		CLK_SPI2S23_DISABLED
		CLK_SPI45_DISABLED
		CLK_SPI6_DISABLED
		CLK_I2C46_DISABLED
		CLK_SDMMC3_DISABLED
		CLK_USBO_USBPHY
		CLK_ADC_DISABLED
		CLK_CEC_DISABLED
		CLK_I2C12_DISABLED
		CLK_I2C35_DISABLED
		CLK_UART1_DISABLED
		CLK_UART24_PCLK1
		CLK_UART35_DISABLED
		CLK_UART6_DISABLED
		CLK_UART78_DISABLED
		CLK_SPDIF_DISABLED
		CLK_SAI1_DISABLED
		CLK_SAI2_DISABLED
		CLK_SAI3_DISABLED
		CLK_SAI4_DISABLED
		CLK_LPTIM1_DISABLED
		CLK_LPTIM23_DISABLED
		CLK_LPTIM45_DISABLED
	>;
};
 
&bsec{
	status = "okay";
	secure-status = "okay";
 
	/* USER CODE BEGIN bsec */
	/* USER CODE END bsec */
};
 
&etzpc{
	st,decprot = <
	/*"Non Secured" peripherals*/
	DECPROT(STM32MP1_ETZPC_DMA1_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
	DECPROT(STM32MP1_ETZPC_DMAMUX_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
	DECPROT(STM32MP1_ETZPC_UART4_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
	DECPROT(STM32MP1_ETZPC_OTG_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
	/*"Secured" peripherals*/
	DECPROT(STM32MP1_ETZPC_STGENC_ID, DECPROT_S_RW, DECPROT_UNLOCK)
	/*"Mcu Isolation" peripherals*/
	DECPROT(STM32MP1_ETZPC_DMA2_ID, DECPROT_MCU_ISOLATION, DECPROT_UNLOCK)
 
	/*Restriction: following IDs are not managed  - please to use User-Section if needed:
		STM32MP1_ETZPC_SRAMx_ID, STM32MP1_ETZPC_RETRAM_ID, STM32MP1_ETZPC_BKPSRAM_ID*/
 
	/* USER CODE BEGIN etzpc_decprot */
		/*STM32CubeMX generates a basic and standard configuration for ETZPC.
		Additional device configurations can be added here if needed.
		"etzpc" node could be also overloaded in "addons" User-Section.*/
	/* USER CODE END etzpc_decprot */
	>;
 
	secure-status = "okay";
 
	/* USER CODE BEGIN etzpc */
	/* USER CODE END etzpc */
};
 
&rcc{
	status = "okay";
	secure-status = "okay";
 
	/* USER CODE BEGIN rcc */
	/* USER CODE END rcc */
};
 
&rtc{
	status = "okay";
	secure-status = "okay";
 
	/* USER CODE BEGIN rtc */
	/* USER CODE END rtc */
};
 
&tamp{
	status = "okay";
	secure-status = "okay";
 
	/* USER CODE BEGIN tamp */
	/* USER CODE END tamp */
};
 
&uart4{
	pinctrl-names = "default";
	pinctrl-0 = <&uart4_pins_mx>;
	status = "okay";
 
	/* USER CODE BEGIN uart4 */
	/* USER CODE END uart4 */
};
 
&usbotg_hs{
	pinctrl-names = "default";
	pinctrl-0 = <&usb_otg_hs_pins_mx>;
	status = "okay";
 
	/* USER CODE BEGIN usbotg_hs */
	/* USER CODE END usbotg_hs */
};
 
&usbphyc{
	status = "okay";
 
	/* USER CODE BEGIN usbphyc */
	/* USER CODE END usbphyc */
};
 
&usbphyc_port0{
	status = "okay";
 
	/* USER CODE BEGIN usbphyc_port0 */
	/* USER CODE END usbphyc_port0 */
};
 
&usbphyc_port1{
	status = "okay";
 
	/* USER CODE BEGIN usbphyc_port1 */
	/* USER CODE END usbphyc_port1 */
};
 
/* USER CODE BEGIN addons */
/* USER CODE END addons */
 

2 REPLIES 2
PatrickF
ST Employee

Is your TF-A started from Flash or from USB/UART ?

Maybe something around HSE clock. You defined 'analog bypass', is it intended ?

Note that TF-A will initialize the DDR and load uBoot into it, I see some commented lines for DDR in your DT.

I recommend also to look at following pages:

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

https://community.st.com/s/article/FAQ-STM32MP1-bring-up-troubleshooting-guide

https://wiki.st.com/stm32mpu/wiki/Clock_device_tree_configuration_-_Bootloader_specific#DT_configuration_for_HSE

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.
sylvain
Associate II

try to enable the hash...

in your dts, add:

&hash1{

    status = "okay";

};