De-bricking the VoCore

ronlaws86
 
Posts: 6
Joined: Fri Nov 27, 2015 11:09 am

De-bricking the VoCore

Fri Nov 27, 2015 11:31 am

Im posting this in the hope that it will help others with a speedy recovery.

Scenario: You accidentally flashed the wrong OpenWRT image to your VoCore, and it is now stuck in a boot loop. :oops:


At this point, the only way to fix, as outlined here http://vocore.io/wiki/index/id:14 is to use the TTL adapter.

Once I connected via the TTL, sure enough i could see u-boot struggling with the linux partition on the flash, and continually resetting the board.
Screen Shot 2015-11-27 at 09.49.30.png
u-boot error, X to enter console.
Screen Shot 2015-11-27 at 09.49.30.png (111.98 KiB) Viewed 28344 times


Following the instructions to send the vocore.dock2.bin file (the correct rom for the vocore with dock) i found that the instructions to then write the image to flash from uBoot did not seem to work, and it returned
Code: Select all
Booting image at bc050000 .

   Image Name:   MIPS OpenWrt Linux-3.10.49

   Created:      2015-11-25   4:21:27 UTC

   Image Type:   MIPS Linux Kernel Image (lzma compressed)

   Data Size:    1010595 Bytes = 986.9 kB

   Load Address: 80000000

   Entry Point:  80000000

   Load Kernel:  ................



   Verifying Checksum ... Bad Data CRC


What i did instead was then type bootm which makes the vocore boot from the file we sent it, from RAM instead of booting from flash

at this point, you can observe the vocore booting OpenWRT, and after a minute or so, the VoCore Wireless network will become avaiable.

I connected to that from my laptop, and used the luci web interface (http://192.168.61.1/ ) to re-flash the correct rom file (vocore.dock2.bin in my case) and waited for the process to complete.

Once it had rebooted back in to OpenWRT, I confirmed that it was able to boot on it's own by observing the console and power cycling the device and waiting for OpenWRT to finish booting, and sure enough the process seems to have unbricked the vocore. at this point I detached the serial console and power and re-attached the dock, and everything seems to be working normally.

Hope this helps someone!

Edit: Here are the commands I entered in sequence to perform the above operation
First insert the USB TTL adapter and connect it to the VoCore
Open Up a terminal and enter the following commands (I did this from MacOSX but it should be the same for Linux Users)

first place your firmware image (vocore.dock2.bin) in your home directory, and/or make sure your command line is in the same folder as the rom file you need to send the vocore.
(you can use pwd and ls to verify this)
Code: Select all
kermit

then from kermit entered the following
Code: Select all
set line /dev/tty.usbserial
define sz !sz \%0 > /dev/tty.usbserial < /dev/tty.usbserial
set speed 57600
set carrier-watch off
set prefixing all
set parity none
set stop-bits 1
set modem none
set file type bin
set file name lit
set flow-control none
set prompt “MacOS Kermit> ”

then powered up the VoCore and waited for the boot loader to start appearing, if it does not, try hitting return a couple of times or check the connection and installed drivers for your TTL adapter, if it is connected you should see a light flickering on the adapter (a red one if supplied by Vonger with your VoCore). If the blue light is flickering you may have it connected wrong (it should be Tx to Rx and Rx to Tx)

once u-boot started scrolling up the screen, hit x repeatedly until it drops you in to a command prompt for u-boot, it should appear as
VoCore>

this step may take a few attempts

now enter the following:
Code: Select all
loadb

to put u-boot in to the appropriate mode to receive the new rom file

then press the following key combos
Code: Select all
CTRL+/ followed by C

to return to kermit locally without terminating the connection

then enter the following:
Code: Select all
send vocore.dock2.bin

You should see the following screen
Screen Shot 2015-11-27 at 09.52.24.png
Kermit file upload
Screen Shot 2015-11-27 at 09.52.24.png (132.98 KiB) Viewed 28334 times


wait for the process to complete (it can take 10-15 minutes)

then enter
Code: Select all
connect

to return to u-boot

At this point you can either attempt to flash the file directly, but this can be complicated, and as I mentioned above I had issues with this. The easyest and probably safer option is to boot the new rom directly from RAM, to do this,

enter
Code: Select all
bootm

and observe as openwrt begins booting.
eventually you should see the OpenWRT command line appear by hitting enter a few times, by which time you can now connect to the VoCore via the built in WiFi (it should be an open network called VoCore_xxxx or OpenWRT) and log in to Luci with the user root and password vocore
and navigate your way to the luci firmware update page (System -> Backup/Flash Firmware) and upload the vocore.dock2.bin file and follow standard procedure.

once it is done, you should find the VoCore can now boot on it's own.

Good Luck! :)

(some useful links)
[url]vonger.cn/upload/firmware/vocore.dock2.bin[/url] Vonger's ROM build for the dock2
https://downloads.openwrt.org/barrier_breaker/14.07/ramips/rt305x/ correct version of OpenWRT for Ramips rt305x (look for openwrt-ramips-rt305x-vocore-squashfs-sysupgrade.bin)
http://vonger.cn/?p=780 the post i based most of this process off

docbee
 
Posts: 34
Joined: Wed Nov 02, 2016 9:15 am

Re: De-bricking the VoCore

Wed Nov 02, 2016 9:19 pm

Thanks for the recipe. I followed your instructions and transferred a new image via kermit to my vocore 1.0.
When I tried to start it from RAM via bootm it gave me a "LZMA Error 1".

Code: Select all
VoCore> loadb
## Ready for binary (kermit) download to 0x80100000 at 57600 bps...

(Back at Boriss-Mac-Pro.local)
----------------------------------------------------
“MacOS Kermit> ”send fw.bin
“MacOS Kermit> ”c
Connecting to /dev/tty.SLAB_USBtoUART, speed 57600
 Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------
## Total Size      = 0x005c0004 = 6029316 Bytes
## Start Addr      = 0x80100000
VoCore> bootm

Booting image at 80100000
   Image Name:   MIPS OpenWrt Linux-3.10.49
   Created:      2016-11-02   0:42:43 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1006296 Bytes = 982.7 kB
   Load Address: 80000000
   Entry Point:  80000000
   Load Kernel: 

   Verifying Checksum ... OK
   Uncompressing Kernel Image ... LZMA ERROR 1 - must RESET board to recover


Doesn't that work because of the image file being a bit larger (abt 6 MB)?
DO I need to make additional settings?

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: De-bricking the VoCore

Thu Nov 03, 2016 2:33 pm

Hi, I guess the uboot might out of date, support only 4MB. Please load our firmware first, download from http://vonger.cn/upload/vocore.dock2.bin, then flash your bin.

docbee
 
Posts: 34
Joined: Wed Nov 02, 2016 9:15 am

Re: De-bricking the VoCore

Sat Nov 05, 2016 1:33 pm

When using the dock image you pointed me to, I get full 16 MB of flash instead of just 8 MB with the standard vocore firmware.
It does not fix the issue to boot from an image transferred via kermit into ram and then booting from there. May be the whole approach is not making sense, as the image in RAM might/will conflict with booting system.
However, flashing a standard vocore firmware via uboot's "tftpboot-erase-cp-reset" cycle works fine and when vocore comes up, I can transfer new large self-made image into ramdisk and update to my firmware with "mtd -c write mynewfirmware.bin firmware".

One question remains... When I flash my own firmware (openwrt BB build with some extra libs and packages) I am back to just 8 MB firmware size. Are there any parameters to be given when openwrt builds the firmware so that 16 MB flash are avail?

docbee
 
Posts: 34
Joined: Wed Nov 02, 2016 9:15 am

Re: De-bricking the VoCore

Sat Nov 05, 2016 2:26 pm

Silly me, using 16 MB flash can be controlled in VOCORE.dts as explained here: https://wiki.openwrt.org/toh/vocore/vocore

mcr314
 
Posts: 2
Joined: Sun Dec 21, 2014 11:26 pm

Re: De-bricking the VoCore

Mon Feb 20, 2017 4:32 am

The vocore.dock2.bin appears to be a full image, linux and everything. How can I use that to update my uboot?

My device boots up and says:

U-Boot for VoCore(based on RT5350)Warning: un-recognized chip ID, please update bootloader!
..
Version: May 30 2014 20:52:36

the loadb loads to 80100000, and the cp command seems broken. cp.linux seems not to work.
The LZMA error is no doubt because the image is being uncompressed is larger than 0x100000, so it overwrites itself as it boots.
If I could kermit the image to a higher address, I think it would all work.

I have built lede, which is what I'd like to run. This unit is not a Dock unit, so tftp isn't going to work either.
(I did do a sysupgrade image (via the lua process), but I forgot to build the UI into this image, so I can't repeat, and I don't even have "ip". Oops on me. Which is why I'm trying to recover via uboot)

Can I flash a newer uboot in via kermit?

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: De-bricking the VoCore

Mon Feb 20, 2017 4:56 pm

flash uboot is danger :)
You can flash it in linux.
default uboot section is writable.
mtd -e u-boot write [youruboot] u-boot

before you do this, make sure you can fix brick when u-boot dead.
before you do this, make sure you can fix brick when u-boot dead!
before you do this, make sure you can fix brick when u-boot dead!!

mcr314
 
Posts: 2
Joined: Sun Dec 21, 2014 11:26 pm

Re: De-bricking the VoCore

Mon Feb 20, 2017 10:54 pm

For this unit, I think I've already screwed up my uboot.
I have two more units (one is a dock). My reading of the page at http://vocore.io/v2.html, way at the bottom, is a bit unclear.

Let Va = VoCore unit which is alive (A=alive)
Let Vb = VoCore unit which is bricked.

My understanding is that I'm going to flash Va, with the SPI wires attached in parallel to Vb, such that both will in fact get flashed at the same time?

> 2.2 using flash loader to recover your bricked VoCore2.

Which "flash loader" are you speaking of here?

> 2.2.a disconnect Vb from power;
(presumably, I should the wiring with Va having no power initially too)

> 2.2.b connect Vb to Va GND;
Does it matter which pins I use?
I'm wondering if I have clips small enough for those holes. I imagine I have to use a jumper and a small dab of solder.

> 2.2.c Vb +3.3V to Va +3.3V;

> 2.2.d Vb SPI MISO (26) -> Va SPI MOSI (27);
> 2.2.e Vb SPI MOSI (27) -> Va SPI MISO (26)

Noting the two pins are swapped.

> 2.2.g Vb SPI CS0 (28) -> Va SPI CS (CS0?) (28);
> 2.2.h Vb SPI CLK (25) -> Va SPI CLOCK (25);

> 2.2.i Vb RST (138) -> Va GND; (keep VoCore2 in reset mode)

> 2.2.j now, download then send "Flash Image" to VoCore2.2 (Va)

again, unclear what is the "Flash Image" program here.

> 2.2.k remove wires, connect VoCore2 back to power, everything should back normal.

since removing wires may be a pain should I have not gotten it all working, would it suffice to remove 3.3V and RST wire, and see if Vb boots to uboot?

> 3. option: better to upgrade your firmware after recover, Flash Image is out of date.
Yes.

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: De-bricking the VoCore

Wed Feb 22, 2017 1:23 am

mcr314 wrote:For this unit, I think I've already screwed up my uboot.
I have two more units (one is a dock). My reading of the page at http://vocore.io/v2.html, way at the bottom, is a bit unclear.

Let Va = VoCore unit which is alive (A=alive)
Let Vb = VoCore unit which is bricked.

My understanding is that I'm going to flash Va, with the SPI wires attached in parallel to Vb, such that both will in fact get flashed at the same time?

> 2.2 using flash loader to recover your bricked VoCore2.

Which "flash loader" are you speaking of here?

> 2.2.a disconnect Vb from power;
(presumably, I should the wiring with Va having no power initially too)

> 2.2.b connect Vb to Va GND;
Does it matter which pins I use?
I'm wondering if I have clips small enough for those holes. I imagine I have to use a jumper and a small dab of solder.

> 2.2.c Vb +3.3V to Va +3.3V;

> 2.2.d Vb SPI MISO (26) -> Va SPI MOSI (27);
> 2.2.e Vb SPI MOSI (27) -> Va SPI MISO (26)

Noting the two pins are swapped.

> 2.2.g Vb SPI CS0 (28) -> Va SPI CS (CS0?) (28);
> 2.2.h Vb SPI CLK (25) -> Va SPI CLOCK (25);

> 2.2.i Vb RST (138) -> Va GND; (keep VoCore2 in reset mode)

> 2.2.j now, download then send "Flash Image" to VoCore2.2 (Va)

again, unclear what is the "Flash Image" program here.

> 2.2.k remove wires, connect VoCore2 back to power, everything should back normal.

since removing wires may be a pain should I have not gotten it all working, would it suffice to remove 3.3V and RST wire, and see if Vb boots to uboot?

> 3. option: better to upgrade your firmware after recover, Flash Image is out of date.
Yes.



Fix uboot must directly write to the SPI flash, must fullfill three condition

1. power supply: 3.3V and GND to SPI flash.
2. data transfer: CS0, MISO, MOSI, CLK to SPI flash.
3. avoid noise: RST -> GND, connect RST to GND to keep MT7628 in RESET mode, so it will not noise SPI bus(3.3V connected, part of MT7628 will work)

A flash loader is like this:

https://item.taobao.com/item.htm?spm=a2 ... =20#detail

Return to VoCore & VoCore+Dock

Who is online

Users browsing this forum: No registered users and 5 guests