RISC-V Adventures, Part 1

2023-01-14systemsrisc-vembeddedvisionfive

Banner

photo from /u/superkoning

Motivation

Back in September, I participated in the VisionFive 2 Kickstarter. This is a SBC boasting one primarily interesting characteristic: it's SoC uses the open source RISC-V instruction set. (As opposed to the very proprietary and very expensive ARM chips. Here's an adequate summary on the topic of ISAs.) It also has an NVMe slot, two NICs, a bunch of USB ports, so it looks like a very capable candidate to port Artix, or rather, it's lesser known embedded spinoff, Armtix for it.

I chipped in for a Super Early Bird edition, and at the top of the week, it finally arrived, so let's do some hacking on it!

Journey

Of course, Mr. Explaining Computers was already on it, so I could see it in action before even unpacking. Apparently there's a Debian engineering release for it, let's see how that runs for us compared to the video.

And this is where the problems started. I downloaded the later version of the Debian image, since they are both back from December, there could not be any fresh problems, right? Wrong.

At this point, I spent half of today on this (calling it a day yesterday), piecing information together from the RVSpace forums, Reddit, Github, and Youtube, since it's nontrivial, I figured I'd document it for posterity.

So, the image doesn't boot. From the video, it's apparent, that the green LED should be flashing in case of success, but mine was not doing anything, only the red power LED, and blinking the NIC LEDs. Looking in the routing table, there is something happening:

1673730583 6c:cf:39:00:<a>:<x> 192.168.1.195 * *
1673730753 6c:cf:39:00:<a>:<y> 192.168.1.194 * *

Searching for 6c:cf:39, apparently these are Apple NICs? That doesn't sound right, but I'm gonna leave it at that for now, because it's not pinging anyway.

ping -c 4 192.168.1.195
PING 192.168.1.195 (192.168.1.195) 56(84) bytes of data.

--- 192.168.1.195 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3032ms

According to several posts, and the release notes this new version of the engineering release Debian won't boot until the bootloader is upgraded...

To do that, there are several options, some of which are a lot easier if there's already a version running, and some which require a UART connection, which turns out, I don't have the hardware available right now, so it's not viable for now. (It will definitely need to be remedied later though)

Going through the instructions, I was stumped again: downloaded the latest sdcard.img, dd-d it on a second microSD, plugged the board in, and nothing.

So let's try running the earlier Debian build. These can be downloaded (for now) here, from a Google Drive or a Baidu mirror, I went for the Google one, assuming it would be faster location-wise. In the folder, there are torrents for both, which is nice.

Flashed the older version on a third card, much to the same result: no signs of life.

At this point, I have tried the Debian Image-69 build, it's minimal version, the Image-55 build, and booting the v2.6.0 image from the VisionFive 2 Github, all configurations of the boot switches (there's 4), both NICs, two HDMI cables and monitors (wasn't really expecting that to make a difference, without the green blink, probably it's stuck way before it gets to the display).

I had a last ditch hunch here: since we are very sensitive to versions, and the guide mentions v2.5.0, not the at the time of writing, only 5 days old 2.6, what if I tried with that one?

Aaaand, we have a winner! Blinking green LED, and network reachability:

ping -c 4 192.168.1.195
PING 192.168.1.195 (192.168.1.195) 56(84) bytes of data.
64 bytes from 192.168.1.195: icmp_seq=1 ttl=64 time=0.776 ms
64 bytes from 192.168.1.195: icmp_seq=2 ttl=64 time=0.411 ms
64 bytes from 192.168.1.195: icmp_seq=3 ttl=64 time=0.406 ms
64 bytes from 192.168.1.195: icmp_seq=4 ttl=64 time=0.406 ms

Now we can start working on it!

ssh -p 22 -l root 192.168.1.195
root@192.168.1.195's password:
#

The password can be found in the QSG document (it's 'starfive'), same for the Debian builds and the flasher builds.

Next time, the actual flashing can start.