cancel
Showing results for 
Search instead for 
Did you mean: 

Direct Kernel Boot on STM32MP1

HZ890
Associate II

Hi everyone,

I'm attempting to optimize the boot process on my STM32MP157F-DK2 board by removing U-Boot and booting the Linux kernel directly via the FIP. I've followed the documented steps for STM32MP1:

  1. TF-A BL2 Modifications:

    • Updated STM32MP_BL33_BASE and STM32MP_BL33_MAX_SIZE in the STM32MP1 header file.

    • Increased the SDMMC timeout in stm32_sdmmc2.c to accommodate the larger kernel image.

  2. FIP Creation:

    • Recompiled TF-A with my modifications.

    • Created a new FIP where I replaced the U-Boot binary and its DTB with my Linux kernel Image and DTB.

    • The new FIP (fip.bin) now contains the kernel and DTB.

  3. Flash Layout TSV Modifications:
    I updated the TSV file to allocate a larger space for the FIP. Below is the relevant excerpt:

    HZ890_0-1742823828143.png

Despite these modifications, every time I execute the process, it fails. My questions are:

  • What is the purpose of the bootfs partition?
    Since my new FIP (fip.bin) already contains the Linux kernel and its DTB, I'm unclear why the flash layout still reserves a bootfs partition. Is it meant for additional boot configurations, an initial ramdisk, or something else?

  • Why is the u-boot-env partition still present?
    If U-Boot is being removed entirely from the boot chain, what role does the U-Boot environment play here? Is it kept for legacy or recovery purposes?

I would really appreciate any insights or suggestions on what might be going wrong or what additional changes I need to consider for a successful direct kernel boot setup on STM32MP157f-dk2.

Thanks in advance for your help!

20 REPLIES 20
adnan_pasha
Senior

Hi @Erwan SZYMANSKI 

Any idea why i am not able to boot after flashing the image. Below is my flashlayout file i am using.
I have also attached my modified fip binary please have a look let me knwo if i am missing anything?

#OptIdNameTypeIPOffsetBinary
-0x01fsbl-bootBinarynone0x0arm-trusted-firmware/tf-a-stm32mp157f-dk2-usb.stm32
-0x03fip-bootFIPnone0x0fip/fip-stm32mp157f-dk2-optee-programmer-usb.bin
P0x04fsbl1Binarymmc00x00004400arm-trusted-firmware/tf-a-stm32mp157f-dk2-optee-sdcard.stm32
P0x05fsbl2Binarymmc00x00044400arm-trusted-firmware/tf-a-stm32mp157f-dk2-optee-sdcard.stm32
P0x06metadata1FWU_MDATAmmc00x00084400arm-trusted-firmware/metadata.bin
P0x07metadata2FWU_MDATAmmc00x000C4400arm-trusted-firmware/metadata.bin
P0x08fip-aFIPmmc00x00104400modified/fip-stm32mp157f-dk2-optee-sdcard.bin
PED0x09fip-bFIPmmc00x02104400none
PED0x0Au-boot-envENVmmc00x02904400none
P0x10bootfsSystemmmc00x02984400st-image-bootfs-openstlinux-weston-stm32mp15-disco.ext4
P0x11vendorfsFileSystemmmc00x06984400st-image-vendorfs-openstlinux-weston-stm32mp15-disco.ext4
P0x12rootfsFileSystemmmc00x12084400st-image-qt-openstlinux-weston-stm32mp15-disco.ext4
P0x13userfsFileSystemmmc00x112084400st-image-qt-userfs-openstlinux-weston-stm32mp15-disco.ext4


Looking forward to your response.

Thank you.