2025-05-19 7:16 AM - last edited on 2025-05-19 7:21 AM by Andrew Neil
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:
2. Observed output:
NOTICE: CPU: STM32MP135F Rev.YAny 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
2025-05-20 2:08 AM
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
2025-05-20 4:22 AM
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
2025-05-22 10:23 AM
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