VIM3 - boot without eMMC

Hello,
I wonder if it’s possible to boot only with NVME, without eMMC and SD card?
I spent some time to burn right image on NVME as well as SPI. It works as it should when sd card is present in slot (may be blank card), seems that first stage loader needs either sd card or eMMC :confused: Anything I can do about that?

UART shows this debug line:

G12B:BL:6e7c85:2a3b91;FEAT:E0F83180:402000;POC:B;RCY:0;SPINOR:0;CHK:1F;EMMC:800;NAND:81;SD?:0;SD:0;READ:0;0.

(one of my VIM3 has broken eMMC)

I had this issue on a new VIM3, among other things. One would think an OS on eMMC will cause a successful POST without an sdcard inserted. I ended up sending it back for refund, as nothing I tried could circumvent it and no Docs found, it had other stuff not functioning as described.

Edit: mine would not power on, without sdcard inserted.

Hello @dominik

As the U-Boot doesn’t support NVMe, so only rootfs can be in the NVMe SSD and the u-boot
& kernel should in SD or eMMC.

Same thing here, It’s not even trying to boot without sd card, as soon as I insert that - it’s loading.

What about SPI? I think I updated this one with version that supports booting from nvme.

Hi Nick, I had copied uboot to eMMC in one of my many installation attempts and still, the VIM3 would not power on, unless an sdcard was inserted. Surely the VIM can discern between what to boot from? And it needs an sdcard to come to life? Thats just odd.

1 Like

Which uboot you used support the NVMe ?

Could you tell us which image you used?

probably the only 2 that worked, Coreelec and Volomio (that froze at gui), I was trying everything after pulling my hair out for 9 hours trying to figure out why this sbc is so hard to get up and functioning. The forums weren’t a lot of help, nor the documentation. It seems this project is trying to go in 3 directions and no direction. I can’t help but remain curious about the product, but for all the hassle, I’ll move onto setting up a Pi with HATs and evaluate the Libre Le Potato, that has onboard i2s and ADC on mainboard. Might just buy a retail Tone2, those cases are pretty dope and I like the balanced rca innovation.

I’m beginning to think my problems were a combo of flaky internet and a faulty board. I’ve been in the IT industry from 1988 to 2014, using Linux since 2006 and I never had this much ‘issue’ setting up a computer.

I just made several tests,

As I mentioned earlier my board don’t have eMMC - it was faulty and non functioning, so the only thing that is left for me is sd card.

Board start to look for it in loop,

G12B:BL:6e7c85:2a3b91;FEAT:E0F83180:402000;POC:B;RCY:0;
SPINOR:0;CHK:1F;EMMC:800;NAND:81;SD?:20000;USB:8;LOOP:1;
SPINOR:0;CHK:1F;EMMC:800;NAND:81;SD?:20000;USB:8;LOOP:2;
SPINOR:0;CHK:1F;EMMC:800;NAND:81;SD?:0;SD:0;READ:0;0.

On last line sd card was inserted and it begin to boot, interestingly it looks for something at sd card, when I added fresh, blank card it did not detected that, was still at bootloop.

Here is boot process:

bl2_stage_init 0x01
bl2_stage_init 0x81
hw id: 0x0000 - pwm id 0x01
bl2_stage_init 0xc1
bl2_stage_init 0x02

no sdio debug board detected
L0:00000000
L1:20000703
L2:00008067
L3:14000000
B2:00402000
B1:e0f83180

TE: 10399510

BL2 Built : 13:12:17, Sep 21 2023. g12b amlogic-dev g34b3d81e-dirty - bichao.zheng@rd02-sz

Board ID = 8
Set A53 clk to 24M
Set A73 clk to 24M
Set clk81 to 24M
A53 clk: 1200 MHz
A73 clk: 1200 MHz
CLK81: 166.6M
smccc: 009efe26
storage init finish
board id: 8
Load FIP HDR DDR from SD, src: 0x00010200, des: 0xfffd0000, size: 0x00004000, part: 0
Get wrong ddr fw magic! Error!!
fw parse done
PIEI prepare done
fastboot data verify
result: 255
Cfg max: 12, cur: 1. Board id: 255. Force loop cfg
LPDDR4 probe

LPDDR4_PHY_V_0_1_22-Built : 14:57:26, Sep 1 2020. g12b g3c95fed - gongwei.chen@droid11-sz
ddr clk to 1608MHz

dmc_version 0001
Check phy result
INFO : ERROR : Training has failed!
Check phy result
INFO : ERROR : Training has failed!
Check phy result
INFO : End of initialization
INFO : ERROR : Training has failed!
1D training failed
Cfg max: 12, cur: 2. Board id: 255. Force loop cfg
LPDDR4 probe
ddr clk to 1608MHz

dmc_version 0001
Check phy result
INFO : End of CA training
INFO : End of initialization
INFO : Training has run successfully!
Check phy result
INFO : End of initialization
INFO : End of read enable training
INFO : End of fine write leveling
INFO : End of read dq deskew training
INFO : End of MPR read delay center optimization
INFO : End of Write leveling coarse delay
INFO : End of read delay center optimization
INFO : Training has run successfully!
Check phy result
INFO : End of initialization
INFO : End of MPR read delay center optimization
INFO : End of write delay center optimization
INFO : End of read delay center optimization
INFO : End of max read latency training
INFO : Training has run successfully!
1D training succeed
Check phy result
INFO : End of initialization
INFO : End of 2D read delay Voltage center optimization
INFO : End of 2D read delay Voltage center optimization
INFO : End of 2D write delay Voltage center optimization
INFO : End of 2D write delay Voltage center optimization
INFO : Training has run successfully!

soc_vref_reg_value 0x 00000025 00000023 00000026 00000025 00000027 00000024 00000022 00000024 00000023 00000025 00000028 00000023 00000025 00000026 00000026 00000026 00000025 00000024 00000025 00000027 00000024 00000025 00000024 00000024 00000024 00000025 00000024 00000027 00000026 00000026 00000026 00000026 dwc_ddrphy_apb_wr((0<<20)|(2<<16)|(0<<12)|(0xb0):0004
dram_vref_reg_value 0x 00000015
2D training succeed
auto size-- 65535DDR cs0 size: 2048MB
DDR cs1 size: 0MB
DMC_DDR_CTRL: 00c0002cDDR size: 2048MB
cs0 DataBus test pass
cs0 AddrBus test pass

non-sec scramble use zero key
ddr scramble enabled

100bdlr_step_size ps== 414
result report
boot times 0Enable ddr reg access
Load FIP HDR from SD, src: 0x00010200, des: 0x01700000, size: 0x00004000, part: 0
Load BL3X from SD, src: 0x00078200, des: 0x01768000, size: 0x000afe00, part: 0
0.0;M3 CHK:0;cm4_sp_mode 0

MVN_1=0x00000000

MVN_2=0x00000000

[Image: g12b_v1.1.3390-6ac5299 2019-09-26 14:10:05 luan.yuan@droid15-sz]

OPS=0x10

ring efuse init

chipver efuse init

29 0b 10 00 01 1e 0a 00 00 16 31 34 32 58 33 50

[11.227182 Inits done]

secure task start!
high task start!
low task start!
run into bl31
NOTICE: BL31: v1.3(release):4fc40b1
NOTICE: BL31: Built : 15:58:17, May 22 2019
NOTICE: BL31: G12A normal boot!
NOTICE: BL31: BL33 decompress pass
ERROR: Error initializing runtime service opteed_fast

<debug_uart>
serial_meson serial@3000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19

I can’t see any information here from where and what was loaded. “Only Load FIP HDR from SD”, what is that?

This test was performed with owoow sd card, so I don’t expect anything related to armbian, but clearly armbian u-boot is loaded:

U-Boot 2024.01-armbian (Feb 09 2024 - 18:56:35 +0000) khadas-vim3

Model: Khadas VIM3
SoC: Amlogic Meson G12B (A311D) Revision 29:b (10:2)
DRAM: 2 GiB
Core: 410 devices, 36 uclasses, devicetree: separate
MMC: sd@ffe03000: 0, sd@ffe05000: 1, mmc@ffe07000: 2
Loading Environment from nowhere… OK
In: usbkbd,serial
Out: vidconsole,serial
Err: vidconsole,serial
Net: dwmac_meson8b ethernet@ff3f0000: Can’t get reset: -2
eth0: ethernet@ff3f0000
Hit any key to stop autoboot: 2 1 0
starting USB…
Bus usb@ff500000: Register 3000140 NbrPorts 3
Starting the controller
USB XHCI 1.10
scanning bus usb@ff500000 for devices… Device not responding to set address.

  USB device not accepting new address (error=80000000)

2 USB Device(s) found
scanning usb for storage devices… 0 Storage Device(s) found

Device 0: unknown device
PCIE-0: Link up (Gen2-x1, Bus0)

Device 0: Vendor: 0x1e0f Rev: 10410106 Prod: 11PPHG1EQL42
Type: Hard Disk
Capacity: 244198.3 MB = 238.4 GB (500118192 x 512)
… is now current device
Scanning nvme 0:1…
Found U-Boot script /boot/boot.scr
8133 bytes read in 1 ms (7.8 MiB/s)

Executing script at 08000000

U-boot default fdtfile: amlogic/meson-g12b-a311d-khadas-vim3.dtb
Current variant:
210 bytes read in 1 ms (205.1 KiB/s)
Current fdtfile after armbianEnv: amlogic/meson-g12b-a311d-khadas-vim3.dtb
Mainline bootargs: root=UUID=d4fea092-1584-4cce-9e11-18ce67350d97 rootwait rootfstype=ext4 splash=verbose console=ttyAML0,115200 console=tty1 consoleblank=0 coherent_pool=2M loglevel=1 ubootpart= libata.force=noncq usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u cgroup_enable=memory
22979001 bytes read in 61 ms (359.3 MiB/s)
27431424 bytes read in 73 ms (358.4 MiB/s)
79399 bytes read in 2 ms (37.9 MiB/s)
Working FDT set to 4080000
232 bytes read in 1 ms (226.6 KiB/s)
Applying kernel provided DT fixup script (meson-fixup.scr)

Executing script at 32000000

Loading init Ramdisk from Legacy Image at 13000000 …

Image Name: uInitrd
Image Type: AArch64 Linux RAMDisk Image (gzip compressed)
Data Size: 22978937 Bytes = 21.9 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum … OK

Flattened Device Tree blob at 04080000

Booting using the fdt blob at 0x4080000
Working FDT set to 4080000
Loading Ramdisk to 79911000, end 7aefb179 … OK
Loading Device Tree to 0000000079895000, end 0000000079910fff … OK
Working FDT set to 79895000
vim3: successfully enabled PCIe

Starting kernel …

done.

Begin: Mounting root file system … Begin: Running /scripts/local-top … done.

Begin: Running /scripts/local-premount … Scanning for Btrfs filesystems

done.

Begin: Will now check root file system … fsck from util-linux 2.38.1

[/sbin/fsck.ext4 (1) – /dev/nvme0n1p1] fsck.ext4 -a -C0 /dev/nvme0n1p1

armbi_root: clean, 47442/15263120 files, 1458492/61885440 blocks

done.

done.

Begin: Running /scripts/local-bottom … done.

Begin: Running /scripts/init-bottom … done.

Welcome to Armbian 24.8.3 bookworm!

Here I’m sure it’s booting from nvme at this point.

My guess is that at start it looks for something from sd (maybe eMMC - I can’t know) and will not boot until those are accessible and filled with some data. When I remove card quickly it’s makes immediately reset and loops again.

There have to be something needed on sd/emmc to pass first stage, but u-boot probably comes from spi now and have no problem to boot system from nvme. This may be some protection?
Right now I can burn any vim image and it will boot armbian from nvme. I tried owoow, and few other things, they seems to not change anything except triggering first stage.

I’m sure that nothing can’t be read from eMMC now.

Mine is in loop, checking for card (or maybe eMMC). Of course I got two other VIM3 (with good eMMC) so they boot just from eMMC without sdcard. I guess empty or filled with wrong structure eMMC will do the same.

According to logs its: U-Boot 2024.01-armbian (Feb 09 2024 - 18:56:35 +0000) khadas-vim3

From this log it means the u-boot is loaded from the SD card.

Yes, current mainline u-boot (2024.01) support the NVMe devices, so it is possible to boot from the NVMe SSD with only: SPI (U-Boot) + NVMe (kernel & rootfs), we will check and release new image about this feature on mainline kernel.

One thing does not fot for me - do You ship this u-boot (marked as -armbian) inside owoow too?
Or can we load two u-boots?
I assumed that something is preventing from start, until I inser sd card. Then with Your image I have armbian build of uboot (therefore I think this one is loaded).

For now it won’t even try to boot, sd check is performed on the loop at top. Before memory training and all init.
This is first stage loader? Is that also needed to upgrade?

And what is this debug line: SPINOR:0 ?

I expect that I managed to fill SPI with second stage loader (armbian-uboot). This line confuses me a bit, does he try to load something from there and fails? I can only see now change in loop interation and SD value.

oowow has its own u-boot and already support NVMe SSD, but we can’t use it to boot the mainline images we released, we will fix it in next mainline release.

Please check the boot sequence with kbi on u-boot cmdline.

kvim3#kbi bootmode r
bootmode: emmc

The defaut boot mode should be emmc if you haven’t changed it.

  • emmc - boot sequence: eMMC → SD
  • spi - boot sequence: SPI → eMMC → SD

Ok, should that u-boot write down his version anywhere? If it’s really booting from sd card then why it’s -armbian in header?

Bootmode is spi, as I mentioned I’m trying to boot with only spi → nvme.

Which image you used? You use VIM3 oowow image?

Yes, this is possiable, we will provide solution on next release.

I burned sd card with owoow to setup the board, to be sure about those two needed settings (bootmode and pcie mode).
Of course I could not burn any eMMC with it, I was playing for some time with armbian scripts (they throw errors at start), so I needed to manually update spi (with the one from armbian).
Then just removed card and nvme, burned armbian image to second one and tried to boot, board could not start, was not even trying to launch. When I insert yet again sd card with owoow vim3 started armbian from nvme.

So you write the armbian u-boot to SPI flash? How you write it ?

Please provide the full log with NVMe & SD card removed.

Don’t remember right now, probably something like:

$ spi_update < armbian-u-boot.spi.bin
$ kbi bootmode spi
$ kbi poweroff

or something like:

sudo dd if=armbian-u-boot.spi.bin of=/dev/mtdblock0

Also I think that I checked md5sums,

It was already added, something like this:

G12B:BL:6e7c85:2a3b91;FEAT:E0F83180:402000;POC:B;RCY:0;
SPINOR:0;CHK:1F;EMMC:800;NAND:81;SD?:20000;USB:8;LOOP:1;
SPINOR:0;CHK:1F;EMMC:800;NAND:81;SD?:20000;USB:8;LOOP:2;
SPINOR:0;CHK:1F;EMMC:800;NAND:81;SD?:20000;USB:8;LOOP:3;
SPINOR:0;CHK:1F;EMMC:800;NAND:81;SD?:20000;USB:8;LOOP:4;
SPINOR:0;CHK:1F;EMMC:800;NAND:81;SD?:20000;USB:8;LOOP:5;

This is loop, sleep for some time after each “line” (I added newlines to have it more readable)

When I insert that owoow card it detects change and boots:

SPINOR:0;CHK:1F;EMMC:800;NAND:81;SD?:0;SD:0;READ:0;0.

At this stage card is in slot, when I quickly remove it then it will echo “reset”, brake boot process and restart to mentioned loop. Seems like some protection.