VoCore2: Connect to SPI Screen

Last week I find a SPI screen(480×320+262K Color) in the dust, guess it’s time to make it work 🙂

First of all, read read and read.

Actually I can not find much useful information from the lcd datasheet. The two tables should be enough.

LCD have three parts: a driver chip, which is ILI9488; a TFT display, mine is 480×320; backlight, normally is several white LEDs, mine LCD has six of them.

LED- & LED+ the two pins are used to drive white LEDs, drive one LED voltage is 2.5V~3V, six of them in serial will take 15~18V, we will need a boost dcdc chip to reach that voltage, convert 3.3V input to 18V, for simple, just copy and paste the typical sch of the dcdc to my sch).
VCI(2.8V) is the input power for LCD, max allowed voltage is 3.3V, but better to use a small resistor to lower the input voltage to avoid power peak damage the drive chip.
NCS/SDA/SCL is the standard 3-wires SPI interface, we should rename them to SPI CS, SPI DAT, SPI CLK. SPI DAT is for data input and output.

Here is a tricky part, VoCore2 is using 4-wires SPI, which requires four pins: SPI CS, SPI MOSI, SPI MISO, SPI CLK. We must combine SPI MOSI, SPI MISO to SPI DAT, but MISO & MOSI will crosstalk to each other. To lower the crosstalk, we can use a resistor between them.

now I get the final sch:

LCD screen power consume is around 400mW ==> 18V(20mA), and VoCore2 3.3V power output is 200mA~300mA(3.3V 600mW), should be enough.

PCB Layout, two layers, super small, only 0.75×1.34cm, put at top left of vocore2 border 🙂

PS: now the PCB is making in factory, I will get them next week.

You see? Develop hardware is not that hard. 🙂

Tutorial: Use LuCI to make VoCore2 connect to the computer/router via Ethernet

Let’s introduce an easy way to setup VoCore2 with ethernet connection today.

I will use LuCI interface who is very good at this.

Hardware part, let’s use VoCore2 Ultimate as an example —- Ultimate version have an ethernet port which is exported Port 0 on VoCore2.


First settings, connect VoCore2 to a router(this router connected to Internet):

Open LuCI, select Network -> Switch -> Select the settings as following picture, then “Save & Apply”

In this mode, normally we use VoCore2 as a wireless AP hotspot, internet from your router through ethernet to VoCore2, and your computer could directly connect to VoCore2 AP hotspot to connect to internet. VoCore2 will enhance your wired network to wireless, just like other wireless router. Once the ethernet connection is working, you can connect to VoCore2 by its IP address, and if you enable samba service on VoCore2, all your computerin the same router will able to access to the files on VoCore2 shared folder.

A nice example is the VoCore2 PoE version, all we need to do is connect it to a PoE router, then near around your VoCore, fast and stable hotspot appears. For online game player, a well signal hotspot means stable internet and win 🙂

Also you can directly connect to your Internet Provider, VoCore2 has PPPoE protocol.

Details please check OpenWRT tutorial(https://wiki.openwrt.org/doc/uci/network, https://wiki.openwrt.org/doc/uci/network/switch).


Second settings, connect VoCore2 to a computer directly.

Open LuCI, select Network -> Switch -> Select the settings as following picture, then “Save & Apply”

In this mode, normally we use it to debug VoCore2 when VoCore2 wifi is disabled. Connected computer will get a IP from VoCore2, such as

Some people use this setting as “wireless network to wired network converter”. That needs to use VoCore2 in STA mode(VoCore2 connect to other wireless hotspot then get internet access from it. Please check my youtube video about how to setup VoCore2 in to STA mode), then connect computer to VoCore2 ethernet port by cable.

PS: I do not know why they do this 🙂 Maybe their computers do not have a wireless adaptor on mainboard but have a ethernet port.

Normally I use this mode to debug VoCore2, ethernet is fast and stable, allow me use gdb/gdbserver debug app in real time. When you debug/study wifi driver, ethernet is a good choice too, forget the slow serial console 🙂

VoCore2: Hack the Wifi

Now, open the mystery wifi driver package, we will find two folders, one is build, another is src.

build folder contains two files, one is Kconfig and another is Makefile. The two are standard Linux kernel compile makefile, Kconfig normally used to embed itself to menuconfig and Makefile is used to tell linux compiler which files are necessary to compile the final model(mt7628.ko). More details about Kconfig and Makefile, you can check linux kernel documentation or buy a linux kernel beginner book 🙂

Let’s open Kconfig check what it support:

AP_SUPPORT: emm, I think it is the base function support for wifi AP.
WDS_SUPPORT: WDS, I do not need this, not making a router.
MBSS_SUPPORT: Its full name is MBSSID, ignore, just use default setting. 🙂 I guess this is something related to SSID.
APCLI_SUPPORT: AP + CLIENT mode, absolutely need this.
MAC_REPEATER_SUPPORT,CON_WPS_SUPPORT: …emm, not using yet, use default.
LLTD_SUPPORT: it says “Link Layer Topology Discovery Protocol”, link here: https://en.wikipedia.org/wiki/Link_Layer_Topology_Discovery
AIRPLAY_SUPPORT: not use at all.

Fix Totally bricked VoCore2 by another VoCore2

Finally I have a chance to write this tutorial. I want use this blog to show you a simple way to fix a totally bricked VoCore2 or uboot dead VoCore2.

This is the principle, we are using a SPI flash, so we should fix it using SPI interface.

wire 5 is important, that keep bricked vocore2 flash in “dead” status.


Normal VoCore2 ==== Bricked VoCore2
1. +3.3V     ======== +3.3V
2. SPI CS1   ======== SPI CS0
3. SPI MOSI  ======== SPI MOSI
4. SPI MISO  ======== SPI MISO
5. GND       ======== PORST(RESET)
6. SPI CLK   ======== SPI CLK
7. GND       ======== GND


You will need the following items to do this:

  1. 1x working VoCore2(Normal VoCore2).
  2. 7x wires.


Compile a firmware with second spi flash.
Update ~/openwrt/target/linux/ramips/dts/VOCORE2.dts palmbus section to enable second SPI flash.
A sample of my DTS and compiled firmware: http://vonger.cn/misc/vocore2/vocore2.fixbrick.zip

Upgrade your working VoCore2 with the new firmware.

Connect every wire.

Here is my connection:


If everything correct, you will find the second SPI flash from normal VoCore2 once it boot up:

[    0.280000] spi-mt7621 10000b00.spi: sys_freq: 193333333
[    0.290000] m25p80 spi32766.0: found w25q128, expected en25q64
[    0.300000] m25p80 spi32766.0: w25q128 (16384 Kbytes)
[    0.300000] m25p80 spi32766.0: using chunked io
[    0.310000] 4 ofpart partitions found on MTD device spi32766.0
[    0.320000] Creating 4 MTD partitions on "spi32766.0":
[    0.320000] 0x000000000000-0x000000030000 : "u-boot"
[    0.330000] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.330000] 0x000000040000-0x000000050000 : "factory"
[    0.340000] 0x000000050000-0x000000800000 : "firmware"
[    0.380000] 2 uimage-fw partitions found on MTD device firmware
[    0.380000] 0x000000050000-0x0000001682fe : "kernel"
[    0.390000] 0x0000001682fe-0x000000800000 : "rootfs"
[    0.390000] mtd: device 5 (rootfs) set to be root filesystem
[    0.400000] 1 squashfs-split partitions found on MTD device rootfs
[    0.410000] 0x0000006c0000-0x000000800000 : "rootfs_data"
[    0.420000] m25p80 spi32766.1: found gd25q64, expected en25q64
[    0.420000] m25p80 spi32766.1: gd25q64 (8192 Kbytes)
[    0.430000] m25p80 spi32766.1: using chunked io
[    0.430000] 1 ofpart partitions found on MTD device spi32766.1
[    0.440000] Creating 1 MTD partitions on "spi32766.1":
[    0.440000] 0x000000000000-0x000001000000 : "attached"
[    0.450000] mtd: partition "attached" extends beyond the end of device "spi32766.1" -- size truncated to 0x800000
[    0.470000] ralink_soc_eth 10100000.ethernet: generated random MAC address 3a:20:00:a8:c9:ce
[    0.480000] ralink_soc_eth 10100000.ethernet eth0: ralink at 0xb0100000, irq 5

I rename the second flash to “attached”, yours might slightly different, my second flash is VoCore2 Lite 8MB flash, so it shows “size truncated to 0x800000”, this is not a big issue, just ignore it.

Download flash image from http://vonger.cn/misc/vocore2/ultimate.16m.img, this is for VoCore2(not lite), or you can download and compile uboot from github.com/vonger/, write uboot to it and use uboot to load other data.

Using scp or other file upload tool copy the image to the normal VoCore2 memory(/tmp/).

Now we can call “mtd -e attached write /tmp/ultimate.16m.img attached”, this command is used to erase all data in the bricked VoCore2 flash, and write the new image to it. After this is done, you can disconnect your bricked VoCore2, and connect it to power, it should work normal.

Note: after the flash, your factory setting will be erase too. Before you call mtd erase the flash, first you could call “cp /dev/mtd7 /tmp/mtd7 and download mtd7 to your local disk as a backup of the hole flash, then later you can copy factory setting out of mtd7 from its partition(factory: partition@40000, size 0x10000).

If you find any issue or blocked at any part of the blog, please leave a message in comment, I will fix it in time. 🙂

Update May.20: download the image from vocore.io is not necessary. We can cat /proc/mtd in normal vocore2

dev:    size   erasesize  name
mtd0: 01000000 00010000 "ALL"
mtd1: 00030000 00010000 "Bootloader"
mtd2: 00010000 00010000 "Config"
mtd3: 00010000 00010000 "Factory"
mtd4: 00fb0000 00010000 "firmware"
mtd5: 00e73d2d 00010000 "rootfs"
mtd6: 00c50000 00010000 "rootfs_data"

find “All” is mtd0, this image is working, so we can use “cp /dev/mtd0 /tmp/mtd0”, then use “mtd -e attached write /tmp/mtd0 attached” to clone the flash. At this point, must notify the image size better not exceed the flash size, or might cause boot fail.

VoCore2: Hack the Driver

Current VoCore2 default are using a blob wifi driver from link-it. So it is not very stable sometimes. Recently I just find MTK OPENWRT source code online and find there is an open-sourced wifi driver just in the dl folder, which is tested to be very stable. 🙂 Wahaha, let start the hack!!

Here is the clone of the source:  http://vonger.cn/misc/vocore2/mt7628-p4rev-113862.tar.bz2 (I find it by searching baidu(link here: http://www.openwrtdl.com/wordpress/mt76xx-p4rev%E7%B3%BB%E5%88%97%E4%B8%8B%E8%BD%BD), do not know wether or not ralink intent to public this, if not, please email to support@vocore.io. I will delete it. This source is only for study. )

I will spend hours on this driver everyday, and will show what I find on my blog. :p

Fix VoCore2 LuCI no WPA Issue


Everything works, just add two lines to file: /usr/lib/lua/luci/model/cbi/admin_network/wifi.lua

+encr:value("psk", translate("WPA PSK"), {mode="ap"}, {mode="sta"})
+encr:value("psk2", translate("WPA2 PSK"), {mode="ap"}, {mode="sta"})


Here is the patch:

--- a/usr/lib/lua/luci/model/cbi/admin_network/wifi.lua
+++ b/usr/lib/lua/luci/model/cbi/admin_network/wifi.lua 

@@ -689,6 +689,8 @@
encr:value("none", "No Encryption")
encr:value("wep-open", translate("WEP Open System"), {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"}, {mode="adhoc"}, {mode="ahdemo"}, {mode="wds"})
encr:value("wep-shared", translate("WEP Shared Key"), {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"}, {mode="adhoc"}, {mode="ahdemo"}, {mode="wds"})
+encr:value("psk", translate("WPA PSK"), {mode="ap"}, {mode="sta"})
+encr:value("psk2", translate("WPA2 PSK"), {mode="ap"}, {mode="sta"})

if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then
local supplicant = fs.access("/usr/sbin/wpa_supplicant")


I will add this patch to later firmware at Apr 🙂

Lite: Shipping…

Just in short, we are shipping them 😉

Once it is online(around next Monday), please trace it at bottom of vocore.io by your email.

PoE Version Ready

Finally find the problem, it is simple and stupid, I place an electrolytic capacitor at wrong direction… 🙂

Continue do more test…Hopefully tomorrow I will get good result.

PS: we contacted the factory about the lite version, sadly, they find the sample is not work, reason is simple,  crystal and a capacitor are short circuit, have to delay two days.

VoCore2: Process..

Good news is VoCore2 Lite batch almost done 🙂 The factory will start test them tomorrow,  and we can ship all of them in this month.

Bad news is I get a lot of trouble when develop the PoE version… The heat, the strong EMC all solved but still something wrong.. Just feel like back to the noob time. :'(

I know, you know, everybody knows, as a developer,  we always have couple of days every month — everywhere is a dead end…

Hope this pass soooon…

This is also why I love this job.

can not write anymore…work, work 🙂