cancel
Showing results for 
Search instead for 
Did you mean: 

USB TF-A build stuck on ASSERT: drivers/st/regulator/regulator_fixed.c:81

Patsaoglou
Associate

Hello,

I have made a custom STM32MP133D board and I am in the process of building the custom bring up. The bringup uses discrete regulators and not a pmic. I have followed the process of building the device tree for the TF-A and build the TF-A .stm32 binary configured for USB. The .stm32 successfully flashes but the code stucks on ASSERT: drivers/st/regulator/regulator_fixed.c:81 and Exception mode=0x00000016 at: 0x00000000 suggesting a null pointer and an underline issue with my dts.

I have made the ddr memory tests for the pcb bring up and successfully passes  all the memory  tests using the tfa.dtsi ddr configuration.

I have also attached the the device tree for the tfa.

Can anyone help me with this issue?

// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause)
/*
 * Copyright (C) 2025, STMicroelectronics - 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/stm32mp13-clksrc.h>
#include "stm32mp13-mx.dtsi"

#include "stm32mp133.dtsi"
#include "stm32mp13-ddr.dtsi"

/* USER CODE BEGIN includes */
/* USER CODE END includes */

/ {
	model = "STMicroelectronics custom STM32CubeMX board - openstlinux-6.1-yocto-mickledore-mpu-v24.06.26";
	compatible = "st,stm32mp133d-thingscore-1-mx", "st,stm32mp133";

	memory@c0000000 {
		device_type = "memory";
		reg = <0xc0000000 0x20000000>;

		/* USER CODE BEGIN memory */

		/* USER CODE END memory */
	};

	/* USER CODE BEGIN root */
	aliases {
		serial0 = &uart4;
	};
	
	chosen {
		stdout-path = "serial0:115200n8";
	};
	
	vin:vin{
		compatible = "regulator-fixed";
		regulator-name = "vin";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
	};

	v3v3_ao:v3v3_ao{
		compatible = "regulator-fixed";
		regulator-name = "v3v3_ao";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
	};
	
	vdd: vdd {
	    compatible = "regulator-fixed";
	    regulator-name = "vdd";
	    regulator-min-microvolt = <3300000>;
	    regulator-max-microvolt = <3300000>;
	    regulator-always-on;
	};
	
    vdd_sd: vdd_sd {
        compatible = "regulator-fixed";
        regulator-name = "vdd_sd";
        regulator-min-microvolt = <3300000>;
        regulator-max-microvolt = <3300000>;
        regulator-boot-on;
    };
    
    vdd_cpu: vddcpu {
        compatible = "regulator-fixed";
        regulator-name = "vdd_cpu";
        regulator-min-microvolt = <1250000>;
        regulator-max-microvolt = <1250000>;
        regulator-always-on;
    };
    
    vdd_core: vddcore {
          compatible = "regulator-fixed";
          regulator-name = "vdd_core";
          regulator-min-microvolt = <1250000>;
          regulator-max-microvolt = <1250000>;
          regulator-always-on;
      };
    vdd_ddr: vdd_ddr {
        compatible = "regulator-fixed";
        regulator-name = "vdd_ddr";
        regulator-min-microvolt = <1350000>;
        regulator-max-microvolt = <1350000>;
        regulator-always-on;
    };
    vref_ddr: vref_ddr {
         compatible = "regulator-fixed";
         regulator-name = "vref_ddr";
         regulator-min-microvolt = <675000>; /* 0.5 * VDD_DDR */
         regulator-max-microvolt = <675000>;
         regulator-always-on;
     };
    vtt_ddr: vref_ddr {
		regulator-name = "vtt_ddr";
		regulator-over-current-protection;
		st,regulator-sink-source;
    };
    vdd_usb: vdd_usb {
             compatible = "regulator-fixed";
             regulator-name = "vdd_usb";
             regulator-min-microvolt = <3300000>; /* 0.5 * VDD_DDR */
             regulator-max-microvolt = <3300000>;
             regulator-always-on;
         };
    
	/* USER CODE END root */

	clocks {
		/* USER CODE BEGIN clocks */
		/* USER CODE END 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>;

			/* USER CODE BEGIN clk_hse */
			/* USER CODE END clk_hse */
		};
		clk_i2sin: clk-i2sin {
			status = "disabled";

			/* USER CODE BEGIN clk_i2sin */
			/* USER CODE END clk_i2sin */
		};
	};

}; /*root*/

&pinctrl {
	quadspi_pins_mx: quadspi_mx-0 {
		pins1 {
			pinmux = <STM32_PINMUX('D', 1, AF9)>, /* QUADSPI_BK1_NCS */
					 <STM32_PINMUX('D', 5, AF9)>, /* QUADSPI_BK1_IO0 */
					 <STM32_PINMUX('D', 11, AF9)>, /* QUADSPI_BK1_IO2 */
					 <STM32_PINMUX('D', 15, AF9)>, /* QUADSPI_BK1_IO3 */
					 <STM32_PINMUX('E', 9, AF9)>; /* QUADSPI_BK1_IO1 */
			bias-disable;
			drive-push-pull;
			slew-rate = <1>;
		};
		pins2 {
			pinmux = <STM32_PINMUX('D', 4, AF9)>; /* QUADSPI_CLK */
			bias-disable;
			drive-push-pull;
			slew-rate = <2>;
		};
	};

	sdmmc2_pins_mx: sdmmc2_mx-0 {
		pins1 {
			pinmux = <STM32_PINMUX('B', 3, AF10)>, /* SDMMC2_D2 */
					 <STM32_PINMUX('B', 4, AF10)>, /* SDMMC2_D3 */
					 <STM32_PINMUX('B', 14, AF10)>, /* SDMMC2_D0 */
					 <STM32_PINMUX('B', 15, AF10)>, /* SDMMC2_D1 */
					 <STM32_PINMUX('G', 6, AF10)>; /* SDMMC2_CMD */
			bias-disable;
			drive-push-pull;
			slew-rate = <1>;
		};
		pins2 {
			pinmux = <STM32_PINMUX('E', 3, AF10)>; /* SDMMC2_CK */
			bias-disable;
			drive-push-pull;
			slew-rate = <3>;
		};
	};

	uart4_pins_mx: uart4_mx-0 {
		pins1 {
			pinmux = <STM32_PINMUX('A', 9, AF8)>; /* UART4_TX */
			bias-disable;
			drive-push-pull;
			slew-rate = <0>;
		};
		pins2 {
			pinmux = <STM32_PINMUX('H', 14, AF8)>; /* UART4_RX */
			bias-disable;
		};
	};

	/* USER CODE BEGIN pinctrl */
	/* USER CODE END pinctrl */
};

&bsec{
	status = "okay";

	/* USER CODE BEGIN bsec */
	board_id:board_id@f0{
		reg = <0xf0 0x4>;
		st,non-secure-otp;
	};
	/* USER CODE END bsec */
};

&hash{
	status = "okay";

	/* USER CODE BEGIN hash */
	/* USER CODE END hash */
};

&pwr_regulators{
	status = "okay";

	/* USER CODE BEGIN pwr_regulators */
	vdd-supply = <&vdd>;
//	vdd_3v3_usbfs-supply = <&vdd_usb>;

	/* USER CODE END pwr_regulators */
};

&qspi{
	pinctrl-names = "default";
	pinctrl-0 = <&quadspi_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN qspi */
	flash0: flash@0 {
		compatible = "winbond,w25q256jvq", "jedec,spi-nor";
		reg = <0>;                       /* chip select 0 */
		spi-max-frequency = <80000000>;   /* 80 MHz */
		spi-rx-bus-width = <4>;          /* Quad-SPI */
		spi-tx-bus-width = <4>;
		#address-cells = <1>;
		#size-cells = <1>;

		partition@0 {
			label = "tf-a";
			reg = <0x00000000 0x00040000>;  /* 256 KB */
		};

		partition@40000 {
			label = "fip";
			reg = <0x00040000 0x00200000>;  /* 2 MB */
		};

		partition@300000 {
			label = "kernel";
			reg = <0x00300000 0x00500000>;  /* 5 MB */
		};

		partition@800000 {
			label = "rootfs";
			reg = <0x00800000 0x01800000>;  /* rest of flash (~24 MB) */
		};
	};
	/* USER CODE END qspi */
};

&rcc{
	status = "okay";

	/* USER CODE BEGIN rcc */
	/* USER CODE END rcc */

	st,clksrc=<
		CLK_MPU_PLL1P
		CLK_AXI_PLL2P
		CLK_MLAHBS_HSI
		CLK_CKPER_DISABLED
		CLK_QSPI_ACLK
		CLK_SDMMC2_HCLK6
		CLK_STGEN_HSI
		CLK_UART4_HSI
		CLK_RNG1_CSI
	>;
	st,clkdiv = <
		DIV(DIV_MPU, 1)
		DIV(DIV_AXI, 0)
		DIV(DIV_MLAHB, 0)
		DIV(DIV_APB1, 0)
		DIV(DIV_APB2, 0)
		DIV(DIV_APB3, 0)
		DIV(DIV_APB4, 1)
		DIV(DIV_APB5, 2)
		DIV(DIV_APB6, 0)
	>;
	st,pll_vco {
		pll1_vco_1300Mhz: pll1-vco-1300Mhz {
			src=< CLK_PLL12_HSE >;
			divmn = < 2 80 >;
			frac = < 0x800 >;
		};
		pll2_vco_800Mhz: pll2-vco-800Mhz {
			src=< CLK_PLL12_HSE >;
			divmn = < 2 49 >;
		};
		/* USER CODE BEGIN rcc_st-pll_vco */
		/* USER CODE END rcc_st-pll_vco */
	};

	pll1:st,pll@0 {
		compatible = "st,stm32mp1-pll";
		reg = <0>;

		st,pll = < &pll1_cfg1 >;

		pll1_cfg1: pll1_cfg1 {
			st,pll_vco = < &pll1_vco_1300Mhz >;
			st,pll_div_pqr = < 0 1 1 >;
		};
		/* USER CODE BEGIN pll1 */
		/* USER CODE END pll1 */
	};

	pll2:st,pll@1 {
		compatible = "st,stm32mp1-pll";
		reg = <1>;

		st,pll = < &pll2_cfg1 >;

		pll2_cfg1: pll2_cfg1 {
			st,pll_vco = < &pll2_vco_800Mhz >;
			st,pll_div_pqr = < 1 1 0 >;
		};
		/* USER CODE BEGIN pll2 */
		/* USER CODE END pll2 */
	};

};

&rng{
	status = "okay";

	/* USER CODE BEGIN rng */
	/* USER CODE END rng */
};

&sdmmc2{
	pinctrl-names = "default";
	pinctrl-0 = <&sdmmc2_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN sdmmc2 */
	
	disable-wp;
	st,neg-edge;
	bus-width = <4>;
	vmmc-supply = <&vdd_sd>;

	/* USER CODE END sdmmc2 */
};

&uart4{
	pinctrl-names = "default";
	pinctrl-0 = <&uart4_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN uart4 */
	/* USER CODE END uart4 */
};

/* USER CODE BEGIN addons */


&cpu0 {
	cpu-supply = <&vdd_cpu>;
};
	

/* USER CODE END addons */
-------After flashing using usb

NOTICE:  CPU: STM32MP133D Rev.Y
NOTICE:  Model: STMicroelectronics custom STM32CubeMX board - openstlinux-6.1-yocto-mickledore-mpu-v24.06.26
ASSERT: drivers/st/regulator/regulator_fixed.c:81

Exception mode=0x00000016 at: 0x00000000
0 REPLIES 0