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 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 11025 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 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

Re: DockStar JTAG

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

Hmm, I managed to erase the NAND just fine, but I'm getting an error when trying to perform the write.
Code: Select all
> halt
Halt timed out, wake up GDB.
> sheevaplug_init
> nand probe 0
NAND flash device 'NAND 256MiB 3,3V 8-bit' found
> nand erase 0 0x0 0xa0000
erased blocks 0 to 5 on NAND flash device #0 'NAND 256MiB 3,3V 8-bi
> nand write 0 uboot.bin 0 oob_softecc_kw
timed out while waiting for target halted
error executing hosted NAND write
Unable to write data to NAND device
failed writing file uboot.bin to NAND flash 0 at offset 0x00000000
>


It looks like my halt timed out and the target is not truly halted even though I'm able to probe the NAND correctly.
Code: Select all
> nand probe 0
NAND flash device 'NAND 256MiB 3,3V 8-bit' found
> halt
> nand erase 0 0x0 0xa0000
erased blocks 0 to 5 on NAND flash device #0 'NAND 256MiB 3,3V 8-bit'
> nand write 0 uboot.bin 0 oob_softecc_kw
timed out while waiting for target halted
error executing hosted NAND write
Unable to write data to NAND device
failed writing file uboot.bin to NAND flash 0 at offset 0x00000000
> halt
Halt timed out, wake up GDB.
> halt
> sheevaplug_init
> nand write 0 uboot.bin 0 oob_softecc_kw
timed out while waiting for target halted
error executing hosted NAND write
Unable to write data to NAND device
failed writing file uboot.bin to NAND flash 0 at offset 0x00000000
> halt
> nand write 0 uboot.bin 0 oob_softecc_kw
timed out while waiting for target halted
error executing hosted NAND write
Unable to write data to NAND device
failed writing file uboot.bin to NAND flash 0 at offset 0x00000000
>


Well, I guess I'm committed to figuring this out now... :cry:
Last edited by bzboi on Fri Aug 27, 2010 2:50 pm, edited 1 time in total.
bzboi
 
Posts: 55
Joined: Sun Jul 11, 2010 5:39 pm

Re: DockStar JTAG

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

Rosi wrote:
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...


You need to unzip and run the giveio batch file in the drivers subdirectory
bzboi
 
Posts: 55
Joined: Sun Jul 11, 2010 5:39 pm

Re: DockStar JTAG

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

bzboi wrote:You need to unzip and run the giveio batch file in the drivers subdirectory

I get an error on copying this on win7, I'll set up a virtuel machine with win xp.
Rosi
 
Posts: 5
Joined: Thu Aug 26, 2010 6:17 pm

PreviousNext

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 2 guests