cancel
Showing results for 
Search instead for 
Did you mean: 

request a script of flash cod to eMMC from SD on stm32mp157c-ev1

zqizh.1
Associate II

Hi,

My evaluation kit is stm32mp157c-ev1, I can flash code to eMMC or SD via STM32CubeProgrammer successfully, and it can work expectedly.

We need to running program on eMMC without SD card. Flash the eMMC code via STM32CubeProgrammer is very slow and is not suitable for mass production.

Please support a script that flash eMMC code "stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31" via SD card.

Thanks,

QiZhang

2 REPLIES 2
Olivier GALLIEN
ST Employee

Hi @zqizh.1​ ,

Please have a look to post

https://community.st.com/s/question/0D50X0000BiBhHQSQ0/stm32mp153a-failed-to-boot-from-emmc

It contain a guide to load eMMC from SDcard with Uboot.

Does it suit your need ?

Olivier

Olivier GALLIEN
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.

Hi Olivier,

Your solution is not I want.

Below script is I got from internet to write the image to eMMC card from SD card.

But I don't know how to create eMMC image "atk_emmc-stm32mp157d-atk-qt.raw".

Your distribution package include a script "create_sdcard_from_flashlayout.sh" which can generate a SD card image, Please support a similar script to generate a eMMC image for me.

Thanks,

QiZhang

"

echo "enable eMMC write flag"

echo 0 > /sys/class/block/mmcblk1boot0/force_ro

echo 0 > /sys/class/block/mmcblk1boot1/force_ro

echo "flashing tf-a,please wait..."

execute "dd if=./tf-a/tf-a-stm32mp157d-atk-trusted.stm32 of=${device}boot0 conv=fsync"

execute "dd if=./tf-a/tf-a-stm32mp157d-atk-trusted.stm32 of=${device}boot1 conv=fsync"

echo "close eMMC write flag"

echo 1 > /sys/class/block/mmcblk1boot0/force_ro

echo 1 > /sys/class/block/mmcblk1boot1/force_ro

execute "mmc bootpart enable 1 1 ${device}"

echo "flashing bootfs and rootfs,please wait..."

execute "dd if=./atk_emmc-stm32mp157d-atk-qt.raw of=${device} bs=8M conv=sync status=progress"

echo "partition..."

sgdisk -d 3 ${device}

sync

sgdisk -a 1 -n 3:136192:0 -c 3:rootfs -t 3:8300 -u 3:491f6117-415d-4f53-88c9-6e0de54deac6 ${device}

sync

echo "eMMC flash completed�?"

"