This is a problem I caused myself, but I have some trouble solving it because of some Rock 5B specific issues. Please allow me to explain.
I’ve been using the 5B for a while now and I really like the device. I wanted to change a boot parameter and I messed up because now I’m ending up in a boot loop. I know it’s not the power source, since I’m using a rPI 5.1v charger and that one was stable the whole time (until I rebooted).
I want to undo my changes to the /boot/config.txt, but here is the problem:
my OS (boot + root) is on NVMe
when try to boot with an SD card, the u-boot of the SD card is used, good
the u-boot of the SD card sees there is a /boot partition on the NVMe and boots from there
it hits the invalid config (I guess, I can’t debug that now) and after a while, reboots
since the u-boot has console disabled, I can’t interrupt the booting and boot manually
Normally I would take out the storage in a different device and fix it there, but I don’t have another device that can read NVMe (well, I do, but that’s my current server. I’d rather not turn that off for a longer period of time if I can avoid it).
I guess I can put a different u-boot on the SD-card that will not try to boot from NVMe? Or at least allow me to select which device to boot from (if it boots from SD-card, then I’m good, I think I can fix it).
Any tips? Again, I’m pretty sure it’s not a power problem, it’s a boot config that I messed up myself
Related: @jack, do you know when the PD support will be include in U-boot? I think the U-boot console has been disabled to mitigate problems with PD, which is fine, but in this case prevents me from debugging/interacting with the boot process to fix my problem. If the PD support is fixed, I can use my PD charger and I think the U-boot console can be turned on again
I forgot to mention, I have access to the serial console so I can see the 5B rebooting every … minute or so? I didn’t time it.
Thanks, but I don’t believe it’s PD related. My PSU is stable for now. I messed something up in software and I’m trying to figure out how to recover from that
I just tried this but this sadly did not get me further. When I boot I got this:
DDR Version V1.08 20220617
LPDDR4X, 2112MHz
channel[0] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB
channel[1] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB
channel[2] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB
channel[3] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB
Manufacturer ID:0x6
[snip]
Hit key to stop autoboot('CTRL+C'): 0
invalid flags type!
Device 0: Vendor: 0x144d Rev: 4B2QEXM7 Prod: S6P7NS0T128234R
Type: Hard Disk
Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
... is now current device
Scanning nvme 0:1...
[snip]
Starting kernel ...
[ 2.372660] Booting Linux on physical CPU 0x0000000000 [0x412fd050]
[ 2.372683] Linux version 5.10.66-28-rockchip-gc428536281d6 (stephen@lara) (gcc (Ubuntu/Linaro 7.5.0-6ubuntu2) 7.5.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #rockchip SMP Fri Nov 18 08:10:28 UTC 2022
[ 2.382196] Machine model: Radxa ROCK 5B
[ 2.382233] earlycon: uart8250 at MMIO32 0x00000000feb50000 (options '')
[ 2.385332] printk: bootconsole [uart8250] enabled
and then it stops, until after a while it reboots and the same repeats.
So we can see that the debug u-boot is used (because I get more information) so it does use whatever is on the SD card, then that u-boot is booting from NVMe, which I wanted to avoid since the /boot was messed up.
Then I tried to stop the process (press CTRL+C when it says so) and then I got this:
[same stuff as before]
Hit key to stop autoboot('CTRL+C'): 0
invalid flags type!
Device 0: Vendor: 0x144d Rev: 4B2QEXM7 Prod: S6P7NS0T128234R
Type: Hard Disk
Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
... is now current device
Could not find misc partition
ANDROID: reboot reason: "(none)"
optee check api revision fail: -1.0
optee api revision is too low
### ERROR ### Please RESET the board ###
which of course did not achieve my goal either
Do you have any other idea how to boot from SD card (skipping the valid, but broken /boot on NVMe)?
I had gotten the similar problem. I found 2 methods to solve.
Use different .img on SD. In my case, NVMe was debos-radxa image, if SD use the same image source it will boot for NVMe. If I use other source of image ex. Android, Ubuntu-Wayland etc. It will boot from SD.
Remove NVMe.
I guess problem is the same UUID of disk partition on NVMe and SD.
Before I also tried to boot from SD to fix something else (convert rootfs to lvm, which eventually succeeded), and I noticed that even though I’m booting from SD, the u-boot sees the boot partition on NVMe and gives that priority over the boot partition on the SD card.
I finally managed to boot from SD fully by removing the partition from NVMe with fdisk and after booting restoring the boot partition.
Obviously that’s not an option now, since I can’t boot a working Linux since the boot partition on NVMe (which I broke), takes priority. I wish I knew how to change that.
I might have to recompile u-boot to skip NVMe, but I was hoping to avoid that.
@RadxaNaoki did you manage to make any progress on the u-boot image? I can deal with just the u-boot part, I don’t need the whole 16 MB image. I want to overwrite the u-boot on the SD card and I don’t want to overwrite the partition table, so I’m doing u-boot only anyway
I don’t know if that makes a difference for you, but just in case!
I would recommend modifying the boot args to point to the physical partition of the sdcard (e.g. root=/dev/mmcblk0p2 instead of letting it use root=UUID=$UUID -
Hi steev, thanks for responding. I’m not sure if I understand correctly, but I think you mean the configuration that lives on the /boot partition?
In that case, I can change the boot partition of the SD card, but I think the u-boot picks the boot partition on the NVMe instead. If you know a way to edit the boot position on the NVMe, that would solve my problem since I can then correct my mistake
Hey @RadxaNaoki, no problem, thanks for the image! I’ll give it a try and let you know how it went! I don’t know if I have time today, but I’ll try it as soon as I’m able!
Update: @RadxaNaoki your u-boot helped me out, thank you so much!
I was able to finally boot from SD (ignoring the nvm during boot, but having access to it after boot).
It turned out I changed the UUID of my root device, and I did not realise that update_extlinux.sh reads from /etc/kernel/cmdline (and of course I did not update that).
Anyhow, I managed to update my boot config, updated /etc/kernel/cmdline and now I can safely reboot with only NVMe!