2021-09-30 01:56 AM
Hello STM-Team,
I am working with STM32MP157F-Eval board. The SD card and NAND booting are working fine. But, getting issues while booting with eMMC.
I have tried a workaround which seems to be working and I want to make sure if it is the right way of doing.
Please see below error.
------------------------------------------------------------------------
Boot over mmc1!
Saving Environment to MMC... Writing to redundant MMC(1)... OK
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:5...
Found U-Boot script /boot.scr.uimg
2943 bytes read in 29 ms (98.6 KiB/s)
## Executing script at c4100000
Executing SCRIPT on target=mmc1
Saving Environment to MMC... Writing to MMC(1)... OK
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:5...
77087 bytes read in 30 ms (2.4 MiB/s)
SCRIPT FAILED... /mmc1_extlinux/extlinux.conf not found !
Saving Environment to MMC... Writing to redundant MMC(1)... OK
SCRIPT FAILED: continuing...
77087 bytes read in 31 ms (2.4 MiB/s)
STM32MP>
STM32MP> ls mmc 1:5 /
<DIR> 1024 .
<DIR> 1024 ..
<DIR> 12288 lost+found
2943 boot.scr.uimg
<DIR> 1024 mmc0_extlinux
<DIR> 1024 nand0_extlinux
18244 splash.bmp
77374 stm32mp157f-ev1-a7-examples.dtb
77607 stm32mp157f-ev1-m4-examples.dtb
77087 stm32mp157f-ev1.dtb
7309840 uImage
3632420 uInitrd
STM32MP> ls mmc 1:5 /mmc0_extlinux/
<DIR> 1024 .
<DIR> 1024 ..
256 extlinux.conf
706 stm32mp157f-ev1_extlinux.conf
STM32MP>
------------------------------------------------------------------------
I am suspecting 2 probable issues while booting with eMMC on STM32MP157F-Eval board.
1. Below u-boot environments are wrong.
---------------------------------------------
boot_syslinux_conf=extlinux/extlinux.conf
boot_prefixes=/ /boot/
boot_targets=mmc1 ubifs0 mmc0 mmc2 pxe
---------------------------------------------
So, I have updated and saved the environments as below.
---------------------------------------------
STM32MP> setenv boot_syslinux_conf 'extlinux\/stm32mp157f-ev1_extlinux.conf'
STM32MP> setenv boot_prefixes '/mmc0_' // As 'stm32mp157f-ev1_extlinux.conf' stored in 'mmc0_extlinux' directory.
STM32MP> setenv boot_targets mmc1
STM32MP> saveenv
---------------------------------------------
2. It always append bootargs (root=PARTUUID) of mmc0 (sdcard) instead of mmc1.
---------------------------------------------
append: root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw console=ttySTM0,115200
---------------------------------------------
So, I have commented the 'set_env' function in bootloader source and changed bootargs at runtime as below as per "https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer_flashlayout#GPT_partuuid_of_rootfs_partition".
---------------------------------------------
STM32MP> setenv bootargs 'root=PARTUUID=491f6117-415d-4f53-88c9-6e0de54deac6 rootwait rw console=ttySTM0,115200'
---------------------------------------------
After doing above two stuff, board is booting fine with eMMC.
I am wondering why the build is configured to refer to mmc0 (SDcard) instead of mmc1 (eMMC)?
Thank You.
Regards,
Pratik Manvar
2021-10-01 12:23 AM
Hi @Pratik Manvar ,
Can you please detail how did you build this faulty image ?
Distribution or Development package ?
Thanks
Olivier
2021-10-01 03:19 AM
Hi @Community member,
Thanks for the reply.
I am using the distribution package (openstlinux-5.4-dunfell-mp1-20-06-24) and building for evaluation board "MACHINE=stm32mp1-eval".
I have some updates. With clean build (removed old build directory), I don't see above issues.
The default boot device was BOOTDEVICE_LABELS += "sdcard" in "machine/stm32mp1-eval.conf" file. Which worked fine.
Then I had enable below config to test NAND flash boot-up. Which worked fine.
BOOTDEVICE_LABELS += "nand-4-256"
After that, I had enable below config to test eMMC flash boot-up. In which I came across above issues.
BOOTDEVICE_LABELS += "emmc"
To generate above build images (NAND & eMMC), I had run below commands without deleting build directory (build-openstlinuxweston-stm32mp1-eval).
$ DISTRO=openstlinux-weston MACHINE=stm32mp1-eval source layers/meta-st/scripts/envsetup.sh
$ bitbake st-image-weston -c cleansstate
$ bitbake st-image-weston
With this, NAND boot worked and eMMC boot didn't work.
But, after deleting build directory (build-openstlinuxweston-stm32mp1-eval) and with fresh build, I don't see such issues booting with eMMC. Everything works fine.
Thanks & Regards,
Pratik Manvar