Skip to content

Flashing an SD Card

After a successful ST BSP build, the deploy directory contains a flash layout file used to generate the SD card image.


Generate the SD Card Image

The ST BSP does not produce a .wic file directly. Run the provided generation script:

cd <build-dir>/tmp-glibc/deploy/images/<machine>/scripts
./create_sdcard_from_flashlayout.sh \
    ../flashlayout_st-image-weston/optee/FlashLayout_sdcard_stm32mp257f-icore-edimm2-mx-optee.tsv

This produces a .raw file in the parent directory.


Identify the SD Card Device

Selecting the wrong device will permanently destroy data

Always verify the device path before running dd.

lsblk

Insert the SD card and run lsblk again — the new device is your SD card.

sda      232G   disk    ← host disk, do not touch
sdb       32G   disk    ← SD card
└─sdb1    32G   part

Use the disk device (e.g. /dev/sdb), not a partition (not /dev/sdb1).


Flash the SD Card

sudo dd if=../FlashLayout_sdcard_stm32mp257f-icore-edimm2-mx-optee.raw \
    of=/dev/sdX bs=8M conv=fdatasync status=progress

Warning

  • Unmount the SD card before running dd.
  • This erases all data on the selected device.