cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP257F-DK SD card yocto image handling

KS_LAC
Associate II

Dear community,

 

I've used yocto as my workhorse in the past a lot for other processor manufacturers. Now as I'm happily joining the STM world for linux I'm stuck. Maybe it is a too easy to miss question, but which steps I have to take for putting all the needed images to the sd-card? I have followed the rules to go for using the create_sdcard_from_flashlayout.sh script with FlashLayout_sdcard_stm32mp257f-dk-optee.tsv as the parameter. After that I've used dd to flash the .raw to the designated sdcard but the board does not start at all. From the provided sdcard it starts without any issue.

Where is my mistake?

 

Regards

 

KS

1 ACCEPTED SOLUTION

Accepted Solutions
KS_LAC
Associate II

So I've managed to boot it from an SD-Card.

With the commands from: STM32MPU Distribution Package - stm32mpu and 

sudo ./scripts/create_sdcard_from_flashlayout.sh flashlayout_st-image-weston/optee/FlashLayout_sdcard_stm32mp257f-dk-optee.tsv

the resulting FlashLayout_sdcard_stm32mp257f-dk-optee.raw flashed via Win32DiskImager and setting my DK to boot from SD (BOOT1-4 -> "OnOffOffOff") was booting so I can go on with the platform.

The initial setup using almost vanilla yocto as starting point was failing.

View solution in original post

9 REPLIES 9
PatrickF
ST Employee

Hi @KS_LAC 

I assume you are familiar with this page https://wiki.st.com/stm32mpu/wiki/How_to_populate_the_SD_card_with_dd_command

and this one

https://wiki.st.com/stm32mpu/wiki/STM32MPU_Developer_Package

 

Are you sure you correctly compile all the file with right environment setup? no errors ?

Maybe try to build the SD-Card raw image from pre-built Starter Package images.

Could you give more details on the fail ? Is the board red led (the one close to User1 button) flash rapidly ?

If yes, you could have more details using https://wiki.st.com/stm32mpu/wiki/STM32_MPU_ROM_trace_analyzer#On_STM32MP2_series , but probably of low interest as you work on a working HW.

If no red led toggling, then TF-A is loaded/started from SD-Card into SYSRAM, so, please look at UART console thru STLINK USB VCP for more details.

 

Did you try populating the SD-Card using CubeProgrammer ?

 

Regards.

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.
Tip of the day: Try Sidekick STM32 AI agent, see here
KS_LAC
Associate II

Hi PatrickF,

 

thx for the quick response. I've read through the wiki and the articles you've mentioned.

 

As me and my team try to move on to ST for evaluation and we have to keep the actual way of using almost vanilla yocto as the base for all other platforms I was starting with the following layerset:

BBLAYERS ?= " \
/home/lacon/yocto/poky/meta \
/home/lacon/yocto/poky/meta-poky \
/home/lacon/yocto/poky/meta-yocto-bsp \
/home/lacon/yocto/meta-openembedded/meta-oe \
/home/lacon/yocto/meta-openembedded/meta-python \
/home/lacon/yocto/meta-openembedded/meta-multimedia \
/home/lacon/yocto/meta-openembedded/meta-networking \
/home/lacon/yocto/meta-openembedded/meta-gnome \
/home/lacon/yocto/meta-openembedded/meta-webserver \
/home/lacon/yocto/meta-st-stm32mp \
/home/lacon/yocto/meta-st-openstlinux \
"

I got some warnings as building for st-image-core.

My build config:

Build Configuration:
BB_VERSION = "2.8.1"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal"
TARGET_SYS = "aarch64-ostl-linux"
MACHINE = "stm32mp25-disco"
DISTRO = "openstlinux-weston"
DISTRO_VERSION = "5.0.8-snapshot-20251210"
TUNE_FEATURES = "aarch64 crc cortexa35"
TARGET_FPU = ""
DISTRO_CODENAME = "scarthgap"
GCCVERSION = "13.%"
PREFERRED_PROVIDER_virtual/kernel = "linux-stm32mp"
MACHINE_FEATURES = "usbhost usbgadget alsa screen ext2 pci splashscreen watc hdog bluetooth wifi m33copro m0copro optee tpm2 initrd autoresize fip fw -update"
meta
meta-poky
meta-yocto-bsp = "scarthgap:e6bfeed8f3e72c577820e3d01f7d697c4d3fc5d4"
meta-oe
meta-python
meta-multimedia
meta-networking
meta-gnome
meta-webserver = "scarthgap:89a01c3d9ad1f8fce6aeb4dd0e694cfa28d42099"
meta-st-stm32mp = "scarthgap:fae1c3bcad05f338da80e69fc150b8697ad874c5"
meta-st-openstlinux = "scarthgap:14bbb30d00473973a67d85cbb1db8a87aa8afe65"

 

The mentioned red led indication is blinking forever and no output is visible via UART as used by the supplied SD-Card. So I was wondering if the signing may be mandatory and it is missing something there.

 

Also the use of SD-Card is crucial for later mass deployment it customer projects. So flashing via CubeIDE is actually a showstopper.

 

Regards,

 

KS

Hi @KS_LAC 

Maybe you could give a try flashing SD-Card on target via CubeProgrammer. This might help to identify issues.

I'm not SW nor Yocto expert, but probably some build issues. Did you look into

https://wiki.st.com/stm32mpu/wiki/STM32MPU_Developer_Package

Regards

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.
Tip of the day: Try Sidekick STM32 AI agent, see here
KS_LAC
Associate II

So I've managed to boot it from an SD-Card.

With the commands from: STM32MPU Distribution Package - stm32mpu and 

sudo ./scripts/create_sdcard_from_flashlayout.sh flashlayout_st-image-weston/optee/FlashLayout_sdcard_stm32mp257f-dk-optee.tsv

the resulting FlashLayout_sdcard_stm32mp257f-dk-optee.raw flashed via Win32DiskImager and setting my DK to boot from SD (BOOT1-4 -> "OnOffOffOff") was booting so I can go on with the platform.

The initial setup using almost vanilla yocto as starting point was failing.

what's up man, I have been dealing with the same issues. I was trying to flash the sd card manually by following the steps from Digikey's video but couldnt get it to work. Can you please let me know how you did it?

I don't know the video from Digikey but after downloading the right sources described in the wiki and executing the sudo-command. I've got an image which I've flashed to a sd-card using win32diskimager....

If you tell me where you got stuck maybe I'm able to help.

Regards,

KS

I am trying to manually flash the sd card's each partition, 
but as soon as I try to boot it, it shows


NOTICE: CPU: STM32MP157DAC Rev.Z
NOTICE: Model: STMicroelectronics STM32MP157D-DK1 Discovery Board
NOTICE: Board: MB1272 Var3.0 Rev.C-03
INFO: PMIC version = 0x21
NOTICE: Reset reason (0x15):
INFO: Power-on Reset (rst_por)
INFO: FCONF: Reading TB_FW firmware configuration file from: 0x2ffe1000
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-r2.0(debug):lts-v2.10.24-dirty(a07367a1)
NOTICE: BL2: Built : 16:16:36, Oct 3 2025
ERROR: No partition with the uuid mentioned in metadata
PANIC at PC : 0x2fff0c4d

Exception mode=0x00000016 at: 0x2fff0c4d

 

I haven't tried to image the sdcard manually as the offsets may get mixed up if doing it step by step. So here I can't help. Initially this topic is only a reminder how to go on with STs yocto idea if one is coming from vanilla yocto.

Hey bro ! Hope my solution will help you. I also met problem when I was build image in yocto from Digikey's video. I used krikstone branch of meta-st-stm32mp and it worked. Here is a blog to help:

https://embeddedlinux.blog/2025/12/06/yocto-stm32mp1-1-build-va-flash-core-image-minimal-cho-stm32mp157/

It is not english but you can use web translator.

Remember change branch to krikstone I also don't know why it has problem with scarthgap branch.