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:
- 1x working VoCore2(Normal VoCore2).
- 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.