SPI + NVMe booting(beta)

I really need to be rigorous when I post on this forum – this forum is trainning me to be a good tech writer now, haha.

  1. I do not have eMMC, and since I have the M.2 NVME extender I use a shorter ribbon, and the case that I bought really forces me to pay attention if I left a sdcard in the slot. So, no SDCard here, that’s for sure. When I was trying to flash SPI, I only have SDcard attached; now that I have flashed SPI, I only have nvme inserted to the Rock Pi.

  2. with NVME being the only medium connected to the ROCK, it’s easy for me to tell what can be booted from nvme–
    Debian Stretch downloaded from wiki.radxa.com – this one for sure works
    Community image ARBIAN based on stretch – no
    Armbian_5.90_Rockpi-4b_Debian_buster_default_4.4.182_desktop - no

I have not tried Ubuntu or Android or LibreElec, etc. I only care about Debian Desktop use.

I see. Well, I’m not really sure what the issue is. My guess is that the boot loader tries to load a kernel that is not there. I.e. there kernel in the image/boot config is named differently than the kernel contained in the image. But I’m not sure about this; at this point it is only a guess.

“the boot loader tries to load a kernel that is not there. I.e. there kernel in the image/boot config is named differently than the kernel contained in the image”

This is what I’m trying to figure out – is there a way to upgrade the kernel in Debian Stretch to Debian Buster? Is there a directory that holds the config file so I just need to copy that file into the new kernel folder and then enjoy the upgraded Debian desktop?

Thank you.

…and here’s my extreme passive cooling scheme for my Rock Pi 4A. Happy Summer Day!

1 Like

Well the easiest way would be to connect the serial debug console and watch the output of the boot loader :wink:
But I guess if you had a USB-serial adapter you would have already done that.

Yeah get yourself a serial console and if you haven’t got one a usb extension cable so its a good easy fit to your PC.

This one defo works

Your passive cooling method should be marketed :slight_smile:
Buster is very likely now it is released I presume.

@Jack are there any plans for buster?

We may have a dodgy kernel to bed in though for a while.

Yes. I have all these – jumper cords, breakout kits, debug USBs, breadboards…
If only I have the know how to take advantage of them:rofl::sweat_smile::joy:

1 Like

Coolterm is my fave and yep I use blingdows :slight_smile: https://freeware.the-meiers.org/

https://freeware.the-meiers.org/CoolTermWin.zip

Port = COM4
BaudRate = 1500000
DataBits = 8
Parity = N
StopBits = 1
FlowControlCTS = false
FlowControlDTR = false
FlowControlXON = false

Just set your port number and infinity & beyond!

1 Like

saved in my fav folder when the time comes that I get to get my hands on them…now the slow stuttering of the Debian Stretch on Rock Pi is unbearable…:disappointed_relieved::weary:

with NVME being the only medium connected to the ROCK, it’s easy for me to tell what can be booted from nvme–
Debian Stretch downloaded from wiki.radxa.com – this one for sure works
Community image ARBIAN based on stretch – no
Armbian_5.90_Rockpi-4b_Debian_buster_default_4.4.182_desktop - no

If you have u-boot running from SPI, it should boot any distribution which has a valid partition table since u-boot use distro_boot to scan all partitions.

@jack Jack in the build service is that going to be updated for Buster?

I do NOT have eMMC.
I boot from SD using Debian stretch and followed every word according to instruction on SPI Flash on this page: https://wiki.radxa.com/Rockpi4/Linux_system_runs_on_M.2_NVME_SSD

To be exact, on booting of a freshly echered Debian Stretch, I opened a terminal and typed:
$ export DISTRO=stretch-testing
$ echo “deb http://apt.radxa.com/$DISTRO/ stretch main” | sudo tee /etc/apt/sources.list.d/apt-radxa-com.list
$ wget -O - apt.radxa.com/$DISTRO/public.key | sudo apt-key add -
$ sudo apt-get update && sudo apt-get upgrade
$ sudo apt-get install -y rockchip-fstab
$ sudo apt-get install -y rockchip-overlay
$ sudo apt-get install -y rockpi4-dtbo
$ sudo apt-get install -y linux-4.4-latest # Will update kernel
$ sudo apt-get install -y rockpi4b-rk-u-boot-latest

Then I installed nano and:
$ sudo nano /boot/hw_intfc.conf

I make sure the file is saved with the following settings:
intfc:uart4=off
intfc:spi1=on
intfc:dtoverlay=spi1-flash

Then I updated bootloader:
$ cd /usr/local/sbin/
$ ls
I see four .sh files listed

$ ./rockpi4b_update_bootloader.sh

Then I reboot, and open the terminal and type:
$ sudo /usr/local/sbin/rockpi4b_write_spi_flash.sh
Then YES and I saw the machine running, writing over blocks of data for a few minutes.
After it’s done I shutdown the Rock Pi, remove the SD card, and connect the nvme that I have the official Debian Stretch.

Then I power on the Rock PI and I see Debian Strech running not very smoothly.

If I put on the nvme the official Armbian based on Buster downloaded from here: https://www.armbian.com/rock-pi-4/
The Rock Pi does NOT boot

If I put on the nvme the Armbian based on Stretch from Radxa, the rock pi does not boot.

This is all I know. If I’m not booting from SPI then I’m booting directly from nvme with deiban strech on? If I’m booting from SPI then why Armbian on nvme is not booting? What did I do wrong trying to flash SPI?

Does this have anything to do with the .sh says Rockpi4b and my board is rock pi 4A?

Thanks!

Nope. The RK3399 can not and will never boot directly from NVMe.

Since Debian boots fine, I think you didn’t do anything wrong.

As for Armbian not booting, I guess the image/partition table/… is somehow fucked up.

@CH430 USB-TTL … make sure it can run at 1.5Mbps.

If you have Linux you can simply use screen to watch the console:

$ screen /dev/ttyUSB0 1500000

You might have to change USB0 to something different, depending on your system.

On connecting the USB-serial adapter to the Rock Pi see: https://wiki.radxa.com/Rock/Serial_debug_tools_Setting

Note: I needed to change the boot command line from console=ttyFIQ0 to console=ttyS2 to get serial output after updating the kernel + u-boot.

Unless you give us new information we won’t be able to help you, other than telling Radxa their images might be broken (which brings you nothing).

1 Like

Hah! Why didn’t you tell me that boot can be debugged by console earlier?=)
Here is my boot log.
https://pastebin.com/QejZ3PZ9
I’ll try to figure out why u-boot cannot load kernel, but maybe you have any ideas?

From your log, everything seems right but reading kernel from nvme failed. I have two questions:

  • Did you connect the SD card or eMMC module?
  • How do you write the image to NVMe?

No, I don’t have emmc and sd card is removed.
I dd’ed system image from sd card to nvme (all the partitions)

Since you already have bootloader in SPI, can you do the following:

  • insert SD card and boot with nvme attached
  • download a fresh stretch desktop or ubuntu minimal image and dd it to nvme
  • remove SD card and boot the fresh image in nvme

Please send the serial console log, we can check if it’s partitions issue.

The same thing.
What I did:
gunzip -c rockpi4b-ubuntu-bionic-minimal-20190104_2101-gpt.img.gz | dd of=/dev/nvme0n1
What I got:
https://pastebin.com/FUA8ngH8

@xxut

Is your disk samsung evo? Is the disk old or very new?

I am very sorry to tell you that, we have the same issue for one of the old samsung evo 960 in the office. Other newer disks works fine with the same image. The samsung evo 960 disk works if we use it as data disk and formats as ext4 partition but there is some blocks corrupted if we do a full disk read/write.

This is something we haven’t found the reason and probably it will not be fixed in short time. I suggest you try another m.2 nvme disk.

Thank you for the info.
It’s brand new Kingston A1000 was bought specially for Rock Pi.

Maybe firmware upgrade will solve this.

I got a Rock Pi 4B with mounted SPI flash, big heatsink and NVMe extension last Saturday (13/July) from ALLNET China. The version printed on the board is 1.3. I followed the steps using uSD card as specified in https://wiki.radxa.com/Rockpi4/Linux_system_runs_on_M.2_NVME_SSD to write the u-boot to SPI flash without success. I simply cannot get the /dev/mtd0 after reboot. I also tried using the https://wiki.radxa.com/Rockpi4/dev/spi-install to write the u-boot image via USB OTG. It seems that the write is successful and I can see a red LED flashing alongside the always lit green LED when I try to boot the Kingston A1000 NVMe without the uSD card. However the boot was not successful. I am using Ubuntu Server for the NVMe image. Does anyone has a chance to successfully boot Ubuntu Server on the NVMe along. Any direction or help is appreciated.

1 Like