Booting ROCK Pi 4(A/B/C) with mainline u-boot in SPI, NVMe and Armbian v20.11.x


piter75
 Share

6 6

Recommended Posts

Donate and support the project!

14 minutes ago, Joaho said:

Thank you, without you I could not have done it!

No problem :)

Care to share what drive do you boot with SPI?

 

17 hours ago, BiNiCKNiCH said:

I can confirm that it also runs with an HP SSD EX900 M.2 NVMe 120GB. Model: 2YY42AA#ABB

Thanks for sharing the drive info :)

I will add it to a known working list.

Link to post
Share on other sites

The second Rock Pi 4 is running too, that NVME is a Samsung MZ VLB 512B.

 

What I learned: I did everything according to Piters howto and got a bad boot (screen on and off, blue led blinking, stays the same). Or colored stripes with distorted text with screen on and then off.

First I then started from beginning, newly flashed the SDchip, the whole procedure, only to get a bad boot again.

Then, by luck, I did a second boot after the first and this worked! Several times. Weird, but useful!

Edit: When there was one good boot the bad booting does not come back!

 

Edit2: It DOES come back sometimes. But then always the second boot is successful.

Link to post
Share on other sites

My testing result: (U-Boot 2020.07-armbian (Dec 12 2020 - 01:58:01 +0100))

SD card boot: Working (absolutely)

NVMe boot: Working (on my ssd w/ sm2263xt controller)

USB boot: Working (bad compability, the upper usb3.0 port seems won't work)

PXE boot: Untested (but networking seems okay)

EMMC boot: Untested

SPI Flash read/write: Working

HDMI: Working (tested 1920x1080)

USB keyboard: Not working(can be detected but not working)

 

Link to post
Share on other sites

Am 29.11.2020 um 20:53 schrieb piter75:

...

Which NVMe drives are known to be working?

Corsair MP510 240GB/480GB

Gigabyte SSD M.2 2280 PCIe x2 Model:GP-GSM2NE8128GNTD
Intel SSD 660p Model:SSDPEKNW512GB
Kingston A1000 SSD 240GB (PHISON PS5008-E8-10)

Kingston A2000 M.2 2280 PCIe NVMe

PNY 250GB XLR8 CS3030 M.2 NVMe SSD PCIe Gen3 x4

Samsung 970 EVO Plus SSD 250GB M.2 2280, PCIe 3.0 x4, NVMe, 3500/2300 MB/s

Samsung SM981 256GB

...

You can add the Sabrent 256 GB Rocket NVMe PCIe M.2 2280 to the List, it works great according to your instructions.
I have translated parts of your instructions on my blog into German and used them with a reference to this post. I hope this is OK with you.

 

Greets
Ronny

Link to post
Share on other sites

1 hour ago, RonDittrich said:

You can add the Sabrent 256 GB Rocket NVMe PCIe M.2 2280 to the List, it works great according to your instructions.

Done. Thanks for feedback!

 

1 hour ago, RonDittrich said:

I have translated parts of your instructions on my blog into German and used them with a reference to this post. I hope this is OK with you.

No problem. I am glad it may help someone.

It reminded me that I should update the instructions anyway - current instructions still work but some steps are unnecessary.

With Armbian 20.11.4+ pins shorting is not needed anymore for folks that already have Radxa's u-boot in their SPI flash.

Link to post
Share on other sites

vor 2 Minuten schrieb piter75:

With Armbian 20.11.4+ pins shorting is not needed anymore for folks that already have Radxa's u-boot in their SPI flash.

Are you sure?
I use the Armbian_20.11.6_Rockpi-4c_focal_current_5.9.14_desktop and without the short circuit it would not work for me.
It was a brand new RockPi4c from the last production that i get for testing direct from Raxda.

 

Link to post
Share on other sites

2 minutes ago, RonDittrich said:

I use the Armbian_20.11.6_Rockpi-4c_focal_current_5.9.14_desktop and without the short circuit it would not work for me.

Hmmm... now that you say it... I need to retest it with some fresh SPI image from Radxa.

Maybe there still is some interoperability issue between our u-boot images.

Link to post
Share on other sites

Intel Optane memory M10 16GB is NOT working. Here is some log.

 

U-Boot TPL 2020.07-armbian (Dec 23 2020 - 15:30:05)                                                                                                                 
Channel 0: LPDDR4, 50MHz                                                                                                                                            
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB                                                                                                  
Channel 1: LPDDR4, 50MHz                                                                                                                                            
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB                                                                                                  
256B stride                                                                                                                                                         
256B stride                                                                                                                                                         
lpddr4_set_rate: change freq to 400000000 mhz 0, 1                                                                                                                  
lpddr4_set_rate: change freq to 800000000 mhz 1, 0                                                                                                                  
Trying to boot from BOOTROM                                                                                                                                         
Returning to boot ROM...                                                                                                                                            
                                                                                                                                                                    
U-Boot SPL 2020.07-armbian (Dec 23 2020 - 15:30:05 +0100)                                                                                                           
Trying to boot from SPI                                                                                                                                             
NOTICE:  BL31: v1.3(debug):42583b6                                                                                                                                  
NOTICE:  BL31: Built : 07:55:13, Oct 15 2019                                                                                                                        
NOTICE:  BL31: Rockchip release version: v1.1                                                                                                                       
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3                                                                                    
INFO:    Using opteed sec cpu_context!                                                                                                                              
INFO:    boot cpu mask: 0                                                                                                                                           
INFO:    If lpddr4 need support multi frequency,                                                                                                                    
INFO:    please update loader!                                                                                                                                      
INFO:    Current ctl index[0] freq=400MHz                                                                                                                           
INFO:    Current ctl index[1] freq=800MHz                                                                                                                           
INFO:    plat_rockchip_pmu_init(1190): pd status 3e                                                                                                                 
INFO:    BL31: Initializing runtime services                                                                                                                        
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK                            
ERROR:   Error initializing runtime service opteed_fast                                                                                                             
INFO:    BL31: Preparing for EL3 exit to normal world                                                                                                               
INFO:    Entry point address = 0x200000                                                                                                                             
INFO:    SPSR = 0x3c9                                                                                                                                               
                                                                                                                                                                    
                                                                                                                                                                    
U-Boot 2020.07-armbian (Dec 23 2020 - 15:30:05 +0100)                                                                                                               
                                                                                                                                                                    
SoC: Rockchip rk3399                                                                                                                                                
Reset cause: RST                                                                                                                                                    
Model: Radxa ROCK Pi 4B                                                                                                                                             
DRAM:  3.9 GiB                                                                                                                                                      
PMIC:  RK808                                                                                                                                                        
MMC:   mmc@fe310000: 2, mmc@fe320000: 1, sdhci@fe330000: 0                                                                                                          
Loading Environment from SPI Flash... SF: Detected XT25F32B with page size 256 Bytes, erase size 4 KiB, total 4 MiB                                                 
OK                                                                                                                                                                  
In:    serial                                                                                                                                                       
Out:   serial                                                                                                                                                       
Err:   serial                                                                                                                                                       
Model: Radxa ROCK Pi 4B                                                                                                                                             
Net:   eth0: ethernet@fe300000                                                                                                                                      
Hit any key to stop autoboot:  0                                                                                                                                    
Card did not respond to voltage select!                                                                                                                             
Card did not respond to voltage select!                                                                                                                             
"Synchronous Abort" handler, esr 0x96000210                                                                                                                         
elr: 000000000022d918 lr : 000000000022d8b4 (reloc)                                                                                                                 
elr: 00000000f3f5a918 lr : 00000000f3f5a8b4                                                                                                                         
x0 : 00000000f8000000 x1 : 0000000000000001                                                                                                                         
x2 : 0000000000000000 x3 : 0000000000100000                                                                                                                         
x4 : 00000000f1f37e00 x5 : 0000000000100000                                                                                                                         
x6 : 0000000000000001 x7 : 00000000f3fcd888                                                                                                                         
x8 : 0000000000000000 x9 : 0000000000000008                                                                                                                         
x10: 00000000ffffffe8 x11: 0000000000000010                                                                                                                         
x12: 000000000000149c x13: 00000000f1f149fc                                                                                                                         
x14: 00000000f1f15b20 x15: 0000000000000020                                                                                                                         
x16: 00000000f3f5a878 x17: 0000000000060001                                                                                                                         
x18: 00000000f1f26dc0 x19: 00000000f1f14970                                                                                                                         
x20: 0000000000000001 x21: 0000000000000000                                                                                                                         
x22: 0000000000010000 x23: 00000000f3fd37f8                                                                                                                         
x24: 0000000000010000 x25: 00000000f3fba3f2                                                                                                                         
x26: 0000000000000000 x27: 0000000000000000                                                                                                                         
x28: 00000000f1f37d10 x29: 00000000f1f148d0                                                                                                                         
                                                                                                                                                                    
Code: 540000c1 350000a5 93407c05 f9400080 (b86068a0)                                                                                                                
Resetting CPU ...                   

 

The error code is exactly same as the legacy(radxa) u-boot.

https://forum.radxa.com/t/bootloader/2309

Edited by hallo1
Link to post
Share on other sites

On 1/19/2021 at 5:16 AM, thc013 said:

yeah did you check what is on your optane or emmc or sd ?

 

"Synchronous Abort" handler, esr 0x96000210

sd and emmc are not present. 

The radxa's image have been flashed to the optane memory. 

But actrually the content inside the optane memory don't have much to do with this error. EVEN A BLANK OPTANE MEMORY CAUSES THIS ERROR.

Link to post
Share on other sites

11 minutes ago, BiNiCKNiCH said:

The WDS100T2B0C doesn't seem to work so well after all. Sometimes the reboot hangs and the system only restarts after a power reset.

I wonder if it hangs in u-boot or in kernel later on.

Did you have a chance to catch such hanging boot with a serial console?

Link to post
Share on other sites

vor einer Stunde schrieb piter75:

I wonder if it hangs in u-boot or in kernel later on.

Did you have a chance to catch such hanging boot with a serial console?

Yes I did, and now I think it has nothing to do with the SSD. I installed the latest Armbian image from today. Apparently my Rockpi is trying to load files from my Fritzbox via TFTP.  :wacko: 

 

I canceled the serial console and restarted via reset, and now the rockpi starts again without problems.

 

Armbian 20.11.6 Focal ttyS2 

rockpi-4a login: [   36.932811] watchdog: watchdog0: watchdog did not stop!
[   37.227029] reboot: Restarting system

U-Boot TPL 2020.10-armbian (Jan 05 2021 - 03:54:57)
Channel 0: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=16/15 CS=1 Die BW=16 Size=2048MB
Channel 1: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=16/15 CS=1 Die BW=16 Size=2048MB
256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2020.10-armbian (Jan 05 2021 - 03:54:57 +0100)
Trying to boot from SPI
NOTICE:  BL31: v1.3(debug):42583b6
NOTICE:  BL31: Built : 07:55:13, Oct 15 2019
NOTICE:  BL31: Rockchip release version: v1.1
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    If lpddr4 need support multi frequency,
INFO:    please update loader!
INFO:    Current ctl index[0] freq=400MHz
INFO:    Current ctl index[1] freq=800MHz
INFO:    plat_rockchip_pmu_init(1190): pd status 3e
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2020.10-armbian (Jan 05 2021 - 03:54:57 +0100)

SoC: Rockchip rk3399
Reset cause: RST
Model: Radxa ROCK Pi 4B
DRAM:  3.9 GiB
PMIC:  RK808 
MMC:   mmc@fe310000: 2, mmc@fe320000: 1, sdhci@fe330000: 0
Loading Environment from SPIFlash... SF: Detected XT25F32B with page size 256 Bytes, erase size 4 KiB, total 4 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Model: Radxa ROCK Pi 4B
Net:   eth0: ethernet@fe300000
Hit any key to stop autoboot:  0 
Card did not respond to voltage select!
Card did not respond to voltage select!
PCIe link training gen1 timeout!

Device 0: unknown device
starting USB...
Bus usb@fe380000: USB EHCI 1.00
Bus usb@fe3c0000: USB EHCI 1.00
Bus dwc3: usb maximum-speed not found
Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@fe380000 for devices... 1 USB Device(s) found
scanning bus usb@fe3c0000 for devices... 1 USB Device(s) found
scanning bus dwc3 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
failed to find ep-gpios property
ethernet@fe300000 Waiting for PHY auto negotiation to complete........ done
Speed: 1000, full duplex
BOOTP broadcast 1
DHCP client bound to address 192.168.1.11 (4 ms)
*** Warning: no boot file name; using 'C0A8010B.img'
Using ethernet@fe300000 device
TFTP from server 192.168.1.1; our IP address is 192.168.1.11
Filename 'C0A8010B.img'.
Load address: 0x800800
Loading: *T T T T T T T T T T 
Retry count exceeded; starting again
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/01-5e-35-1a-eb-5a-8d
Speed: 1000, full duplex
Using ethernet@fe300000 device
TFTP from server 192.168.1.1; our IP address is 192.168.1.11
Filename 'pxelinux.cfg/01-5e-35-1a-eb-5a-8d'.
Load address: 0x600000
Loading: *T T T T T T T T T T 
Retry count exceeded; starting again
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/C0A8010B
Speed: 1000, full duplex
Using ethernet@fe300000 device
TFTP from server 192.168.1.1; our IP address is 192.168.1.11
Filename 'pxelinux.cfg/C0A8010B'.
Load address: 0x600000
Loading: *T T T T T T T 

 

Another reboot hangs on the kernel loading:

 

Last login: Mon Jan 25 23:33:11168.1.105 on pts/0
rock@rockpi-4a:~$ reboot
rock@rockpi-4a:~$ [  148.654202] watchdog: watchdog0: watchdog did not stop!
[  148.932579] reboot: Restarting system

U-Boot TPL 2020.10-armbian (Jan 05 2021 - 03:54:57)
Channel 0: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=16/15 CS=1 Die BW=16 Size=2048MB
Channel 1: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=16/15 CS=1 Die BW=16 Size=2048MB
256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2020.10-armbian (Jan 05 2021 - 03:54:57 +0100)
Trying to boot from SPI
NOTICE:  BL31: v1.3(debug):42583b6
NOTICE:  BL31: Built : 07:55:13, Oct 15 2019
NOTICE:  BL31: Rockchip release version: v1.1
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    If lpddr4 need support multi frequency,
INFO:    please update loader!
INFO:    Current ctl index[0] freq=400MHz
INFO:    Current ctl index[1] freq=800MHz
INFO:    plat_rockchip_pmu_init(1190): pd status 3e
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2020.10-armbian (Jan 05 2021 - 03:54:57 +0100)

SoC: Rockchip rk3399
Reset cause: RST
Model: Radxa ROCK Pi 4B
DRAM:  3.9 GiB
PMIC:  RK808 
MMC:   mmc@fe310000: 2, mmc@fe320000: 1, sdhci@fe330000: 0
Loading Environment from SPIFlash... SF: Detected XT25F32B with page size 256 Bytes, erase size 4 KiB, total 4 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Model: Radxa ROCK Pi 4B
Net:   eth0: ethernet@fe300000
Hit any key to stop autoboot:  0 
Card did not respond to voltage select!
Card did not respond to voltage select!

Device 0: Vendor: 0x15b7 Rev: 211070WD Prod: 20427P462511        
            Type: Hard Disk
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
... is now current device
Scanning nvme 0:1...
Found U-Boot script /boot/boot.scr
3185 bytes read in 2 ms (1.5 MiB/s)
## Executing script at 00500000
Boot script loaded from nvme 0
261 bytes read in 2 ms (127 KiB/s)
15790152 bytes read in 37 ms (407 MiB/s)
27507200 bytes read in 55 ms (477 MiB/s)
74439 bytes read in 3 ms (23.7 MiB/s)
267 bytes read in 2 ms (129.9 KiB/s)
Applying kernel provided DT overlay rockchip-pcie-gen2.dtbo
1314 bytes read in 2 ms (641.6 KiB/s)
Applying kernel provided DT overlay rockchip-spi-jedec-nor.dtbo
2698 bytes read in 2 ms (1.3 MiB/s)
Applying kernel provided DT fixup script (rockchip-fixup.scr)
## Executing script at 09000000
Moving Image from 0x2080000 to 0x2200000, end=3cd0000
## Loading init Ramdisk from Legacy Image at 06000000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
   Data Size:    15790088 Bytes = 15.1 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01f00000
   Booting using the fdt blob at 0x1f00000
   Loading Ramdisk to f100d000, end f1f1c008 ... OK
   Loading Device Tree to 00000000f0f92000, end 00000000f100cfff ... OK

Starting kernel ...

 

 

Edited by BiNiCKNiCH
Link to post
Share on other sites

Fantastic instructions and thanks for all the work! I was able to follow the instructions and almost had it working. There were some small changes required however.

 

I had to modify my /boot/boot.cmd on the nvme drive:

--- /boot/boot.cmd
+++ /boot/boot.cmd
@@ -6,7 +6,7 @@
 setenv load_addr "0x9000000"
 setenv overlay_error "false"
 # default values
-setenv rootdev "/dev/mmcblk0p1"
+setenv rootdev "/dev/nvme0n1p1"
 setenv verbosity "1"
 setenv console "both"
 setenv bootlogo "false"
@@ -29,7 +29,7 @@
 if test "${bootlogo}" = "true"; then setenv consoleargs "bootsplash.bootfile=bootsplash.armbian ${consoleargs}"; fi
 
 # get PARTUUID of first partition on SD/eMMC the boot script was loaded from
-if test "${devtype}" = "mmc"; then part uuid mmc ${devnum}:1 partuuid; fi
+if test "${devtype}" = "nvme"; then part uuid nvme ${devnum}:1 partuuid; fi
 
 setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}"
 

 

Then after modifying I ran `mkimage -C none -A arm -T script -d /u/boot/boot.cmd /u/boot/boot.scr`

 

(I had mounted the nvme partition under `/u` after the `nand-sata-instal` step completed)

 

Without this fix the board would not seem to boot. U-boot would complete and then load the kernel. However I was able to see via serial that the kernel was waiting for the root device to appear (looping `Begin: Running /scripts/local-block ... done.` over and over). Then it would drop to an initramfs shell and alert that it was unable to find the root filesystem device and had given up.

 

Hardware:

RockPi 4A 1.4

Kingston A2000 1TB

ROCK PI 4x M.2 Extension board v1.6

 

Armbian Image:

5036f952501644989d744d789d36c4f797501d48e24605d7a8f043adfc792ad0 *Armbian_21.02.1_Rockpi-4a_buster_current_5.10.12.img.xz

 

Full /boot/armbianEnv.txt:

verbosity=1
console=both
bootlogo=false
overlay_prefix=rockchip
fdtfile=rockchip/rk3399-rock-pi-4a.dtb
rootdev=UUID=3e02d076-8e50-47fe-9a55-df7e1edef6e0
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

Full /boot/boot.cmd:

# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#

setenv load_addr "0x9000000"
setenv overlay_error "false"
# default values
#setenv rootdev "/dev/mmcblk0p1"
setenv rootdev "/dev/nvme0n1p1"
setenv verbosity "1"
setenv console "both"
setenv bootlogo "false"
setenv rootfstype "ext4"
setenv docker_optimizations "on"
setenv earlycon "off"

echo "Boot script loaded from ${devtype} ${devnum}"

if test -e ${devtype} ${devnum} ${prefix}armbianEnv.txt; then
	load ${devtype} ${devnum} ${load_addr} ${prefix}armbianEnv.txt
	env import -t ${load_addr} ${filesize}
fi

if test "${logo}" = "disabled"; then setenv logo "logo.nologo"; fi

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "console=ttyS2,1500000 ${consoleargs}"; fi
if test "${earlycon}" = "on"; then setenv consoleargs "earlycon ${consoleargs}"; fi
if test "${bootlogo}" = "true"; then setenv consoleargs "bootsplash.bootfile=bootsplash.armbian ${consoleargs}"; fi

# get PARTUUID of first partition on SD/eMMC the boot script was loaded from
#if test "${devtype}" = "mmc"; then part uuid mmc ${devnum}:1 partuuid; fi
if test "${devtype}" = "nvme"; then part uuid nvme ${devnum}:1 partuuid; fi

setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}"

if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1"; fi

load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd
load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}Image

load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
fdt addr ${fdt_addr_r}
fdt resize 65536
for overlay_file in ${overlays}; do
	if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
		echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo"
		fdt apply ${load_addr} || setenv overlay_error "true"
	fi
done
for overlay_file in ${user_overlays}; do
	if load ${devtype} ${devnum} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then
		echo "Applying user provided DT overlay ${overlay_file}.dtbo"
		fdt apply ${load_addr} || setenv overlay_error "true"
	fi
done
if test "${overlay_error}" = "true"; then
	echo "Error applying DT overlays, restoring original DT"
	load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
else
	if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-fixup.scr; then
		echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)"
		source ${load_addr}
	fi
	if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then
		load ${devtype} ${devnum} ${load_addr} ${prefix}fixup.scr
		echo "Applying user provided fixup script (fixup.scr)"
		source ${load_addr}
	fi
fi
booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr

 

Edited by squishykid
more information about what happened before my fix.
Link to post
Share on other sites

4 hours ago, squishykid said:

Without this fix the board would not seem to boot. U-boot would complete and then load the kernel.

Thanks for feedback.

 

"rootdev" from /boot/boot.cmd should be overridden by the "UUID=" stanza in your /boot/armbianEnv.txt

It is possible that something went wrong with the nand-sata-install and it did not update the value correctly.

Can you post the link to a report generated with `sudo armbianmonitor -u`? Maybe we can identify the issue.

 

I tested the procedure quite a few times and never needed to tinker with those files manually but one thing that comes to my mind is that I always used the first partition of the drive.

I will need to test some other scenarios too ;-)

Link to post
Share on other sites

Nice tutorial.

I have got exactly same problem as squishykid, I followed his solution and it worked for me.

 

My hardware is:

RockPi 4C v1.2

ROCK PI 4X M.2 Extension board v1.6

ADATA SX8200 PRO 512GB (version based on SM2262ENG controller)

 

I used this build: Armbian_21.02.1_Rockpi-4c_focal_current_5.10.12.img

 

As I always was able to pass u-boot I think that my NVMe drive is compatible with RockPi.

 

Here is a picture of full error without squishykid's fix:

Spoiler

uj1aL57De7umCocH.png

 

Here is a report generated by "armbianmonitor -u" from my installation: http://ix.io/2RsO

 

After applying squishykid's fix I was able to normally run the system (or maybe not - I only performed sysbench for CPU and NVMe on it).

But after running "apt get update && apt get upgrade && reboot" the system again won't boot up - I'm again getting the same error as in the picture above.

Here is a report just after doing "apt get update && apt get upgrade": http://ix.io/2Rtz

I don't know what has been broken by upgrade but the boot.cmd and armbianEnv.txt are left unchanged, also I created new boot.scr (by using mkimage) but still after upgrade I'm unable to boot again from my NVMe.

 

Link to post
Share on other sites

On 3/3/2021 at 1:41 AM, MrDzikuPL said:

After applying squishykid's fix I was able to normally run the system (or maybe not - I only performed sysbench for CPU and NVMe on it).

I am still thinking that this "fix" is actually only a workaround covering for some other issue.

It sets "rootdev" to "/dev/nvme0n1p1" device but it should be overridden anyway with variables loaded from /boot/armbianEnv.txt.

It also sets "ubootpart" in the kernel command line but this is only used by Armbian scripts for writing u-boot later on. IMHO it has nothing to do with the boot process.

 

With those two facts combined - either /boot/armbianEnv.txt is not loaded correctly and does not use "rootenv=UUID=xxx" (I see in your armbianmonitor log that the variable is properly configured) or the fix is simply a placebo effect and it "works" because something else has also changed in the system.

If you look at the last full dmesg of http://ix.io/2Rtz you see that the kernel command line uses "root=UUID=94xxx" which actually confirms that the fix is actually ineffective.

If you look at the lsblk part of the log after this dmesg it shows that the system actually booted with nvme.

 

What I suspect is that your drive is not always recognised by kernel. That would explain the missing UUID=5xxxx message in your screenshot.

If you look at the screenshot there are actually no nvme* devices present in "ls /dev" output - that would corroborate my suspicion.

What I would try would be a bit of testing: cold booting and rebooting at least a few times with SD card present and verify if the nvme device is actually present after booting.

Link to post
Share on other sites

Very nice work guys. I'm so glad I found this. I've had my Rock Pi 4B for over a year and it's been gathering dust because every time I try to get it stable I get frustrated. This time will be different. I hope. Pray even.

 

I'm following the instructions and on the reboot in step 4 I'm getting a kernel panic. How do I know the panic is because of an incompatible NVME or other reason?

 

Rock Pi 4A v1.4

XPG NVME (128GB)

Samsung uSD (128GB)

 

Any pointers? Or am I stuck with the Radxa Ubuntu image with broken USB3?

Link to post
Share on other sites

Never-mind! It seems to be a problem with the Focal (4.4.y) image. I downloaded the Focal (5.10.y) image and it's worked as described. Which also means that the XPG SX6000 Lite 128GB PCIe 3D NAND PCIe Gen3x4 M.2 2280 NVMe (ASX6000LNP-128GT-C) works well with this setup. Its a cheap and cheerful NVME purchased from Amazon.

 

Now I just need to get nfs server working to share data between my Macs and other servers (ubuntu and Raspbian). I've found a few hundred tutorials and they are all just a little different and so far none have worked. :-/

 

Thanks for the great work on this!

 

Link to post
Share on other sites

47 minutes ago, madmailman said:

Which also means that the XPG SX6000 Lite 128GB PCIe 3D NAND PCIe Gen3x4 M.2 2280 NVMe (ASX6000LNP-128GT-C) works well with this setup.

Thanks for sharing drive details!

I will add it to the opening post.

Link to post
Share on other sites

Hi

thanks for writing up this howto, unfortunately I can't get it to work.

I have a RockPi 4c, Crucial P1 M.2 1TB NVME.

I also tried squishykid's workaround. It seems that my nvme is not recognized.

 

After the "Starting kernel ... " message the boot process stops in a busybox shell.

The error message says that UUID=xxxx does not exist.

 

Too bad.

So, there's an NVME you can add to your Doesn't Work list.

 

Cheers

Laci

Link to post
Share on other sites

1 hour ago, pumuckl said:

look's like the Download of Rockpi 4 A / B / C Armbian Focal is offline.

Not that it is relevant to SPI/NVMe booting ;-) but it is no longer built for that combination automatically.

 

You can build it yourself or download focal current and switch kernel to legacy with "armbian-config".

Link to post
Share on other sites

2 hours ago, lanefu said:

That would only impact nightlies not the most recent release

I am not sure of that.

 

My understanding is that we are still building release images from master branch and the removal of this line from targets.conf:

-rockpi-4b			legacy			focal		cli			stable	yes

means that focal legacy image for rockpi-4b will not be built.

Lack of focal legacy image among 20.02.3 release images (built after the referred commit was merged) seems to corroborate that theory ;-)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

6 6