For the last days I was trying to boot Debian from an NVMe M.2 SSD with U-Boot (mainline) installed on a microSD card on my new Rock Pi 4A. As soon as I’m happy with my U-Boot build I plan to install it on the SPI flash.
I followed the official U-Boot documentation, so first I built the required ARM Trusted Firmware (TF-A) without any problems:
git clone --depth 1 https://github.com/ARM-software/arm-trusted-firmware.git
cd arm-trusted-firmware
make realclean
make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399
cd ..
After that I built U-Boot like this…
git clone --depth 1 https://source.denx.de/u-boot/u-boot.git
cd u-boot
export BL31=../arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
make rock-pi-4-rk3399_defconfig
make CROSS_COMPILE=aarch64-linux-gnu-
…and then I flashed the single boot image to my microSD card:
sudo dd if=u-boot-rockchip.bin of=/dev/sda seek=64
sync
I put the microSD card in my Rock Pi 4 and everything went well until I got this error message: "distro_bootcmd" not defined.
The following days I tried to get a rough idea about how U-Boot works and why in my case the default value for bootcmd (distro_bootcmd) is not defined… At this point I won’t (because I can’t) go into details – I just wanted to note how easy it was to solve this problem: All I had to do was to use another boot command: bootflow scan
. I did that with
make menuconfig
and then I navigated to Boot options --> bootcmd value
and there I entered bootflow scan
. And that was it 🙂