Adventures With Allwinner V3s
10 March 2018
Looking for a suitable SbC candidate, my search turned up a few options, each with their own caveats. For example the OSD335x from Octavo Systems, which is quite costly at £40, and while the ball pitch is very forgiving (1.27mm) it is still nonetheless a BGA, which was a higher assembly difficulty compared to, for example, the iMX233.
Another option would be something like the iMX6 PoP (Package-on-Package), which is essentially two BGAs sandwiched together, one being the processor and the other being the SDRAM. This option is also cost prohibitive and is significantly more complex in assembly terms than either of the previous choices.
I also found an interesting little module from Allwinner, the R8M. This is the module found on the original “$9 computer” C.H.I.P SBC, which gained a lot of media attention during its kickstarter campaign in 2015. Really though, I felt like I was “cheating” already by looking for integrated SDRAM, and the R8M felt even more like cheating due to it being a complete module. It is also unfortunately about as available as unicorn poo (at least outside of China).
I had put the project on hold at this point, until about a month ago when I discovered the Allwinner V3s, a 1.2GHz ARM Cortex-A7 with integrated 512Mbit (64M) DDR2 and various peripherals such as ethernet PHY, USB OTG, LCD output, MIPI interface, etc. This SoC is primarily aimed at the dashcam market but it works just as well as a generic Linux system, which can be integrated pretty easily into any project. Plus, it costs just $5 and it’s in a 0.4mm pitch QFP package! Easy!
I purchased by V3s from eBay UK, but it is also available on Aliexpress.
At this point I should mention the LicheePi project, which provided useful insight into how to interface to the V3s, and helped a lot in the design of this board, mostly by mirroring Allwinner’s reference design, which would otherwise not be available to me.
The project files can be downloaded using the button to the right. The following resources are included in the download:
- Assembly documentation
- Bill of Materials
- 3D PDF
As you can tell from the images above, I made a little mistake – UART0 is available on the shared SDC0 interface, and also on the I2C interface; I had connected to the SDC0 interface which is a problem as the system uses this to boot from the microSD card. UART0 is active on the I2C pins at boot time when using unmodified mainline U-Boot.
The nice thing about the V3s and its package is that it is possible to design full featured PCBs for it while adhering to 6/6 thou track/gap and 0.3mm drills, which significantly reduces costs and allows the casual tinkerer to use cheap fab houses with standard manufacturing tolerances. I get my PCBs from PCBWay usually.
I designed this board with 4 layers to provide good power delivery as the V3s requires 4 different supply voltages. I am sure that with more time it would be possible to produce a viable 2 layer design.
So far I have only done basic tests – the board boots successfully from microSD using the LicheePi images, and UARTs work. So far no obvious stability issues.
Next I will be attempting to bring up the ethernet hardware to provide networking support, and hopefully I can start to understand how to configure u-boot and Linux.
I attempted to compile u-boot the other day in fact, and I spent a very long time stuck on one particular error, where it was checking the version of GCC installed was 6.0 or later. I had downloaded Ubuntu 16.04 and ran it in a virtualbox VM, but what I didn’t realise is that it comes with GCC 5.x and no matter what I tried I just couldn’t get GCC 7.x installed. I downloaded the nightly Debian release and installed Linaro ARM toolchain, which enabled me to compile u-boot and also the Linux kernel.
11 March 2018
The USB OTG port is working fine in host mode.
12 March 2018
15 March 2018
I’ve still not managed to get both ethernet and USB working on the same kernel. For some reason the USB does not work in the kernel above, but ethernet does. UPDATE: all peripherals are working thanks to petit-miner on GitHub.