cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP1 U-Boot freezes while "Starting Kernel" (stalls on "Waiting for root device" in earlyprink)

ShawnHymel
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Olivier GALLIEN
ST Employee

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

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.

View solution in original post

3 REPLIES 3
Olivier GALLIEN
ST Employee

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

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.

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?

ShawnHymel
Associate II

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:

  • Use the official STM32CubeProgrammer to flash the SD card. It should automatically handle formatting the SD card for you.
  • Use a partition manager (e.g. "expert mode" in fdisk) to relabel the PARTUUID as e91c4e10-16e6-4c0e-bd0e-77becf4a3582. This UUID appears to be hardcoded in the extlinux.conf file.
  • Once you've flashed the SD card, go to the bootfs partition and edit mmc0_extlinux/extlinux.conf. Change the APPEND line to the following (change mmcblk0p5 to whichever partition you made rootfs--note that mmc0 is the SD card for U-Boot):
APPEND root=/dev/mmcblk0p5 rootwait rw console=ttySTM0,115200