cancel
Showing results for 
Search instead for 
Did you mean: 

Booting Linux Directly in Place of U-Boot on STM32MP135F-DK

HZ890
Associate II

Moved from MCUs forum: STM32MP13 is an MPU - not an MCU.


Hello Everyone,

I hope you’re doing well. I’m encountering a problem when trying to boot Linux directly instead of U-Boot on our STM32MP135F-DK board. Below is a summary of what I’ve done and the error I see:

1. Procedure followed

  • Built a new FIP binary and tf-a with the recommended changes and flags:
    -> fiptool update --fw-config stm32mp135f-dk-fw-config.dtb --hw-config stm32mp135f-dk.dtb --nt-fw Image fip-stm32mp135f-dk-optee-sdcard.bin

  • Modified the TSV  in the starter package to replace u-boot.bin with my Linux image and updated the FIP entries as follows:

    HZ890_0-1747663135832.png

    2. Observed output:

    NOTICE: CPU: STM32MP135F Rev.Y
    NOTICE: Model: STMicroelectronics STM32MP135F-DK Discovery Board
    NOTICE: Board: MB1635 Var1.0 Rev.E-02
    INFO: PMIC version = 0x21
    INFO: Reset reason (0x134):
    INFO: IWDG1 Reset (rst_iwdg1)
    INFO: FCONF: Reading TB_FW firmware configuration file from: 0x2ffe0000
    INFO: FCONF: Reading firmware configuration information for: stm32mp_fuse
    INFO: FCONF: Reading firmware configuration information for: stm32mp_io
    INFO: Using SDMMC
    INFO: Instance 1
    INFO: Boot used partition fsbl1
    NOTICE: BL2: v2.10-stm32mp1-r1.0(debug):()
    NOTICE: BL2: Built : 11:24:11, May 19 2025
    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 - 0x30006236
    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 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 - 0xde079418
    INFO: BL2: Loading image id 2
    INFO: Loading image id=2 at address 0xc3ff8000
    INFO: Image id=2 loaded: 0xc3ff8000 - 0xc4007897
    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 - 0xc15555cc
    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: 4.0.0-dev (gcc version 13.3.0 (GCC)) #1 Fri Oct 20 18:29:31 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: Override the OTP 18: 0x7afa0000 to 0x7afa01e0
    I/TC: WARNING: Embeds insecure stm32mp_provisioning driver
    I/TC: UART console (non-secure)
    I/TC: Platform stm32mp1: flavor PLATFORM_FLAVOR - DT stm32mp135f-dk.dts
    I/TC: OP-TEE ST profile: secure_and_system_services
    I/TC: Primary CPU switching to normal world boot
    E/TC:0 Panic 'Watchdog' at ?:0

Any guidance on which steps to double-check would be greatly appreciated.

you will find the tf-a and the fip created attached here

Thank you in advance for your help

Best regards,
Hassan Zaalouk

3 REPLIES 3
Kevin HUBER
ST Employee

Hello @HZ890 

 

It is a bit more complicated to do. An explanation of this procedure is available on the wiki: How to optimize the boot time - stm32mpu

If you follow it, you will normally succeed to remove u-boot.

 

Hope it helps,

Kevin

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.

Hello Kevin Huber,

Thank you for pointing me to the STM32MPU wiki article on boot-time optimization. I have carefully followed the steps in section 5 (“Optimizing boot-time by removing U-Boot”), and the TSV/FIP layout I sent you in my previous message is the direct result of that procedure. Unfortunately, the problem persists.

Could you please help me diagnose what might still be wrong or suggest any additional checks I should perform?

Thanks in advance for your assistance.

Best regards,

Hassan Zaalouk

I think the TF-A BL2 config is not correctly updated 

https://wiki.st.com/stm32mpu/index.php?title=How_to_optimize_the_boot_time#STM32MP1_series


We will so adapt our plat/st/stm32mp1/stm32mp1_def.h with following declarations :

#define STM32MP_BL33_BASE       (STM32MP_DDR_BASE + U(0x2008000))
#define STM32MP_BL33_MAX_SIZE       U(0x3FF8000)

instead of 

#define STM32MP_BL33_BASE (STM32MP_DDR_BASE + U(0x100000))
#define STM32MP_BL33_MAX_SIZE U(0x400000)


But in trace, the BL33 image 5 is loaded at the U-Boot location (start of DDR) and not at the updated address  = 0xC2008000 for Linxu start adress


> INFO: Loading image id=5 at address 0xc0000000   
> INFO: Image id=5 loaded: 0xc0000000 - 0xc15555cc

normally the information is in the fw-config file "stm32mp135f-dk-fw-config.dtb"
added in FIP when you execute the command


$> fiptool update --fw-config stm32mp135f-dk-fw-config.dtb --hw-config stm32mp135f-dk.dtb --nt-fw Image fip-stm32mp135f-dk-optee-sdcard.bin


You can check content of FIP  and of device tree with 

$> fiptool unpack fip-stm32mp135f-dk-optee-sdcard.bin
$> fdtdump fw-config.bin

**** fdtdump is a low-level debugging tool, not meant for general use.
**** If you want to decompile a dtb, you probably want
**** dtc -I dtb -O dts <filename>

/dts-v1/;
// magic: 0xd00dfeed
// totalsize: 0x236 (566)
// off_dt_struct: 0x38
// off_dt_strings: 0x204
// off_mem_rsvmap: 0x28
// version: 17
// last_comp_version: 16
// boot_cpuid_phys: 0x0
// size_dt_strings: 0x32
// size_dt_struct: 0x1cc

/ {
dtb-registry {
compatible = "fconf,dyn_cfg-dtb_registry";
hw-config {
load-address = <0x00000000 0xc3ff8000>;
max-size = <0x00040000>;
id = <0x00000002>;
};
nt_fw {
load-address = <0x00000000 0xc0000000>;
max-size = <0x03ff8000>;
id = <0x00000005>;
};
tos_fw {
load-address = <0x00000000 0xde000000>;
max-size = <0x02000000>;
id = <0x00000004>;
};
};
st-mem-firewall {
compatible = "st,mem-firewall";
memory-ranges = <0xc0000000 0x1e000000 0x00000000 0x8fe98fe9 0xde000000 0x02000000 0x00000003 0x00000000>;
};
st-mem-encrypt {
compatible = "st,mem-encrypt";
memory-ranges = <0xde000000 0x02000000 0x00000001>;
};
};

So it seens the fw config in the FIP is updated on nt_fw (id = 5) only for max-size and not for address  !?

nt_fw {
load-address = <0x00000000 0xc0000000>;    <=>  STM32MP_DDR_BASE + U(0x2008000)
max-size = <0x03ff8000>;                                 <=>  U(0x3FF8000)
id = <0x00000005>;
};

Please clear the TF-A generated files after modification to be sure fw config is fully generated

and  try again to generate the FIP
And check the content of generated file stm32mp135f-dk-fw-config.dtb....

Regards

Patrick