cancel
Showing results for 
Search instead for 
Did you mean: 

OpenSTLinux Yocto STMP32MP133 eMMC fip issue

theeuwke
Associate

I'm working on a custom stm32mp133d board and Yocto (latest release), but something has me quite puzzled.

Our hardware looks like this:
- Kingston EMMC04G-MT32-01G10 (mmc2)
- 4Gb DDR
- STM32MP133d
- STM32PMIC1

most of it is very similar to STM32MP135F-DK. To configure our board, I'm using the stm32cube-mx approach. 

My issue is, that the generated FIPS image has somehow a misaligned BL33 (U-Boot) image, which results in a failed boot:

NOTICE:  CPU: STM32MP133D Rev.Y
NOTICE:  Model: STMicroelectronics custom STM32CubeMX board - openstlinux-6.6-yocto-scarthgap-mpu-v25.06.11
INFO:    PMIC version = 0x21
NOTICE:  Reset reason (0x35):
INFO:      Power-on Reset (rst_por)
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 EMMC
INFO:      Instance 2
INFO:    Boot used partition fsbl1
NOTICE:  BL2: v2.10-stm32mp1-r2.0(debug):lts-v2.10.13-dirty(b1f57509)
NOTICE:  BL2: Built : 17:10:59, Feb 14 2025
INFO:    BL2: Doing platform setup
INFO:    RAM: DDR3-DDR3L 16bits 533000kHz
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 - 0x300061ea
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 - 0xde08d068
INFO:    BL2: Loading image id 2
WARNING: Firmware Image Package header check failed.
WARNING: Failed to obtain reference to image id=2 (-2)
ERROR:   BL2: Failed to load image id 2 (-2)

fiptool  info:

Secure Payload BL32 (Trusted OS): offset=0x128, size=0x1C, cmdline="--tos-fw"
Secure Payload BL32 Extra1 (Trusted OS Extra1): offset=0x144, size=0x8D068, cmdline="--tos-fw-extra1"
Non-Trusted Firmware BL33: offset=0x8D1AC, size=0x11A1B8, cmdline="--nt-fw"
FW_CONFIG: offset=0x1A7364, size=0x1EA, cmdline="--fw-config"
HW_CONFIG: offset=0x1A754E, size=0xDB50, cmdline="--hw-config"

The only way to get it working, is to recall fiptool with --align 2048 

Secure Payload BL32 (Trusted OS): offset=0x800, size=0x1C, cmdline="--tos-fw"
Secure Payload BL32 Extra1 (Trusted OS Extra1): offset=0x1000, size=0x8D068, cmdline="--tos-fw-extra1"
Non-Trusted Firmware BL33: offset=0x8E800, size=0x11A1B8, cmdline="--nt-fw"
FW_CONFIG: offset=0x1A9000, size=0x1EA, cmdline="--fw-config"
HW_CONFIG: offset=0x1A9800, size=0xDB50, cmdline="--hw-config"

Then it will work, but is this really the way to go?

NOTICE:  CPU: STM32MP133D Rev.Y
NOTICE:  Model: STMicroelectronics custom STM32CubeMX board - openstlinux-6.6-yocto-scarthgap-mpu-v25.06.11
INFO:    PMIC version = 0x21
NOTICE:  Reset reason (0x35):
INFO:      Power-on Reset (rst_por)
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 EMMC
INFO:      Instance 2
INFO:    Boot used partition fsbl1
NOTICE:  BL2: v2.10-stm32mp1-r2.0(debug):lts-v2.10.13-dirty(b1f57509)
NOTICE:  BL2: Built : 17:10:59, Feb 14 2025
INFO:    BL2: Doing platform setup
INFO:    RAM: DDR3-DDR3L 16bits 533000kHz
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 - 0x300061ea
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 - 0xde08d068
INFO:    BL2: Loading image id 2
INFO:    Loading image id=2 at address 0xc0400000
INFO:    Image id=2 loaded: 0xc0400000 - 0xc040db50
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 - 0xc011a1b8
NOTICE:  BL2: Booting BL32
INFO:    Entry point address = 0xde000000
INFO:    SPSR = 0x1d3
I/TC: Platform stm32mp1: flavor PLATFORM_FLAVOR - DT stm32mp133d-xemex-lewiz-2-0-mx.dts
I/TC: OP-TEE ST profile: secure_and_system_services
I/TC: Primary CPU switching to normal world boot
I/TC: Reserved shared memory is disabled
I/TC: Dynamic shared memory is enabled
I/TC: Normal World virtualization support is disabled
I/TC: Asynchronous notifications are enabled
stm32_etzpc bus@5c007000: display-controller@5a001000 failed to parse child on bus (-2)
optee optee: OP-TEE: revision 4.0 (2a5b1d12)

I can't find any variable or mechanic to automate this, thus I have to heavilty modify multiple recipes in order to get an align option into create_st_fip_binary.sh and fip-stm32mp deployment (recipes trusted-firmware-a/tf-a-tools and fip-stm32mp). Is this really the way to go, or am I missing the point here?

0 REPLIES 0