Nanopi Neo3 Create a u-boot on SD to boot and run from USB 3.0

Thanks for your info on this.

Your config seems similar to what I have on my NPNeo3.

root@DietPi:~# cat /etc/fstab

  • some lines deleted
    #----------------------------------------------------------------

PHYSICAL DRIVES

#----------------------------------------------------------------
UUID=a1e61736-4963-444e-8fdd-9cf78dab8eff / ext4 noatime,lazytime,rw 0 1
UUID=55e73fb1-a348-4bcf-81e2-186c4145a937 /mnt/sdcard ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount
UUID=73d03cd2-248f-4987-861e-47227f602d37 /mnt/data auto defaults 0 1

root@DietPi:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 223.6G 0 disk
|-sda1 8:1 0 20G 0 part /
-sda2 8:2 0 203.6G 0 part /mnt/data mmcblk0 179:0 0 29.7G 0 disk -mmcblk0p1 179:1 0 29.7G 0 part /mnt/sdcard

root@DietPi:~# ls -l /
total 56
lrwxrwxrwx 1 root root 7 Sep 24 2023 bin → usr/bin
lrwxrwxrwx 1 root root 16 Sep 30 2023 boot → /mnt/sdcard/boot
drwxr-xr-x 15 root root 3400 Jul 24 19:13 dev

  • some lines deleted

The differences between your and mine configuration seem minor:
In your config a bind mount is used, I mine it is a link. But the result is functionally the same I guess.
These difference have been discussed here: [Tutorial] Odroid C4 rootfs on USB drive [deprecated as of kernel 6.6] - #2 by Ruud

What I tried to realize using the “pyatz” method:

so that there is no need for any reference to the SD card any more.

As can be seen from the setup on my 2nd NPNeo3, with a usb drive connected to the USB 2.0 interface:

root@DietPi:~# cat /etc/fstab

  • some lines deleted
    #----------------------------------------------------------------

PHYSICAL DRIVES

#----------------------------------------------------------------
UUID=8a079158-7be5-41b9-afa6-52248797b314 / ext4 noatime,lazytime,rw 0 1
root@DietPi:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 29.8G 0 disk
└─sda1 8:1 0 6.7G 0 part /
mmcblk0 179:0 0 14.5G 0 disk
└─mmcblk0p1 179:1 0 14.5G 0 part
root@DietPi:~# ls -l /
total 8816
lrwxrwxrwx 1 root root 7 Jun 10 18:04 bin → usr/bin
drwxr-xr-x 4 root root 4096 Jul 21 10:23 boot
-rwxr-xr-x 1 root root 138 Jul 19 11:46 checknode.sh
drwxr-xr-x 15 root root 3380 Jul 23 11:54 dev
drwxr-xr-x 58 root root 4096 Jul 18 20:09 etc
drwxr-xr-x 3 root root 4096 Jun 10 18:16 home

  • some lines deleted

As you can see : there is no reference any more to files or directories on the SD card, so I assume that whatever update will be performed on this filesystem including possible modification of the content of the /boot directory ( e.g. updated DTB or new items in config files) will function as intended.

Both the bind or link to the /boot directory on the SD card try to functionally do the same I guess. But you never know beforehand if all changes will function as expected.

Ruud marked his tutorial as depreciated because it does not work with a kernel > 6.6
I have no problems thus far using a kernel > 6.6 but as said before: I don’t like unpleasant surprises.

With the “pyatz” method you only need to have a SBC specific u-boot version on the SD image to boot from. And all config info coming from the USB device.
So you are not dependant any more of any info on the SD drive.

And it works with the USB 2.0 interface, but not with the USB3.0 interface.
I suspect that the use of incomplete coding used in the u-boot source is causing this. But I cannot verify this.
I got lost in the “woods” so to speak. I found many different u-boot sources for the nanopi neo2/3 family, but no apparent differences between USB2.0 and USB3.0 DTB’s that could explain why there is a difference between using a USB 2.0 interface or a USB3.0 interface. I know that one is using the EHCI protocol (USB2) and the other OHCI. But what I found about that protocol was that it is quite common so I would not expect it not to function properly.

That leaves only a few options:

  • it is not implemented properly
  • My expectations about how it should work are not correct
  • Additional functionality is needed for it to operate properly in de u-boot environment
  • Something else?

So still hoping that someone can shed a light on this…

But I might be wrong on that of course…