DockStar JTAG

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

Re: DockStar JTAG

Postby Kragorn » Wed Aug 25, 2010 1:43 pm

Finally, I made it to work. It's pretty simple in fact.

I'll give you detailed steps so you can revive your Dockstar :
I've used the following on my Windows XP machine.

Get OpenOCD binaries at http://www.freddiechopin.info/index.php/en/download/category/4-openocd
Get uboot-original-mtd0.kwb at http://jeff.doozan.com/debian/uboot/uboot-original-mtd0.kwb or build you own using instructions at http://jeff.doozan.com/debian/uboot/.

Put the uboot file in Programs Files/OpenOCD/0.4.0/
Put dockstar.cfg in Programs Files/OpenOCD/0.4.0/board/ (see attachment)

Open a console and type openocd -f board/dockstar.cfg
Open another console and telnet to localhost 4444 and type :

init
sheevaplug_init
dockstar_reset_cpu
load_image uboot-original-mtd0.kwb 0x800000
resume 0x800200

and voilà you should see the green light.

NB : The attachment contains the configuration file for the dockstar using a wiggler cable. If you're using another cable, please change at the begining of the file the line which begin with "interface" according to your need.

Edit : I've juste one small problem, could someone dump the mtd0 using "nanddump -nf usb/mtd0 /dev/mtd0" please ? As I've "*** Warning - bad CRC or NAND, using default environment" when I restored the backup taken with dd.
Attachments
dockstar.zip
(1.9 KiB) Downloaded 1550 times
Kragorn
 
Posts: 11
Joined: Wed Aug 11, 2010 4:35 pm

Re: DockStar JTAG

Postby ygator » Thu Aug 26, 2010 12:00 am

Great Job Kragorn.

Can you go into details on what Jtag cable you used?
Where to buy it from?
Did it come with everything you need to hook to the dockstar?
How it hooks to the dockstar? Does it come with a 2x5 1mm spaced header?
etc...

What ended up being the problem when it did not work on your previous post?
ygator
 
Posts: 90
Joined: Tue Aug 10, 2010 9:37 pm

Re: DockStar JTAG

Postby Thor » Thu Aug 26, 2010 1:31 am

Kragorn wrote:Finally, I made it to work. It's pretty simple in fact.
.
.
.
Edit : I've juste one small problem, could someone dump the mtd0 using "nanddump -nf usb/mtd0 /dev/mtd0" please ? As I've "*** Warning - bad CRC or NAND, using default environment" when I restored the backup taken with dd.


I could, but don't have nanddump. Where can I get it?
Thor
 
Posts: 11
Joined: Wed Jul 14, 2010 1:00 am

Re: DockStar JTAG

Postby Kragorn » Thu Aug 26, 2010 7:04 am

Thor wrote:I could, but don't have nanddump. Where can I get it?


Nevermind, I restored it with the savenv uboot command, Thanks you.

ygator wrote:Great Job Kragorn.

Can you go into details on what Jtag cable you used?
Where to buy it from?
Did it come with everything you need to hook to the dockstar?
How it hooks to the dockstar? Does it come with a 2x5 1mm spaced header?
etc...

What ended up being the problem when it did not work on your previous post?


I bought the cable on Ebay. You can search for "universal jtag". I guess it comes from diygadget.com. You can see configuration on their Wiki. It comes with a bunch of cables but it's for a 2.5mm pitch pins where the dockstar has 2.0mm. So I used an old 2.5' IDE adapter to 3.5' (not all pins are available, one row on the right is unused, see attachment).

I used the buffered mode configuration. So it acts as a Wiggler cable type.

I think it didn't work before because the CPU registers were miss set. Maybe it needs special values, values that I don't know so I had the idea to reset all registers to 0 except one which put the CPU in Supervisor mode. Then I loaded the uboot image and it worked. I repeated the operation multiple times and it worked.
Attachments
photo.JPG
IDE adapter
photo.JPG (104.14 KiB) Viewed 4932 times
Kragorn
 
Posts: 11
Joined: Wed Aug 11, 2010 4:35 pm

Re: DockStar JTAG

Postby bzboi » Fri Aug 27, 2010 6:32 am

Kragorn wrote:init
sheevaplug_init
dockstar_reset_cpu
load_image uboot-original-mtd0.kwb 0x800000
resume 0x800200


Good work Kragorn!!!

I confirm that this also works with the Xilinx Parallel Cable III.
I had to change the interface to parport_dlc5, as only the standard JTAG pins are available on this programmer, ie no TRST and SRST. I had already installed RP1 and R166, so I have not verified if they are truly required.

My objective is to find a pin compatible 1GB TSOP NAND and see if I can do a fresh install of Arch Linux ARM install/embDebian/OpenWRT directly onto the blank part.

It looks like if I renamed uBoot.mtd0.kwb to uboot.bin, and called "sheevaplug_reflash_uboot" instead of "load_image", that would erase the NAND and write the new uboot with appropriate ECC. My question is whether the address ranges for uboot and uboot-env are the same in the Dockstar as the Sheevaplug, or do I need to change the length of the erase to 0x80000 since that is the size of the uboot image. How about the address range to write the uboot-env parameters? Do I even NEED to change the parameters already in the Dockstar?
Code: Select all
proc sheevaplug_reflash_uboot { } {

   # reflash the u-Boot binary and reboot into it
   sheevaplug_init
   nand probe 0
   nand erase 0 0x0 0xa0000
   nand write 0 uboot.bin 0 oob_softecc_kw
   resume

}


After that, I assume that I can load an image from the uBoot shell via TFTP and perform some variation of the following steps from http://www.cs.cmu.edu/~ecc/dockstar-howto.html
Code: Select all
CE>> mw 0x800000 0 0x100000
CE>> tftpboot 0x800000 dockstar-uImage
# take note of the "bytes transferred" in hex and make sure that it's less than 0x100000
# if not, redo the "mw" command above with a larger size, and use that size in the commands below

# CAREFULLY erase the uImage partition and flash it with the new kernel
CE>> nand erase 0x100000 0x400000
CE>> nand write.e 0x800000 0x100000 0x100000  # or larger size if needed

CE>> mw 0x800000 0 0x200000
CE>> tftpboot 0x800000 dockstar-rootfs
# as above, make sure 0x200000 is larger than the rootfs image size, or adjust accordingly

# CAREFULLY erase the rootfs partition and flash it with new squashfs image
CE>> nand erase 0x500000 0x2000000
CE>> nand write.e 0x800000 0x500000 0x200000  # or larger size if needed

# CAREFULLY erase the rootfs_data partition so openwrt will create a jffs2 overlay filesystem
CE>> nand erase 0x2500000 0xdb00000


I'm debating whether to flash the Pogoplug image to mtd1/2 just to have a fallback plan if either Pogoplug or Arch Linux ARM install/embDebian/OpenWRT gets corrupted.

Any comments/advice would be greatly appreciated.
bzboi
 
Posts: 55
Joined: Sun Jul 11, 2010 5:39 pm

Re: DockStar JTAG

Postby Rosi » Fri Aug 27, 2010 2:04 pm

I accidentally typed nand erase with no parameters into the CE>> console and now, I cant get into the console anymore, is there a way to fix this? Or is the device broken because of the deleted nand?
Rosi
 
Posts: 5
Joined: Thu Aug 26, 2010 6:17 pm

Re: DockStar JTAG

Postby bzboi » Fri Aug 27, 2010 2:11 pm

Rosi wrote:I accidentally typed nand erase with no parameters into the CE>> console and now, I cant get into the console anymore, is there a way to fix this? Or is the device broken because of the deleted nand?


Yes, flash recovery of a bricked Dockstar via the JTAG interface is the objective of this thread. Try out the steps that Kragorn outlined and hopefully we'll have better instructions written up soon.
bzboi
 
Posts: 55
Joined: Sun Jul 11, 2010 5:39 pm

Re: DockStar JTAG

Postby crimsonredmk » Fri Aug 27, 2010 2:12 pm

NAND erase is never a good idea, but hey, at least you can go back now!
Remember, Arch Linux ARM is completely donation-supported, and is totally awesome.
crimsonredmk
Site Admin
 
Posts: 431
Joined: Wed Dec 30, 2009 5:17 pm
Location: #archlinux-arm on irc.freenode.net

Re: DockStar JTAG

Postby Rosi » Fri Aug 27, 2010 2:25 pm

bzboi wrote:Try out the steps that Kragorn outlined and hopefully we'll have better instructions written up soon.

I always get missing previlegs for direct i/o ...

I made a seriel cable with the ca 42 nokia data cable...
Last edited by Rosi on Fri Aug 27, 2010 2:38 pm, edited 1 time in total.
Rosi
 
Posts: 5
Joined: Thu Aug 26, 2010 6:17 pm

Re: DockStar JTAG

Postby bzboi » Fri Aug 27, 2010 2:35 pm

Just to add a note to anyone trying to probe the NAND. There is an issue with "nand probe 0" not returning the correct information. (Try it first)

The workaround is as follows (from http://code.google.com/p/openrd/issues/detail?id=7)
Code: Select all
1. openocd -f board/dockstar.cfg
2. telnet localhost 4444 (in another terminal)
3. press and hold the reset button on the dockstar
4. while holding in the reset button, enter "halt" in the terminal
5. release the reset button.
6. type "sheevaplug_init" in the terminal

The board is now halted in its pre u-boot state.  commands like "nand probe 0" should
work.
bzboi
 
Posts: 55
Joined: Sun Jul 11, 2010 5:39 pm

PreviousNext

Return to Marvell Kirkwood

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests