Welcome! Log In Create A New Profile

Advanced

Repair via Serial instead of JTAG.

Posted by neutronscott 
Repair via Serial instead of JTAG.
April 25, 2011 11:01PM
So I was talking to a buddy about my new toy, and he said he worked with a processor before that would allow flashing over the UART after he broke the boot code. I'm like, no wai!!

So looking at the Kirkwood datasheet, it does it too! Sweet. This would be so much faster and easier. It uses X-modem.. I use picocom under Linux and just tested it by making a file containing the characters described, then a "while true; do cat string >>start_debug; done" for awhile to make sure it was enough.. and sent it while booting up. The outcome, I was greeted with "Bootstrap 1.21" on my GoFlex Home.

It is described here: http://www.marvell.com/products/processors/embedded/kirkwood/FS_88F6180_9x_6281_OpenSource.pdf (page 297).

Maybe help me later if I decide to flash this goflexnet u-boot. It hasn't produced any output to me via TFTP...

Edit: Took a bit of trial and error to finally decide to run 'doimage -T uart ...' before a serial load works. Obviously XMODEM uses 128byte packets, and the first 128bytes decide where to boot from. So a simple 128byte packet could be sent to redirect boot to whatever... Thus, it would start booting the NAND with the images provided here. derr. Edited picocom and uboot for goflex available at http://wiki.scottn.us/



Edited 2 time(s). Last edit at 04/26/2011 03:59AM by neutronscott.
dpffan
Re: Repair via Serial instead of JTAG.
April 26, 2011 04:21AM
Could you explain what is "doimage -T uart"? I am trying to duplicate the UART boot process for a dockstar. In the past, there were sporadic posts from plugcomputer on UART boot but nobody provided sufficient details to continue.

http://plugcomputer.org/plugforum/index.php?topic=2101.0
Re: Repair via Serial instead of JTAG.
April 26, 2011 12:40PM
Yes. I found few information on this, only people saying it did not work. Also if someone knows anything about the Command Line commands, I'd like to know. Seems the letters 'x' 'j' and 'g' halt the machine. I was thinking 'x' would put it in xmodem recv, but it doesn't seem that way... Oh well.

doimage creates the KWB header. It is included in the GoFlex home GPL tarball, (google 'goflex gpl'). Inside u-boot tools directory once you extract u-boot. You can look at their Makefile for how to use it. I didn't get u-boot itself to compile yet, but doimage.c seems to be pretty standalone. It's a large tarball... I put u-boot itself on http://goflex.scottn.us/ if you'd like.

For my test, i took http://jeff.doozan.com/debian/uboot/files/uboot/uboot.mtd0.goflexnet.original.kwb and removed current 512byte header on it with dd. Then ./doimage -T uart -D 0x600000 -E 0x670000 -R ../dramregs_400db_A.txt uboot.orig uboot.uart
dpffan
Re: Repair via Serial instead of JTAG.
April 26, 2011 07:25PM
Thanks for the additional information. Since my initial post, I've found Jeff's notes on building uboot: http://jeff.doozan.com/debian/uboot/build_uboot.htm

I modified kwbimage.cfg accordingly to duplicate the effects of doimage -T uart , ie
BOOT_FROM nand
to
BOOT_FROM uart
I managed to build uboot with the codesourcery ARM toolchain. Seems like dockstar uses dramregs_pp128_A.txt for doimage.

It also seems that dockstar bootROM version is different from goflex.

The tips on halting with x, j and g should come in useful. I will continue to experiment - for the initial test, I wasn't able to get the file sent over to the dockstar. It was stuck at the "Waiting NAK... Press 'x' to escape."
Re: Repair via Serial instead of JTAG.
April 26, 2011 07:47PM
maybe the dockstar's bootrom doesn't do it... :( my device has 1.21, i suppose yours is the 1.11.

Mine begins sending XMODEM NAKs after mode was entered successfully. unfortunately the OpenSource docs don't describe command line mode, or any BootROM differences or errata. Does starting xmodem manually provide any output?
Start picocom with: ./picocom -s 'sx -vv -b' -b 115200
CTRL+A CTRL+S to send; 'sx' comes with minicom package.
ecc
Re: Repair via Serial instead of JTAG.
April 29, 2011 02:38PM
Congratulations on getting this to work on the GoFlex. Unfortunately I don't get any response on my DockStar (BootROM version 1.11).

And a word of warning to other DockStar hackers. This might just have been coincidence, but after trying to send either the UART-debug sequence or the UART-boot sequence during boot, my DockStar wouldn't boot at all. Using JTAG I found that block 0 of the NAND had been marked bad. I scrubbed the NAND and re-flashed, and (knock on wood) it's working so far.
dpffan
Re: Repair via Serial instead of JTAG.
June 05, 2011 09:24AM
@neutronscott

Your device is the Goflex Home? On my Goflex Net, I just checked and confirmed the bootrom version is 1.21 as well. So both our devices are practically unbrickable since they both support booting/flashing over UART
Re: Repair via Serial instead of JTAG.
June 07, 2011 11:17PM
Quote
dpffan
Your device is the Goflex Home?

Yes.

It would be interesting to dump and disassemble both 1.11 and 1.21 bootroms.. i bet there may be a workaround for 1.11, but a very poor man's JTAG is just as easy I guess. I'd be interested at how to operate the command mode.

It seems someone has looked into it. wonder if they disassembled it. http://plugcomputer.org/plugforum/index.php?topic=2101.0
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: