Could not boot from eMMC once OS installed on nvme

First I installed Ubuntu OS to eMMC, then I flashed SPINOR flash rock-5b-spi-image-gd1cf491-20240523-debug.img, and flashed ubuntu image to nvme after booting from eMMC.

The problem is when I reboot the board, the eMMC still is plugged on it, but the board runs OS on nvme.

I tried to use rkdevtool to flash a zero image to spinor flash, the board always boots to nvme OS. Is there any SPIFLASH image which could boot from spinor-> emmc -> nvme?

just install mtd-tools in system and double check if Your spi is really empty,
You can dump spi easily and review,
if still You have system running from nvme, then probably You are booting from something else, but Your disk ids are the same or just referred in boot config.

It turns out that the uboot will boot nvme disk first.

I fixed this by the following steps:

  1. Use UART2 to interrupt booting by pressing CTRL + C:
  2. Disable nvme boot in u-boot:
    => setenv boot_targets “mmc0 mmc1 usb0 pxe dhcp”
    => ext4load mmc 0:1 ${fdt_addr_r} /boot/extlinux/extlinux.conf
    => run bootcmd
  3. U-boot will boot emmc file system and I could login the system and resize partitions on the nvme disk.
1 Like