[Khadas WiP] VIM4 NVMe IO Errors

I would believe the USB3/PCIe IP blocks in A311D2 are the same as before. Amlogic had only USB Hi-Speed (USB2) prior to the G12B/SM1 families but starting with S922X/A311D/S905X3/S905D3/ S905Y3 there was this single PCIe Gen2 lane pinmuxed with USB3. Since I/O is zero priority for Amlogic (STB / TV boxes) most probably it’s still the same controllers in T7 (A311D2).

As such hopefully Khadas guys are busy bisecting stuff (comparing what changed between Amlogic’s 4.9 and 5.4 BSP kernel) and if it’s the same PCIe controller (licensed from Synopsys as everyone else does) then chances are good that there will be a fix making NVMe eventually usable.

As for help from Amlogic: another board maker told me recently that there’s ‘no such thing as Amlogic support’ if you’re an SBC vendor only selling tens of thousands of SoCs. Which makes perfectly sense since why should Amlogic waste resources? But Khadas might be in a way better position since they’re doing reference implementations for Android!

We’re not talking about upstream mainline kernel here. With mainline and ARM SoCs unfortunately there’s one eternal rule: ‘Software support is only ready once the hardware is (close to) obsolete’. Since the whole upstreaming process is somehow broken.

Even slight changes like adding support for an USB controller can take months. For details search the web for ‘apritzel one image to rule them all’ or directly click here.

Ask @chewitt for details about Amlogic since due to my focus on use cases Amlogic is not on my list.

And for the Armbian advertisement placed here in the meantime: nope, that’s BS. Armbian today is only about repackaging the work of others. And those mainlining Amlogic SoCs aren’t part of Armbian (though Oleg – called ‘Balbes’ by someone – did a great job easing booting and consolidating kernel stuff).

Maybe the closest relationship of those guys doing the real work with upstreaming Amlogic SoCs with Armbian was fellow Martin Blumenstingl coming even to my flat years ago to buy an ODROID-C1+ from this idiot being me since back at that time I was still part of ‘team Armbian’ and didn’t know who he was. I charged him maybe 30 bucks for the board instead of donating it to Amlogic community and adding few hundred bucks on top :frowning:

BULLSHIT, c0rnelious.

So I guess in the meantime we just need to wait… For the moment I guess my VIM4 will be shelfed as the NVMe was the big selling point for me as I wanted to have considerably better file storage than any RPI could have (and faster performance obviously)… We’ve already worn out an RPI microSD card within a year and expect that will continue, which is why I was wanting to switch to the VIM4. Perhaps I’ll see if there’s a USB <—> NVMe enclosure of some sort that I can use in the meantime with better stability than the NVMe has right now at this very moment.

I am still believing that Khadas will try their best to weed through things to get the NVMe natively working — but it will take time.

I’ve got a FIDECO M.2 NVME SATA SSD Enclosure, PCIe USB 3.1, Gen2 SSD Adapter.

It works on every device I have but the VIM4 doesn’t even see it. I don’t think it is a power issue because the VIM4 works fine with a 1TB 2.5" SSD in a USB3 caddy.

Have you considered using some sort of USB drive on the RPi as a stop gap? I’ve got two RPi4s that have been running as web servers with SQL backends 247/365 for a couple of years on small HDDs in USB3 caddies.

Thanks for the suggestion… For me I’d honestly like something a bit faster than the RPI I’ve got… I did read a review on Amazon today regarding these enclosures — the writer was saying that it really depends on what the chipset is that is used to interface with the NVMe module … that there are 3 top chipsets to look for — the mainstream makers. Those you’re more likely to have less trouble with than the smaller fish. Perhaps that enclosure you’ve got is one of the smaller fish brands?

I ordered an enclosure this afternoon from Amazon… we’ll see if it works or not on the VIM4… If not then it’ll get returned.

I’ll admit that if Khadas fixed the WI-FI issue (causing laggy ssh and other issues) and this NVMe issue I’d be pretty happy with the VIM4… I’m not looking to do anything esoteric or anything — just a nice speedy SBC that can interface with some decent sized storage drives whether SSD or otherwise.

Likewise.

I was a bit concerned by what @tkaiser said about Amlogic’s poor I/O though, and am rather disappointed by the throughput, especially when reading and writing NTFS.

Once the device takes up its intended roles as a replacement for some of my RPis, that won’t be such an issue.

Since the A311D2 chipset will have no upstream support anytime soon I stopped looking into the BSP codebase (and work has been busy) so I’m not 100% sure, but I believe the USB IP in the A311D2 is new (home-grown) and not the same licensed IP block as previous generations, so needs an all-new driver alongside HDMI.

Thanks for that @chewitt. Hopefully the people at khadas are making progress.

I hope so too… I might have to suck it up and keep running the RPI4b for a while longer while these issues get ironed out. :pensive::pensive::pensive:.

1 Like

How is the failure induced?

I have been trying to break mine and its not happening using stress-ng --hdd testing.

What is the configuration and OS.
Testing here is jammy-server

Will be live testing our VIM4 soon and it would be nice to break it before we start testing.

I can’t speak for others but for mine I installed PhotoPrism on Ubuntu 22.04 Server and using the WebDAV feature copied about 30Gb of photos over the network from my laptop to the WebDAV folder and that was enough – the WebDAV folder was residing on the ext4fs partition on the NVMe board. Pretty vanilla in my case…

I will try moving a few directories of .jpg and see if that does any thing.

Is yours on the m2 connector or using a USB adapter to nvme?

How is yours configured, mine has OS in emmc and use mounted partitions for the critical files.

Initially on the M2… but the other day I bought a no-name USB enclosure and it regularly disconnects from USB on the Khadas (mentioned in another thread here) – which made it just as bad… The drive didn’t get corrupted but just would drop off the USB bus… Making it, in my case, impossible to add a big drive to the VIM4… I’ve moved it over to an RPI4b using the USB enclosure and it’s working ok there – but it’s a more mature platform certainly - albeit much slower unfortunately.

Agree with you on the pi4, we dropped those a while back. Several issues, the nasty one was it did not play well with the USB adapters going to SSD. It does run VERY well directly from SD card. Odd thing is all those adapters that did not work on the pi4 are working fine on the vim1. Have not tried any of those adapters on the vim3 or 4 since they have been on nvme from day 1.

Maybe I got a good one for the RPI4b… it seems to be working ok – I’ve got about 10Gb of photos being transferred right now and so far so good… I have two SSDs that I tried in the VIM4 and both got messed up pretty good which required reformatting to fix… I’ll just be patient for now… Thanks!

1 Like

The NVMe drives I have used to be seen when installed in my USB3 adapter but nothing would read or write properly. Since upgrading Ubuntu to the latest version, they aren’t even seen in my USB adapter anymore.

I’ve tried to do image backups of the eMMC to the NVMe drive using dd with them plugged into the board and it usually craps out after a while. How long it takes to fail depends on whether the drive is formatted as ext4 or NTFS but either way whatever is written or read is corrupted and unusable.

The NVMe drives also disappear from the system and won’t come back until I reboot.

Do you have a heatsink on the nvme? Only say this because the bracket that holds the actual heatsink onto the board was shorting a couple of components close to the header. I cut off the front part of the mounting bracket and on some used a piece of insulation on the bottom.

Try building jammy 22.04.01>server>emmc and install with oowow. That is what is working very well so far. Be sure to git pull in fenix before starting out. That will at least let you test the hardware for functionality and if it checks out go back to desktop install.

Next time nvme stops working go to a terminal:

$ blkid -o list

No heatsink on my NVMe as the VIM isn’t in a case and the drive sticks out of the side into fresh air.

The drives work perfectly without a heatsink on everything else either in the USB caddy or plugged onto a Motherboard.

Might try server as the VIM isn’t being used for anything yet due to all these issues.

Honestly, I’d done all of the above, building Fenix, insulating the M2X, assuring the heatsink was both attached and non-interfering, monitoring sufficient board voltaage. I went through 3 successive updates of Fenix build.

The NVMe SSD problems were persistent, if not consistent in effect. Spontaneous reboots, corrupted files and metadata - and often irretrievable filesystems. Corruption issues were usually coupled with the mounted filesystem reverting to read-only, only to be resolved by reboots and not remounts. I found that this is independent of filesystem, be it ext4, btrfs, or even vFAT in desperate experimentation.

blkid never misses seeing the drive, in any of these cases.

I use the same NVMe SSD with almost careless ease on VIM3 Pro, and Rockchip boards from Radxa and Firefly. At this stage, I would say that the VIM4 instability for NVMe SSD is unique and exceptional — not a subject of user inexperience or lacking knowledge.

Without a verified vendor fix, it encourages false hope and wasted hours effort to get these devices to an elusive working state!

— Jeremiah

Hello Guys,

Sorry the troubles.

We are still working on this issue, and has some positive improgress for some model of SSDs, but still have some issues, will keep update here.

4 Likes