2021-08-20 09:06 PM
I have an STM32MP157D-DK1 board, and I'm trying to build a custom Linux image for it with the Yocto Project. I followed the guide here (https://forum.digikey.com/t/yocto-getting-started-with-the-stm32mp157/14074) to create a core-image-minimal.
I’m trying to use the basic boot chain to avoid TF-A (for now). So, I formatted an SD card with the following (using fdisk):
Disk /dev/mmcblk2: 7.29 GiB, 7822376960 bytes, 15278080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: A1B93A60-F8E0-CB47-88F9-E559CD43B510
Device Start End Sectors Size Type
/dev/mmcblk2p1 2048 2559 512 256K Microsoft basic data
/dev/mmcblk2p2 4096 4607 512 256K Microsoft basic data
/dev/mmcblk2p3 6144 10239 4096 2M Microsoft basic data
/dev/mmcblk2p4 10240 141311 131072 64M Linux filesystem
/dev/mmcblk2p5 141312 15278046 15136735 7.2G Linux filesystem
I also set the legacy BIOS bootable flag on /mmcblk2p4 (bootfs).
I copied the following image files to each of the partitions (from tmp/deploy/images/stm32mp1):
sudo dd if=u-boot/basic_stm32mp15/u-boot-spl.stm32-stm32mp157d-dk1-basic of=/dev/mmcblk2p1
sudo dd if=u-boot/basic_stm32mp15/u-boot-spl.stm32-stm32mp157d-dk1-basic of=/dev/mmcblk2p2
sudo dd if=u-boot/basic_stm32mp15/u-boot-stm32mp157d-dk1-basic.img of=/dev/mmcblk2p3
sudo dd if=st-image-bootfs-poky-stm32mp1.ext4 of=/dev/mmcblk2p4 bs=1M
sudo dd if=core-image-minimal-stm32mp1.ext4 of=/dev/mmcblk2p5 bs=1M
The boot process gets stuck on "Starting kernel ..." So, I went back and enabled earlyprintk as per this guide (https://wiki.st.com/stm32mpu/wiki/Dmesg_and_Linux_kernel_log#earlyprintk). The boot process still gets to the same "Starting kernel ..." step, but I've got some more information. I'm just confused about what it's trying to do. It reaches the "Waiting for root device..." line, hangs for about a minute, and then restarts the whole boot process.
The boot log is too long for the post, so I pasted it here: https://gist.github.com/ShawnHymel/590b95359dfd8449abd6f45f8f5b6794
Solved! Go to Solution.
2021-08-23 12:14 AM
Hi @ShawnHymel,
>> I’m trying to use the basic boot chain to avoid TF-A (for now)
This method is deprecated/ no longer supported in recent software delivery.
Uboot-spl is no more able to launch kernel.
I recommend to use the TF-A based boot chain.
Olivier
2021-08-23 12:14 AM
Hi @ShawnHymel,
>> I’m trying to use the basic boot chain to avoid TF-A (for now)
This method is deprecated/ no longer supported in recent software delivery.
Uboot-spl is no more able to launch kernel.
I recommend to use the TF-A based boot chain.
Olivier
2021-08-23 09:36 AM
Thank you for the help!
I renamed the /dev/mmcblk2p3 partition to "fip," as that's apparently how the first stage bootloader knows to find it, and I left /dev/mmcblk2p4 marked as "Legacy BIOS bootable."
I then copied over the following images to the partitions:
sudo dd if=arm-trusted-firmware/tf-a-stm32mp157d-dk1-sdcard.stm32 of=/dev/mmcblk2p1
sudo dd if=arm-trusted-firmware/tf-a-stm32mp157d-dk1-sdcard.stm32 of=/dev/mmcblk2p2
sudo dd if=fip/fip-stm32mp157d-dk1-trusted.bin of=/dev/mmcblk2p3
sudo dd if=st-image-bootfs-poky-stm32mp1.ext4 of=/dev/mmcblk2p4 bs=1M
sudo dd if=core-image-minimal-stm32mp1.ext4 of=/dev/mmcblk2p5 bs=1M
Booting gets further, but it hangs indefinitely at the following:
[ 33.767880] usb33: supplied by vdd_usb
[ 33.770379] vref: supplied by vdd
[ 33.773750] vref: disabling
[ 33.776331] vdda: disabling
Here is the entire boot ouput: https://gist.github.com/ShawnHymel/b69a6e41d6918b8ab2f6f0ae26dc7464
I've read through the boot PDF. Is there something that I'm missing when it comes to creating a trusted boot chain?
2021-08-27 08:54 AM
I was able to get it to boot. The following line was the clue:
[ 3.220995] Waiting for root device PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582...
Apparently, U-Boot was unable to find the rootfs, so it just stalls. To fix this, you need to do one of the following:
APPEND root=/dev/mmcblk0p5 rootwait rw console=ttySTM0,115200