Hi @Eldam
I understand you intend to flash your Emmc from SDCard.
This topic has already been covered in following post :
https://community.st.com/s/question/0D50X0000BiBhHQSQ0/stm32mp153a-failed-to-boot-from-emmc
I copy here the most interesting part which is the detailed procedure
8. Prepare eMMC
===============
You can use U-Boot to copy binary in eMMC.
In the next example, you need to boot from SDCARD and the images (tf-a-stm32mp157c-ev1-trusted.stm32, u-boot-stm32mp157c-ev1-trusted.stm32)
are presents on SDCARD (mmc 0) in ext4 partition 4 (bootfs). From the starter package of EV1, you can simply copy the 2 binaries in “/boot�? directory of your board.
To boot from SDCard, select BootPinMode = 1 0 1 and reset.
Then you update the eMMC with the next U-Boot command :
a) prepare GPT on eMMC,
example with 4 partitions, bootfs, rootfs, userfs and vendorfs:
# setenv emmc_part "name=ssbl,size=2MiB;name=bootfs,type=linux,bootable,size=64MiB;name=vendorfs,type=linux,size=16MiB;name=rootfs,type=linux,size=640MiB;name=userfs,type=linux,size=64MiB "
# gpt write mmc 1 ${emmc_part}
b) copy SPL on eMMC on first boot partition
(SPL max size is 256kB, with LBA 512, 0x200)
# ext4load mmc 0:4 0xC0000000 tf-a-stm32mp157c-ev1-trusted.stm32
# mmc dev 1
# mmc partconf 1 1 1 1
# mmc write ${fileaddr} 0 200
# mmc partconf 1 1 1 0
c) copy U-Boot in first GPT partition of eMMC
# ext4load mmc 0:4 0xC0000000 u-boot-stm32mp157c-ev1-trusted.stm32
# mmc dev 1
# part start mmc 1 1 partstart
# part size mmc 1 1 partsize
# mmc write ${fileaddr} ${partstart} ${filesize}
To boot from eMMC, select BootPinMode = 0 1 0 and reset.
Here is the boot result (I started from an empty emmc):
NOTICE: CPU: STM32MP157CAA Rev.B
NOTICE: Model: STMicroelectronics STM32MP157C eval daughter on eval mother
NOTICE: Board: MB1263 Var1 Rev.C-01
INFO: Reset reason (0x14):
INFO: Pad Reset from NRST
INFO: Using EMMC
INFO: Instance 2
INFO: Boot used partition fsbl1
INFO: BootROM: 252928 (0x3dc00) bytes copied from eMMC
NOTICE: BL2: v2.0-r1.5(debug):
NOTICE: BL2: Built : 13:13:37, Oct 2 2018
INFO: BL2: Doing platform setup
INFO: PMIC version = 0x10
INFO: RAM: DDR3-1066/888 bin G 2x4Gb 533MHz v1.45
INFO: Memory size = 0x40000000 (1024 MB)
INFO: BL2 runs SP_MIN setup
INFO: BL2: Loading image id 4
INFO: Loading image id=4 at address 0x2fff0000
INFO: Image id=4 loaded: 0x2fff0000 - 0x30000000
INFO: BL2: Loading image id 5
INFO: Loading image id=5 at address 0xc0100000
INFO: STM32 Image size : 810110
WARNING: Skip signature check (header option)
INFO: Image id=5 loaded: 0xc0100000 - 0xc01c5c7e
INFO: read version 0 current version 0
NOTICE: BL2: Booting BL32
INFO: Entry point address = 0x2fff0000
INFO: SPSR = 0x1d3
INFO: PMIC version = 0x10
NOTICE: SP_MIN: v2.0-r1.5(debug):
NOTICE: SP_MIN: Built : 13:13:37, Oct 2 2018
INFO: ARM GICv2 driver initialized
INFO: stm32mp HSI (18): Secure only
INFO: stm32mp HSE (20): Secure only
INFO: stm32mp PLL2 (27): Secure only
INFO: stm32mp PLL2_R (30): Secure only
INFO: SP_MIN: Initializing runtime services
INFO: SP_MIN: Preparing exit to normal world
U-Boot 2018.11-stm32mp-r3 (Nov 14 2018 - 16:10:06 +0000)
CPU: STM32MP157CAA Rev.B
Model: STMicroelectronics STM32MP157C eval daughter on eval mother
Board: stm32mp1 in trusted mode (st,stm32mp157c-ev1)
Board: MB1263 Var1 Rev.C-01
DRAM: 1 GiB
Clocks:
- MPU : 650 MHz
- MCU : 208.878 MHz
- AXI : 266.500 MHz
- PER : 24 MHz
- DDR : 533 MHz
NAND: 1024 MiB
MMC: STM32 SDMMC2: 0, STM32 SDMMC2: 1
Loading Environment from EXT4...
** Unable to use mmc 1:auto for loading the env **
In: serial
Out: serial
Err: serial
Net: eth0: ethernet@5800a000
Hit any key to stop autoboot: 0
Boot over mmc1!
Saving Environment to EXT4...
** Unable to use mmc 1:auto for saveenv **
Failed (1)
switch to partitions #0, OK
mmc1(part 0) is current device
** Unrecognized filesystem type **
STM32MP>
Hope it help
Olivier