Booting from eMMC delays with error

on my Rock4B+ after I dd’ed the rock-pi-4b-plus_debian_bullseye_cli_b21.img.xz to the emmcblk0:
I get this CRC error also fsck errors with corrupt superblock.

During boot without SD inserted it waits very long on
Retrieving file: /boot/vmlinuz-5.10.110-8-rockchip
Retrieving file: /boot/initrd.img-5.10.110-8-rockchip

and then sucessfully loads kernel to login.

With SD inserted it’s directly loading.
Is this supposed to work like that as a fallback? Do I need to config the boot?

U-Boot latest-2023.04-3-fd4ed6b7-00060-g51d31fbc (Apr 27 2023 - 14:53:55 +0000)

SoC: Rockchip rk3399
Reset cause: POR
Model: Radxa ROCK Pi 4B+
DRAM:  2 GiB
PMIC:  RK808
Core:  287 devices, 28 uclasses, devicetree: separate
MMC:   mmc@fe310000: 2, mmc@fe320000: 1, mmc@fe330000: 0
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Model: Radxa ROCK Pi 4B+
Card did not respond to voltage select! : -110
Unable to get mmc desc
Net:   eth0: ethernet@fe300000
starting USB...
Bus usb@fe380000: ehci_generic usb@fe380000: Failed to get clocks (ret=-19)
Port not available.
Bus usb@fe3c0000: ehci_generic usb@fe3c0000: Failed to get clocks (ret=-19)
Port not available.
Bus usb@fe800000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus usb@fe900000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@fe800000 for devices... 1 USB Device(s) found
scanning bus usb@fe900000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
Card did not respond to voltage select! : -110
** Booting bootflow 'mmc@fe330000.bootdev.part_2' with distro
U-Boot menu
1:      Debian GNU/Linux 11 (bullseye) 5.10.110-8-rockchip
2:      Debian GNU/Linux 11 (bullseye) 5.10.110-8-rockchip (rescue target)
Enter choice: 1:        Debian GNU/Linux 11 (bullseye) 5.10.110-8-rockchip
Retrieving file: /boot/vmlinuz-5.10.110-8-rockchip
Retrieving file: /boot/initrd.img-5.10.110-8-rockchip
append: root=UUID=36707237-6b57-4d7f-98a3-73b42dcf3822 quiet splash loglevel=4 rw earlycon consoleblank=0 console=tty0 console=ttyFIQ0,1500000n8 console=ttyAML0,115200n8 console=ttyS2,1500000n8 console=ttyS0,1500000n8 coherent_pool=2M irqchip.gicv3_pseudo_nmi=0 plymouth.ignore-serial-consoles cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1
Retrieving file: /usr/lib/linux-image-5.10.110-8-rockchip/rockchip/rk3399-rock-pi-4b-plus.dtb
Moving Image from 0x2080000 to 0x2200000, end=3d80000
## Flattened Device Tree blob at 01f00000
   Booting using the fdt blob at 0x1f00000
Working FDT set to 1f00000
   Loading Ramdisk to 7c718000, end 7cee0c25 ... OK
ERROR: reserving fdt memory region failed (addr=0 size=0 flags=0)
   Loading Device Tree to 000000007c6fe000, end 000000007c717ef5 ... OK
Working FDT set to 7c6fe000
Hit any key to stop autoboot:  0
=>         printenv
arch=arm
baudrate=1500000
board=evb_rk3399
board_name=evb_rk3399
boot_targets=mmc1 mmc0 nvme scsi usb pxe dhcp spi
bootcmd=bootflow scan; run distro_bootcmd; env set serial# RADXA; echo Enter fastboot mode. Press Ctrl+C to stop...; fastboot usb 0; echo Enter ums mode. Press Ctrl+C to stop...; ums 0 mmc 2;
bootdelay=0
cpu=armv8
cpuid#=544d533634322e303000000000060101
eth1addr=9e:e5:3f:a8:31:58
ethaddr=9e:e5:3f:a8:31:59
fdt_addr_r=0x01f00000
fdtcontroladdr=7deeb050
fdtfile=rockchip/rk3399-rock-pi-4b-plus.dtb
fdtoverlay_addr_r=0x02000000
kernel_addr_r=0x02080000
kernel_comp_addr_r=0x08000000
kernel_comp_size=0x2000000
loadaddr=0x800800
partitions=uuid_disk=${uuid_gpt_disk};name=loader1,start=32K,size=4000K,uuid=${uuid_gpt_loader1};name=loader2,start=8MB,size=4MB,uuid=${uuid_gpt_loader2};name=trust,size=4M,uuid=${uuid_gpt_atf};name=boot,size=112M,bootable,uuid=${uuid_gpt_boot};name=rootfs,size=-,uuid=B921B045-1DF0-41C3-AF44-4C6F280D3FAE;
preboot=usb start
pxefile_addr_r=0x00600000
ramdisk_addr_r=0x06000000
script_offset_f=0xffe000
script_size_f=0x2000
scriptaddr=0x00500000
serial#=3baada4db0e5ce64
soc=rk3399
stderr=serial,vidconsole
stdin=serial,usbkbd
stdout=serial,vidconsole
vendor=rockchip
  1. Our u-boot needs to support multiple devices to boot and should be consuming time in the process of checking devices.

  2. For CRC error and fsck error, have you tried the kde version of the image?

  1. It’s 30 sec each for the kernel and the ramdisk. Isn’t it configurable? Would you recommend some docs to better understand the boot process? @Nasca

  2. will test that.

CRC error stays the same with KDE image, waiting 60sec for kernel and ramdisk:

Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Model: Radxa ROCK Pi 4B+
Card did not respond to voltage select! : -110
Unable to get mmc desc
Net:   eth0: ethernet@fe300000
starting USB...
Bus usb@fe380000: ehci_generic usb@fe380000: Failed to get clocks (ret=-19)
Port not available.
Bus usb@fe3c0000: ehci_generic usb@fe3c0000: Failed to get clocks (ret=-19)
Port not available.
Bus usb@fe800000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus usb@fe900000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@fe800000 for devices... 1 USB Device(s) found
scanning bus usb@fe900000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
Card did not respond to voltage select! : -110
** Booting bootflow 'mmc@fe330000.bootdev.part_2' with distro
U-Boot menu
1:      Debian GNU/Linux 11 (bullseye) 5.10.110-8-rockchip
2:      Debian GNU/Linux 11 (bullseye) 5.10.110-8-rockchip (rescue target)
Enter choice: 1:        Debian GNU/Linux 11 (bullseye) 5.10.110-8-rockchip
Retrieving file: /boot/vmlinuz-5.10.110-8-rockchip

same error with fsck:

rock@rock-pi-4b-plus:~$ sudo fsck /dev/mmcblk0
fsck from util-linux 2.36.1
e2fsck 1.46.2 (28-Feb-2021)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/mmcblk0

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Found a gpt partition table in /dev/mmcblk0

=> mmc info
Device: mmc@fe330000
Manufacturer ID: 88
OEM: 3
Name: D9D16G
Bus Speed: 52000000
Mode: MMC High Speed (52MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 14.5 GiB
Bus Width: 8-bit
Erase Group Size: 512 KiB
HC WP Group Size: 4 MiB
User Capacity: 14.5 GiB WRREL
Boot Capacity: 4 MiB ENH
RPMB Capacity: 4 MiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected

=> mmc part

Partition Map for MMC device 0  --   Partition Type: EFI

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00008000      0x0000ffff      "config"
        attrs:  0x0000000000000000
        type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
                (data)
        guid:   584cd271-82df-4087-8df6-23d6a127af07
  2     0x00010000      0x01ce7fde      "rootfs"
        attrs:  0x0000000000000000
        type:   c12a7328-f81f-11d2-ba4b-00a0c93ec93b
                (system)
        guid:   e3e4bd45-b846-43a0-9e68-773c8808c997

=> boot
Card did not respond to voltage select! : -110
** Booting bootflow ‘mmc@fe330000.bootdev.part_2’ with distro
U-Boot menu
1: Debian GNU/Linux 11 (bullseye) 5.10.110-8-rockchip
2: Debian GNU/Linux 11 (bullseye) 5.10.110-8-rockchip (rescue target)
Enter choice: 1: Debian GNU/Linux 11 (bullseye) 5.10.110-8-rockchip
Retrieving file: /boot/vmlinuz-5.10.110-8-rockchip
Retrieving file: /boot/initrd.img-5.10.110-8-rockchip

with 30 sec waits and continuing like shown in my first post.

I’ll try to reproduce this issue today.

1 Like

for slow booting issue, you can replace a new u-boot as following steps:

  1. download and install packages
wget https://github.com/radxa-pkg/u-boot-latest/releases/download/2023.10-11/u-boot-latest_2023.10-11-cc60ff40_arm64.deb

wget https://github.com/radxa-pkg/u-boot-latest/releases/download/2023.10-11/u-boot-rock-pi-4b-plus_2023.10-11-c47eff9_all.deb

sudo dpkg -i u-boot*.deb
  1. update u-boot
cd /lib/u-boot/rock-pi-4b-plus

sudo bash setup.sh update_bootloader /dev/mmcblk0

or you can update u-boot by using system tool rsetup

sudo apt-get install rsetup #install or update it

rsetup -> System -> Bootloader Management -> Update Bootloader 

thank you, now it’s not waiting anymore!!

(the strange fsck CRC error remains)

for crc error, you can set var in u-boot:

=> env default -a

Resetting to default environment

=> saveenv
Saving Environment to MMC… Writing to MMC(0)… OK
=> reset

I have the same strange Superblock/GPT error on a microSD card which I fiddled on in u-boot and now the card says it’s writeprotected on every level.
Is it possible to put a SDcard in read-only in u-boot that it looks like hardware issue? (it’s a new card so not worn or so)

In U-Boot, setting the SD card directly to read-only status is not usually the operation.

can it be un-done?