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 bzboi » Sat Sep 04, 2010 12:55 pm

$this->bbcode_second_pass_quote('klingon', 'O')penocd comes back with a bunch of error msgs.

Do the error messages tell you that the target is not halted and to do a JTAG reset? If so, try the workaround and that will force the halt to occur while the SoC is in reset.
bzboi
 
Posts: 55
Joined: Sun Jul 11, 2010 5:39 pm

Re: DockStar JTAG

Postby klingon » Sat Sep 04, 2010 1:48 pm

This is when you start Openocd in the first terminal, not in the second terminal where you do the telnet and all the other commands, so will not be able to do the reset/halt trick.
klingon
 
Posts: 5
Joined: Sun Jul 18, 2010 2:23 pm

Re: DockStar JTAG

Postby jtagfun » Sat Sep 04, 2010 1:55 pm

$this->bbcode_second_pass_quote('klingon', '')$this->bbcode_second_pass_quote('jtagfun', '
')When n_SRST is not used, do you need to push the Reset button at all (the "work around" suggested by wiki) when starting OPENOCD?


Nope. Worked as is. One thing I noticed is that if you have a working DS (not bricked), you need to start Openocd as soon as you power up. Otherwise once it starts the boot sequence, Openocd comes back with a bunch of error msgs.

That makes sense.
I have a working DS (not bricked). before I connected n_SRST, as you said "it starts the boot sequence, Openocd comes back with a bunch of error msgs".
But when I connected n_SRST, the working DS is always in "Halt" state and allows Jtag interface to work with Openocd.
I believe bricked DSs are already in Halt state and don't need n_SRST. For a working DS, either Openocd must be started ASAP after power up, or use Reset button working around, or use the n_SRST.
I just checked "sheevaplug_int" procedure (I renamed it as "dockstar_int"), there were comments like this:

proc dockstar_init { } {

# We need to assert DBGRQ while holding nSRST down.
# However DBGACK will be set only when nSRST is released.
# Furthermore, the JTAG interface doesn't respond at all when
# the CPU is in the WFI (wait for interrupts) state, so it is
# possible that initial tap examination failed. So let's
# re-examine the target again here when nSRST is asserted which
# should then succeed.
# jtag_reset 0 1 # TRST = true, SRST = true, open collector
jtag_reset 0 0 # TRST = true, SRST = true, non-inverter
feroceon.cpu arp_examine
halt 0
# jtag_reset 0 0 # TRST = true, SRST = false, open collector
jtag_reset 0 1 # TRST = true, SRST = false, non-inverter
wait_halt

It seems SRST is need to halt the processor if Uboot is working. Push and release Reset button is equivalent to toggle SRST before and after issuing halt from Openocd.
jtagfun
 
Posts: 24
Joined: Sun Aug 29, 2010 11:37 am
Top

Re: DockStar JTAG

Postby firestormv1 » Mon Sep 06, 2010 3:22 pm

Well, I am not sure what to do at this point. I was able to get rid of the errors and now OpenOCD reliably detects the processor however, I still can not get a read on 'nand probe 0'

Here is the output of the telnet session.
$this->bbcode_second_pass_code('', '
Open On-Chip Debugger
> init
> sheevaplug_init
target state: halted
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0x400000f3 pc: 0xffff0a42
MMU: enabled, D-Cache: enabled, I-Cache: enabled
> nand probe 0
unknown NAND flash device found, manufacturer id: 0x00 device id: 0x00
probing failed for NAND flash device
')

Grasping at straws, I even followed Kragorn's idea (I think) and used a laptop to IDE adapter thinking it was my smokestack adapter and I still am unable to do "nand probe 0"

My smokestack adapter is just a 2.0mm header soldered to a standard (don't know the measurement) header and is reinforced to allow me to connect and disconnect repeatedly. I figured I'd be having to do this a bunch, so I wanted a good connector.

To add to the frustration, I was able to acquire a second one which is still un-modified. When I start up OpenOCD, I hold down the reset button while issuing the halt command, then I can follow with init, sheevaplug_init and nand probe 0 and it all just works as everyone here and the howto specifies although I am extremely leary about doing anything with the bootloader as I don't want to end up with a 2nd brick on my hands. This means that everything else (PC, TAIO JTAG, OpenOCD, dockstar.cfg, wiring) all work.

I'm really out of ideas here and beginning to think that I'm just going to have to deal with a really bricked dockstar. This thing was working correctly up until the moment where I stupidly typed nand erase into uboot and has been bricked since.

Anyone have any suggestions on what I can try next? Thank you all for helping me out on this.

ETA: If I use the load image and the resume commands from the HOWTO, does the image get loaded to RAM or to the flash? I'm guessing to the RAM and only goes to the flash if a nand write.e command is issued?
firestormv1
 
Posts: 7
Joined: Fri Sep 03, 2010 6:33 pm

Re: DockStar JTAG

Postby firestormv1 » Mon Sep 06, 2010 3:48 pm

I GOT IT!!!

Ok, after bashing myself in the head with this thing long enough, I finally figured it out. On a dockstar that has NOT had it's nand erased, e.g. you didn't do something stupid like I did and type in "nand erase", you can just connect the dockstar to JTAG, fire up OpenOCD, and hit the reset switch and all is good.

IF you did nuke the NVRAM (like me), you MUST do the reset trick. Here's how it goes:

From step 3 of the HOWTO:
3: type init (DO NOT HIT ENTER!)
4: hold down the reset switch with one hand.
5: With the other hand type halt.
6: Hit enter and simultaneously release the reset switch. You should now see the following output:
$this->bbcode_second_pass_code('', '
> halt
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x000000d3 pc: 0xffff0000
MMU: disabled, D-Cache: disabled, I-Cache: disabled
')
YOU MUST GET THE "target halted in ARM state" OR IT WON'T WORK!.

7: type in "sheevaplug_init" and hit enter. If you get a similar HALT statement like the code above, it will probably say "target halted in thumb state" you must repeat the process.
8: type in nand probe 0
You should get the much wanted message:
$this->bbcode_second_pass_code('', 'NAND flash device 'NAND 256MiB 3,3V 8-bit' found')
9: Proceed to load the image and write the RAM. (from step 13)

I apologize if this is redundant to the HOWTO article, but the timing may not be emphasized enough.

I also noticed that there was a difference between halts:

Bad halt:
$this->bbcode_second_pass_code('', '
> halt
target state: halted
target halted in Thumb state due to debug-request, current mode: Undefined instruction
cpsr: 0xa00000fb pc: 0xffff0cea
MMU: enabled, D-Cache: enabled, I-Cache: enabled
')

Good halt:
$this->bbcode_second_pass_code('', '
> halt
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x000000d3 pc: 0xffff0000
MMU: disabled, D-Cache: disabled, I-Cache: disabled
')

If the proc is not halted properly, then sheevaplug_init and following commands won't work and you'll be scratching your head like I've been. :P

I want to thank everyone here for helping me out with this. Although I'm still terrified of JTAG, at least I know that if I do something stupid and brick my dockstar, I can get it back.
firestormv1
 
Posts: 7
Joined: Fri Sep 03, 2010 6:33 pm

Re: DockStar JTAG

Postby jtagfun » Wed Sep 08, 2010 10:32 am

$this->bbcode_second_pass_quote('firestormv1', 'I') GOT IT!!!
IF you did nuke the NVRAM (like me), you MUST do the reset trick. Here's how it goes:

I was able to start Openocd after I erased mtd0.

I believe if n_SRST is used properly, reset button work around should not be necessary.
jtagfun
 
Posts: 24
Joined: Sun Aug 29, 2010 11:37 am
Top

Re: DockStar JTAG

Postby bzboi » Wed Sep 08, 2010 1:23 pm

$this->bbcode_second_pass_quote('Admin', 'N')ice!!! Glad to hear all of this - can someone put it all into a big wiki page?

Already written up most of it, see my sig. Just needs updating from firestormv1 as per his findings.

$this->bbcode_second_pass_quote('jtagfun', '')$this->bbcode_second_pass_quote('firestormv1', 'I') GOT IT!!!
IF you did nuke the NVRAM (like me), you MUST do the reset trick. Here's how it goes:

I was able to start Openocd after I erased mtd0.

I believe if n_SRST is used properly, reset button work around should not be necessary.



Agreed, as stated in the Wiki, the workaround should only be needed for the Xilinx DLC5 which does not have TRST# and SRST# lines. Even then, it seems to only be required when mtd0 is erased.
Restoring factory Dockstar/Pogoplug image with a serial cable
Unbrick your Dockstar via JTAG
bzboi
 
Posts: 55
Joined: Sun Jul 11, 2010 5:39 pm
Top

Re: DockStar JTAG

Postby firestormv1 » Wed Sep 08, 2010 5:20 pm

Ok, finally got the writeup fully completed and published.

@bzboi: Since in my case I had done something stupid and nuked the flash, the reset workaround was required. Just for grins, I tested an unbricked Dockstar and it worked without the reset workaround.

You can see the writeup (complete with a ton of screenshots and pictures) here: http://wp.me/pNDfp-9B

Please let me know what you think. You are welcome to incorporate this into the Wiki as needed. (I don't even know if I have access to make changes?)

Thank you all for your help!

FIRESTORM_v1
firestormv1
 
Posts: 7
Joined: Fri Sep 03, 2010 6:33 pm

Re: DockStar JTAG

Postby bzboi » Wed Sep 08, 2010 5:49 pm

$this->bbcode_second_pass_quote('firestormv1', 'O')k, finally got the writeup fully completed and published.

@bzboi: Since in my case I had done something stupid and nuked the flash, the reset workaround was required. Just for grins, I tested an unbricked Dockstar and it worked without the reset workaround.

You can see the writeup (complete with a ton of screenshots and pictures) here: http://wp.me/pNDfp-9B

Please let me know what you think. You are welcome to incorporate this into the Wiki as needed. (I don't even know if I have access to make changes?)

Thank you all for your help!

FIRESTORM_v1


Nice writeup. I skimmed through it and it looks like you covered most of the bases I have, adding lots of good detail. I would however caution you on this:-
$this->bbcode_second_pass_quote('', 'J')ust like a new hard drive in a PC must be formatted, we will also need to erase the flash. To do this, type in “nand erase“. This will erase the entire flash chip.


I am concerned that some folk might be typing as they read and not realize till it's too late that they just erased the whole flash. I would recommend only erasing the original 512k uBoot area, as specified in my Wiki entry. That way, you also get to keep your uBoot environment parameters.

You should also mention the giveio batch file in Programs Files/OpenOCD/0.4.0/drivers/ as some folks will get an error message about I/O priviledges.

BTW, you just need to create an account on the main Arch Linux ARM Wiki and you should see the option to edit ANY Wiki entry. Please feel free to update as you see fit.
Last edited by bzboi on Wed Sep 08, 2010 6:06 pm, edited 1 time in total.
Restoring factory Dockstar/Pogoplug image with a serial cable
Unbrick your Dockstar via JTAG
bzboi
 
Posts: 55
Joined: Sun Jul 11, 2010 5:39 pm
Top

Re: DockStar JTAG

Postby firestormv1 » Wed Sep 08, 2010 6:04 pm

@bzboi - Good catch, I've updated the post to include that information.

The only reason why I erased the whole chip was because mine was already blank to begin with after an errant "nand erase" in uboot so in my case, the env vars are already blown away. :( Thankfully I have other DS's I can compare the printenv's from and recreate them in the resurrected dockstar.
firestormv1
 
Posts: 7
Joined: Fri Sep 03, 2010 6:33 pm

PreviousNext

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 30 guests