Disable eMMC card while booting

Hi,

If both eMMC and SD card is present, it seems to read bootloader from eMMC first. In case eMMC card is incorrect / corrupted, it refuses to boot even though the SD card contains a valid image.

Is there any way to change this? I would like to boot from uSD card by default.
Can eMMC card be disabled while booting?

Note: I have v1.3 of Rock Pi 4 which does not have any soldered SPI flash.
Kind regards.

Have you tried disabling boot flag on the eMMC?

Hey @pbies,

Could I alter the boot flag while the eMMC is plugged in? From my limited experience, it fails to boot when eMMC is corrupted, so I am not able to perform any action.

AFAIK the boot order is set in SOC’s BootROM (SPI -> eMMC -> SD -> USB) and cannot be changed.

I did some hacks in u-boot for Rock Pi 4 in Armbian to always try to boot from SD if it is present but first u-boot stage is still run from eMMC.

If you can boot as far as u-boot proper from you eMMC you could stop autobooting - hit any key while in u-boot - somewhere around the Model: ... line.
At the prompt you can then examine mmc/sd devices:

=> mmc list
dwmmc@fe320000: 1 (SD)
sdhci@fe330000: 0
=> mmc dev 1
switch to partitions #0, OK
mmc1 is current device
=> mmc info
Device: dwmmc@fe320000
Manufacturer ID: 3
OEM: 5344
Name: SC32G
Bus Speed: 50000000
Mode: SD High Speed (50MHz)
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 29.7 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes

… and boot from SD:

=> setenv devnum 1
=> run mmc_boot
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found U-Boot script /boot/boot.scr

This works for sure in Armbian but should work as well in Radxa’s images.

1 Like

Hi @piter75

You have cleared my doubts. So its hardcoded and always goes to eMMC if present.

And to boot from SD, we need to pause booting using USB TTL debug cable, and choose the SD card.

Thanks for your advice, and your work. :innocent:

Erm, what kind of image are you using? In my experience with Radxa’s images - you always boot from sd than emmc.

Also, the order can be overwritten in loader section and it’s not boot section, since i corrupted it with every boot update and still was able to boot from sd card

From my experience and reading Piter’s explanation, the SOC looks for the bootloader (u-boot) in eMMC followed by SD card.

What happened was that I downloaded and flashed an Armbian build to the eMMC card, but it failed to boot. Was getting blinking red led and no output via HDMI. Hoping to correct this, I inserted my working Radxa SD card, but the Rock Pi still failed to boot.

Which means that if eMMC card contains an incompatible/incorrect/corrupted bootloader, the system will fail to boot. After removing the eMMC, was able to boot from SD card. Then I flashed the current version of Armbian to eMMC which worked.

Some boards like the RockPro64 offer an option to disable eMMC while booting by shorting pins via jumper. Will try Piter’s suggestion to pause bootloader when I have a functional USB TTL debug cable.

Forgive me if I use some incorrect terms, am new to this.

P.S.
I bought v1.3 of Rock Pi 4 rather than v1.4 since it was cheaper and I read about some problems with booting after flashing incorrect SPI image. I realize now that it was a mistake. A correctly flashed SPI can correct this problem and allow flashing all kinds of images to the eMMC without worrying if it will boot.

Hm, from my understanding, there is 2 different boot sectors, one is boot itself and another one is loader. Loader tells about “look order” and then boot is booting the system. And if loader corrupted i guess system just skip it, because otherwise with empty emmc you would never boot, even with valid sd card.

Taking in account size of SPI (16 mb) and size of loader (https://wiki.radxa.com/Rockpi4/partitions) it’s indeed works like this. So based on this, technically - everything that was said is correct

P.S. also that means that Armbian was installed correctly, it’s just boot script problem, which happens from time to time hell know why

1 Like