[SOLVED] Rock Pi S tries to boot from USB!

Hello,
I have a RockPI-S based custom device which has a card reader (by Sabrent) permanently attached to USB port.
I want it to boot from the microSD card in the onboard microSD slot, but it tries to boot from the USB card reader instead! And fails because there’s no bootable media there.

How can I force the board to only boot from onboard microSD, automatically, every time?

This is the boot console output:

boot mode: None
CLK:
apll 816000 KHz
dpll 1300000 KHz
vpll0 1179647 KHz
vpll1 903167 KHz
aclk_bus 185714 KHz
hclk_bus 100000 KHz
pclk_bus 100000 KHz
aclk_peri 185714 KHz
hclk_peri 100000 KHz
pclk_peri 100000 KHz
hclk_audio 98303 KHz
pclk_audio 98303 KHz
Net: Net Initialization Skipped
No ethernet found.
Hit key to stop autoboot(‘CTRL+C’): 0
starting USB…
USB0: Core Release: 3.10a
USB1: USB EHCI 1.00
scanning bus 0 for devices… 1 USB Device(s) found
scanning bus 1 for devices… Device NOT ready
Request Sense returned 02 3A 00
2 USB Device(s) found
scanning usb for storage devices… 2 Storage Device(s) found

Device 0: Vendor: SABRENT Rev: 1539 Prod: SD
Type: Removable Hard Disk
Capacity: not available
… is now current device
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80

From what I’ve gathered, someone at Radxa modified the source of u-boot to change the boot order to USB first!
I need to revert that change.
So I need a guidance for:

  • rebuild u-boot appropriately

and most importantly

  • replace u-boot in the RockPI-S with the modified version

Thanks!

which image are you using?

Latest Ubuntu official:
https://dl.radxa.com/rockpis/images/ubuntu/rockpis_ubuntu_bionic_minimal_arm64_20200809_0856-gpt.img.gz

I recompiled u-boot from your source (4.4 BSP), after having corrected the boot order.
Now I have:

idbloader.img
trust.img
uboot.img

Now I need to replace the loader on my microSD card.
I guess I have to “dd something at some location”: could you guide me?
Thanks in advance

Figured it out:

dd if=idbloader.img of=/dev/sdX seek=64 conv=notrunc
dd if=uboot.img of=/dev/sdX seek=16384 conv=notrunc
dd if=trust.img of=/dev/sdX seek=24576 conv=notrunc

Works! No longer hangs trying to boot from USB :slight_smile:

xfer012
Could you give extra details on what and how to modify u-boot appropriately.
I think I’ve grasped the rest but can’t find and details on what to and which source code files need to be changed.

Hello,
at the time, I used the “4.4 stable rockpi-s” branch of Radxa u-boot.
Things changed in their Github, but I think it’s here:

The file I edited was
include/configs/rockchip-common.h

Change boot order here:

then rebuild u-boot, instructions here:
https://wiki.radxa.com/Rockpi4/dev/u-boot

Note: rebuilding u-boot is a long job and requires space and RAM…