Author Archives: vonger

VoCore2: Compile Official UBOOT

To make your customized official uboot or our standard uboot, it requires two steps.

  1. Download latest uboot source code from https://github.com/u-boot/u-boot/tags, normally I choose the stable version who is not end with rc.
  2. Use our config file from https://github.com/Vonger/vocore2/blob/master/uboot/vocore2_defconfig, replace u-boot-2023.04/configs/vocore2_defconfig, then you can use make menuconfig to choose the option you want.

optional: for simple, after replace vocore2_defconfig, you can directly call make vocore2_defconfig, then call CROSS_COMPILE=mipsel-openwrt-linux- make, it will generate uboot by the default config.

PS: new version uboot compile size over 192KB, need to reduce…unselect Network Support it works. And customize uboot has some risk to brick your VoCore, better to have at least two VoCore or SPI flash loader to unbrick it if anything goes wrong. Check here vocore.io/v2.html, Unbrick VoCore2 part.

VoCore2: Official UBOOT Upgrade Firmware

Official uboot is very different from the mediatek uboot, not that easy to use but very flexible.

For example, if my firmware stored in USB disk and I want to update firmware from uboot, I will need to load from usb disk to memory first, then erase flash and write to it all by command.

  1. usb start this will enable usb
  2. fatload usb 0:0 0x81000000 root_uImage my firmware name is root_uImage, and I load it to 0x81000000 (DDR memory address)
  3. sf start this will enable spi flash
  4. sf erase 0x50000 0xfb0000 erase the firmware partition, from 0x50000 and size is 0xfb0000
  5. sf write 0x81000000 0x50000 0x600325 read from 0x81000000 and write to SPI flash 0x50000, size is 0x600325(6292261), this size we can find at fatload.

Here is the log:

U-Boot 2022.01 (Oct 29 2022 - 14:39:20 +0000)                                   
                                                                                
resetctl_reboot resetctl-reboot: set_state_simple op missing                    
mtmips-reset rstctrl@0x34: set_state_simple op missing                          
CPU:   MediaTek MT7628A ver:1 eco:2                                             
Boot:  DDR2, SPI-NOR 3-Byte Addr, CPU clock from XTAL                           
Clock: CPU: 580MHz, Bus: 193MHz, XTAL: 40MHz                                    
DRAM:  128 MiB                                                                  
pinconfig pin_state: set_state_simple op missing                                
simple_bus palmbus@10000000: set_state_simple op missing                        
mt7628-clk clkctrl@0x2c: set_state_simple op missing                            
mt762x_wdt watchdog@100: set_state_simple op missingg                           
WDT:   Started watchdog@100 with servicing (60s timeout)                        
MMC:   fixed_clock clk48m@0: set_state_simple op missing                        
pinconfig sd_iot_mode: set_state_simple op missing                              
mmc@10130000: 0                                                                 
Loading Environment from SPIFlash... mt7621_spi spi@b00: set_state_simple op mig
mt7621_spi spi@b00: spi_find_chip_select: plat=86fa0258, cs=0                   
jedec_spi_nor spi-flash@0: set_state_simple op missing                          
SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB   
jedec_spi_nor spi-flash@0: from 0x00030000, len 4096                            
OK                                                                              
In:    uart2@e00                                                                
Out:   uart2@e00                                                                
Err:   uart2@e00                                                                
Net:   pinconfig ephy_iot_mode: set_state_simple op missing                     
mtmips-reset rstctrl@0x34: set_state_simple op missing                          
                                                                                
Warning: eth@10110000 (eth0) using random MAC address - ce:78:14:4e:a5:ac       
eth0: eth@10110000                                                              
Hit any key to stop autoboot:  0                                                
=>                                                                              
=> usb start                                                                    
starting USB...                                                                 
Bus ehci@101c0000: ehci_generic ehci@101c0000: set_state_simple op missing      
mt76x8_usb_phy usb-phy@10120000: set_state_simple op missing                    
USB EHCI 1.00                                                                   
scanning bus ehci@101c0000 for devices... usb_hub usb_hub: set_state_simple op g
2 USB Device(s) found                                                           
       scanning usb for storage devices... 1 Storage Device(s) found            
=> fatload usb 0:0 0x81000000 root_uImage                                       
6292261 bytes read in 245 ms (24.5 MiB/s)                                       
=> sf start                                                                     
No SPI flash selected. Please run `sf probe'                                    
=> sf probe                                                                     
mt7621_spi spi@b00: spi_find_chip_select: plat=86fa0258, cs=0                   
mt7621_spi spi@b00: spi_find_chip_select: plat=86fa0258, cs=0                                                                                                   
=> sf erase 0x50000 0xfb0000                                                    
jedec_spi_nor spi-flash@0: at 0x50000, len 16449536   
SF: 16449536 bytes @ 0x50000 Erased: OK
=> sf write 0x81000000 0x50000 0x600325
device 0 offset 0x50000, size 0x600325
jedec_spi_nor spi-flash@0: to 0x00050000, len 6292261
SF: 6292261 bytes @ 0x50000 Written: OK

Screen: Dashboard Solution

Because Simhub makes it very easy to DIY a dashboard for sim racers, many people ask about tech support for DIY projects with VoCore screens. This tutorial will help you choose the parts.

To complete a dashboard, the easiest way is to use existing solutions. The most common one is to use Arduino to control the LEDs, with open-source code that can be found at SimHub; use VoCore as the dashboard display; and use a USB hub to connect everything together.

It seems pretty simple, but there are a few things to consider:

  1. USB cable. This is very important because the VoCore screen operates at a maximum USB speed of 480MHz. This high speed requires cables designed for high-speed data transfer rather than just charging, or it will not work. Additionally, when DIYers create their own PCBs, they need to carefully match the trace impedance to 90 ohms for the two USB data cables and keep them as short as possible. Failing to do so may cause the VoCore screen to work unstably, sometimes misaligning or frequently disconnecting from the PC.
  2. USB hub. This is another important part, and it is recommended to use MTT (Multiple Transaction Translators). This is because Arduino is a slow device that works at 12MHz, while the VoCore screen operates at 480MHz. Normally, if you only use one VoCore screen and one Arduino, STT (Single Transaction Translators) should work as well, but MTT will provide better performance.
  3. Power supply. The VoCore screen typically consumes around 300mA of current, while Arduino requires up to 100mA (or more if you use additional LEDs), and the USB hub uses around 50mA. Make sure your solution can provide enough power for all components. A standard USB port outputs around 500mA, which is sufficient for most uses. However, if you have more LEDs (each consuming about 20mA), the total power consumption may exceed 500mA, causing instability in the entire solution. In such situations, it’s better to use a USB 3.0 port, which can output 1000mA.

That’s all for now. If there’s anything else to consider, I will update this blog. Have fun with your DIY dash! 🙂

VoCore2 Screen: Run on RaspberryPi

Prepare System

sudo apt update && sudo apt upgrade -y
sudo apt install raspberrypi-kernel-headers build-essential -y
sudo reboot

Download & Compile & Install Driver

git clone https://github.com/Vonger/vocore2 # download code
cd vocore2
cd utils/fbusb/src
make -C /usr/src/linux-headers-`uname -r`/ M=`pwd` modules # compile
sudo mkdir -p /lib/modules/`uname -r`/extra
sudo cp fbusb.ko /lib/modules/`uname -r`/extra/ # install module
sudo depmod -a # load at bootup

Install XORG Configuration File

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
sudo nano /etc/X11/xorg.conf

Paste the code to the end of the file.

Section "Device"
	Identifier      "vocore screen"
	Driver          "fbturbo"
	Option          "fbdev" "/dev/fb0"

	Option          "SwapbuffersWait" "true"
EndSection

Ready to Use

  1. plugout hdmi cable
  2. connect vocore screen
  3. reboot raspberrypi board
  4. the graphic will display on vocore screen by default (test on rpi4)

Here is a video about the performance.

VoCore2 + Screen: Wireless Display SimHub

Some people asked about if it is possible to make VoCore Screen wirelessly, so no need USB or any connection. I think there is such possible, because in Linux we have USBIP which can remotely connect USB by ethernet or wireless. In windows, it also has one named VirtualHere but not open source.

Then we tried the solution, the result…emm, it works but FPS is not high, for simple page like system information or not frequently changed dashboard, it is stable and good(but we did not have game for real test)

Here is a tutorial about how to try it:

Install VirtualHere on Windows PC

Download link here: https://www.virtualhere.com/usb_client_software

win32: https://www.virtualhere.com/sites/default/files/usbclient/vhui32.exe
win64: https://www.virtualhere.com/sites/default/files/usbclient/vhui64.exe

Install VirtualHere on VoCore2

VoCore2 is MIPSEL, so we need to use

https://www.virtualhere.com/sites/default/files/usbserver/vhusbdmipsel

And here is a compiled firmware for VoCore2, after upgrade you can directly use. https://vonger.cn/upload/vocore2.virtualhere.bin

Connect VoCore2 and Your PC

VoCore2 and Your Computer must in same network. About network setting, please search VoCore2 tutorial in this site.

Open VirtualHere application on your PC, wait a moment, normally it will be detected and show in the menu, VoCore2 automaticlly when they are in same network. Once it shows in the menu, right click and select use the device, then you can use the screen just like it is connected to your computer. Later we will upload a video about how it performance.

OpenWrt: Build dependency problem

Recently compile openwrt 18.06.9, get this error:

Build dependency: Please install the GNU C Compiler (gcc) 4.8 or later
Build dependency: Please install the GNU C++ Compiler (g++) 4.8 or later

I can not do any further process. But my GCC is pretty new 11.3.0

gcc --version
gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

So its report is absolutely something not right.

PS: I already can image some lazy coder just compare the first byte of gcc version, so it must think my gcc version is ‘1.x’ but not ’11.x’, so report such stupid error.

Easy to fix, just delete the check it will back to work, I have checked by my eye it is 11.x but not 1.x. Sorry about this dirty fix, I am also one of the lazy coder and even worse I am not good at script. :p

--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -26,31 +26,12 @@ $(eval $(call TestHostCommand,proper-umask, \
        Please build with umask 022 - other values produce broken packages, \
        umask | grep -xE 0?0[012][012]))
 
-$(eval $(call SetupHostCommand,gcc, \
-       Please install the GNU C Compiler (gcc) 4.8 or later, \
-       $(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
-       gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
-       gcc --version | grep -E 'Apple.(LLVM|clang)' ))
-
 $(eval $(call TestHostCommand,working-gcc, \
        \nPlease reinstall the GNU C Compiler (4.8 or later) - \
        it appears to be broken, \
        echo 'int main(int argc, char **argv) { return 0; }' | \
                gcc -x c -o $(TMP_DIR)/a.out -))
 
-$(eval $(call SetupHostCommand,g++, \
-       Please install the GNU C++ Compiler (g++) 4.8 or later, \
-       $(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
-       g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
-       g++ --version | grep -E 'Apple.(LLVM|clang)' ))
-
-$(eval $(call TestHostCommand,working-g++, \
-       \nPlease reinstall the GNU C++ Compiler (4.8 or later) - \
-       it appears to be broken, \
-       echo 'int main(int argc, char **argv) { return 0; }' | \
-               g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
-               $(TMP_DIR)/a.out))
-
 $(eval $(call TestHostCommand,ncurses, \
        Please install ncurses. (Missing libncurses.so or ncurses.h), \
        echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \

PS: I meet tons of problem after this, like m4 compatible error, and gdb8 need python2, so for simple, just download latest openwrt and copy the tools Makefile to replace the old bones, it will back to work.

VoCore2: Use UBOOT Latest Version

Currently latest version of uboot is working well on VoCore2. But because of the partition is not big enough for all uboot features, we have to do such cut off.

We upload the config to https://github.com/Vonger/vocore2/blob/master/uboot/vocore2_defconfig

Have a try 🙂 https://vonger.cn/misc/vocore2/u-boot-with-spl.bin

1. This is for 192KB partition of uboot, for mainline version you will need to adjust the uboot partition size to 312KB, but that will also need to modify Linux partition DTS file.

This define is in vocore2_defconfig of uboot: CONFIG_MTDPARTS_DEFAULT=”spi0.0:192k(u-boot),64k(env),64k(factory),-(kernel)”

2. uboot will not boot Linux after install, you will need to setup, choose and run one of the following uboot commands.

=fast bootup=========================
setenv bootcmd 'bootm 0xbc050000'
saveenv
reset
=common bootup=========================
setenv bootcmd 'sf probe; sf read ${loadaddr} 0x50000 0x200000; bootm;'
saveenv
reset

Note: it works after setup env, common bootup pretty slow at load firmware, take totally 15s to load Linux then unzip. fast bootup has limit, your compressed kernel can not >4MB

Note: 0xbc000000 is flash map to memory, and first 0x50000 we used for uboot and factory, so start at 0xbc050000

mainline uboot support

Now VoCore2 has mainline uboot available, but need more testing to verify that everything is stable.

if you need it, see below:

before replace uboot ,you need read how to fix dead uboot: https://vonger.cn/?p=8054

flash layout difference of mainline uboot and ralink uboot:

mainline uboot:

ubootuboot-envfactoryfirmware
312k4k4k

uboot from mtk:

ubootuboot-envfactoryfirmware
192k64k64k

mainline uboot’s layout can include more code in uboot, but it not compatible with the mtk’s uboot.

if you need 192k mainline uboot, please use uboot/vocore2_defconfig to compile maineline uboot:

cp path/to/thisrepo/uboot/vocore2_defconfig path/to/mainlineubootsrc/.config

note: before replace uboot, you must ensure your ‘u-boot-with-spl.bin’ size is < 192k

To support mainline of the uboot, also need to modify Linux kernel partition DTS. openwrt/target/linux/ramips/dts/mt7628an_vocore_vocore2.dts

                        partition@0 {
                                label = "u-boot";
                                reg = <0x0 0x4e000>;
                                read-only;
                        };

                        partition@30000 {
                                label = "u-boot-env";
                                reg = <0x30000 0x1000>;
                                read-only;
                        };

                        factory: partition@40000 {
                                label = "factory";
                                reg = <0x40000 0x1000>;
                                read-only;
                        };

PS: before do anything change to your VoCore, better to backup the hole flash to avoid any calibrate data lost.

PayPal locked our account today

PayPal just locked our account this morning, no reason provide and no idea, they required us submit a lot of paperwork to prove our business is real. We have submitted in first time but seems like the review still need three days.

Possible reason: our sales agent is locked at home because of virus and their home network is very slow to login PayPal, so around one week we can not fill trace on PayPal(but we do have trace on our site…)

For recently order, please directly email to sales@vocore.io, so we have to use old way to handle this, email and wire transfer to our company account.

If any other good third party to replace PayPal please suggest. 🙂 Sometimes we are just too lazy to take action but seems like this time we have to move, PayPal is very expansive and not friendly to seller anymore.

PS: at Nov.20, our account is unlocked. But the our stock distinct is locked because of COVID…It is so hard this year. :'(

VoCore2: Boot from memory/USB

Sometimes we need to do some test fast, or test new system like ECOS, so maybe boot from flash is not a good idea, it is slow to write and load. Then maybe good idea is boot from memory.

First, enable ramdisk from openwrt menuconfig, this is default enabled normally.

If not, it is at make menuconfig => Target Images => [*] ramdisk

After setup and compile, you will find openwrt-ramips-mt76x8-vocore_vocore2-initramfs-kernel.bin at openwrt/bin/targets/ramips/mt76x8 folder.

Then we can copy it to a USB disk which formatted in FAT(because default uboot only support this disk format), rename to ram.bin (because FAT might not good at support too long file name)

Plug the usb disk to your VoCore2, and power on it. When uboot menu shows up from UART, press 4 to entry uboot command console. Then call “usb start” to enable usb, “usb storage” to load usb disk, “fatload usb 0:1 0x81000000 ram.bin” to load ram.bin to memory and final “bootm 0x81000000 ” to boot from memory.

PS: if your flash is 32MB or more, need to modify start address.

The log I attach here:

flash manufacture id: ef, device id 40 18                                       
find flash: W25Q128BV                                                           
============================================                                    
Ralink UBoot Version: VOCORE2                                                   
--------------------------------------------                                    
ASIC 7628_MP (Port5<->None)                                                     
DRAM component: 1024 Mbits DDR, width 16                                        
DRAM bus: 16 bit                                                                
Total memory: 128 MBytes                                                        
Flash component: SPI Flash                                                      
Date:Aug  8 2019  Time:16:16:35                                                 
============================================                                    
icache: sets:512, ways:4, linesz:32 ,total:65536                                
dcache: sets:256, ways:4, linesz:32 ,total:32768                                
                                                                                
 ##### The CPU freq = 575 MHZ ####                                              
 estimate memory size =128 Mbytes                                               
RESET MT7628 PHY!!!!!!                                                          
Please choose the operation:                                                    
   0: Load system code then write to Flash via Serial.                          
   1: Load system code to SDRAM via TFTP.                                       
   2: Load system code then write to Flash via TFTP.                            
   3: Boot system code via Flash (default).                                     
   4: Entr boot command line interface.                                         
   5: Load system code then write to Flash via USB Storage.                     
   7: Load Boot Loader code then write to Flash via Serial.                     
   9: Load Boot Loader code then write to Flash via TFTP.                       
   r: Reset firmware to first boot.                                             
                                                                                
You choosed 4                                                                   
                                                                                
 0                                                                              
                                                                                
                                                                                
4: System Enter Boot Command Line Interface.                                    
                                                                                
U-Boot 1.1.3 (Aug  8 2019 - 16:16:35)                                           
MT7628 # usb start                                                              
(Re)start USB...                                                                
USB0:   *********ehci_hcd_init**********                                        
Mediatek/Ralink USB EHCI host init hccr b01c0000 and hcor b01c0010 hc_length 16 
 6. u2phydcr0(0xb0120860)=0x00aaaa02                                            
 FM_OUT value: u4FmOut = 0(0x00000000)                                          
 FM_OUT value: u4FmOut = 149(0x00000095)                                        
 FM detection done! loop = 1                                                    
 SR calibration value u1SrCalVal = 5                                            
                                                                                
                                                                                
Register 1111 NbrPorts 1                                                        
USB EHCI 1.00                                                                   
scanning bus 0 for devices... 2 USB Device(s) found                             
       scanning bus for storage devices... 1 Storage Device(s) found            
MT7628 # usb storage                                                            
  Device 0: Vendor: Generic  Prod.: STORAGE DEVICE   Rev: 0272                  
            Type: Removable Hard Disk                                           
            Capacity: 29862.0 MB = 29.1 GB (61157376 x 512)                                                                    
MT7628 # fatload                                                                
usage: fatload <interface> <dev[:part]> <addr> <filename> [bytes]               
MT7628 # fatload usb 0:1 0x81000000 ram.bin                                     
reading ram.bin                                                                 
...                                                                             
................................................................................
..                                                                              
                                                                                
5420311 bytes read                                                              
MT7628 #                                                                        
MT7628 # bootm 0x81000000                                                       
## Booting image at 81000000 ...                                                
   Image Name:   MIPS OpenWrt Linux-5.4.215                                     
   Image Type:   MIPS Linux Kernel Image (lzma compressed)                      
   Data Size:    5420247 Bytes =  5.2 MB                                        
   Load Address: 80000000                                                       
   Entry Point:  80000000                                                       
   Verifying Checksum ... OK                                                    
   Uncompressing Kernel Image ... OK                                            
No initrd                                                                       
## Transferring control to Linux (at address 80000000) ...                      
[    0.000000] Linux version 5.4.215 (...)
[    0.000000] Board has DDR2                                                   
[    0.000000] Analog PMU set to hw control                                     
[    0.000000] Digital PMU set to hw control                                    
[    0.000000] SoC Type: MediaTek MT7628AN ver:1 eco:2                          
[    0.000000] printk: bootconsole [early0] enabled                             
[    0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)                          
[    0.000000] MIPS: machine is VoCore2                                         
[    0.000000] Initrd not found or empty - disabling initrd                     
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes. 

VoCore2 Super: Combine Ultimate/PoE

This version I planed a long time, but because it is super hard, tried many times all failed. I faced many problems:

  1. PoE voltage is 50V~60V but VoCore2 is only 5V, how to protect VoCore2 from outside noise or unexpect high voltage(like lighting from ethernet)?
  2. PoE heat is pretty much, VoCore2 Ultimate already very small, how to reduce the heat without a fan?
  3. PoE use a lot of parts, include a big cap(electrolytic capacitor), such high voltage cap(100V) we do not have small part as replacement. Also such cap can not stand high temperture or its life time will be reduce a lot. How to place it into so limited space?
  4. We have low speed signal like I2C; high speed signal like USB, SDXC, ethernet; analog signal for sound card headphone output, micphone input and high voltage power input, low voltage power output, how to arrange them into only coin sized space without a war?
  5. Ethernet need transformer which is big; PoE need two diode bridge which is big; Sound card, USB2TTL, POE power convert chip, and their capacitor, all are space eater.

Finally I find a way to make it work 🙂 This is a really adventure. Later blog will explain how I did it.