Welcome! Log In Create A New Profile

Advanced

JTAG woes

Posted by megal0maniac 
JTAG woes
April 15, 2015 03:12PM
Hello

So in the midst of procrastinating, I decided that my Dockstar's u-boot desperately needed upgrading. Of course.
I downloaded the latest one from this forum and attempted to flash it from uboot itself (tftp then write to flash)
After doing this, I had a brick.
I managed to recover it using openocd and a buspirate, but the u-boot I flashed was a bit weird and didn't have support for booting from USB etc. I think it was the stock u-boot.
From this u-boot, I attempted what I thought was a slightly different method of flashing the latest one. I was feeling brave since now I knew I had JTAG to fall back on. And of course it bricked, and now JTAG won't work.
I'm using the config file and the instructions (mostly) from here: http://plume.redox.ws/article13/dockstar-debricking-jtag-with-buspirate

I can halt the CPU in Thumb mode, but not in ARM mode. If I get it into Thumb, I get the following:
> halt
target was in unknown state when halt was requested
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

If I halt the CPU in ARM mode, I get this. It used to work:
> halt
invalid mode value encountered 3
cpsr contains invalid mode value - communication failure
in procedure 'halt'
invalid mode value encountered 3
cpsr contains invalid mode value - communication failure
Polling target feroceon.cpu failed, GDB will be halted. Polling again in 100ms
invalid mode value encountered 3
cpsr contains invalid mode value - communication failure
Polling target feroceon.cpu failed, GDB will be halted. Polling again in 300ms
...

Does anyone know what I can try to make this work? Why can't I get this device to halt in ARM mode? I can't access the flash otherwise :/
I've checked wiring multiple times, it seems to be fine.
And for bonus points, which u-boot image should I be using and how do I flash clean environment variables to the device?

Thanks in advance. Please say if I need to add more information.
Re: JTAG woes
April 15, 2015 03:22PM
megal0maniac,

I can't help you with JTAG, but regarding u-boot, after you've unbricked it, install latest Dockstar u-boot in this thread:
http://forum.doozan.com/read.php?3,12381

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: JTAG woes
April 15, 2015 03:40PM
Hi bodhi

Thanks for the link. That's the u-boot which bricked my Dockstar :P
Do you perhaps know which adresses I need to write to? I suspect that's the problem because this u-boot is running fine on another Dockstar I have.

My main problem, however, is this stupid JTAG issue. I don't know it well enough to know what that error even means. But given that I can halt the device in one mode suggests that my connections are at least good.
Re: JTAG woes
April 15, 2015 05:30PM
megal0maniac Wrote:
-------------------------------------------------------
> Hi bodhi
>
> Thanks for the link. That's the u-boot which
> bricked my Dockstar :P
> Do you perhaps know which adresses I need to write
> to? I suspect that's the problem because this
> u-boot is running fine on another Dockstar I
> have.

Do you keep the log when you flashed? it could have been that your NAND has bad blocks. Or a typo in your command. Because there is only one address that will work which is the first 4 blocks.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: JTAG woes
April 26, 2015 06:03AM
I'm afraid I did not keep a log. I did everything in a live Linux environment because I couldn't get OpenOCD to cooperate on Windows.

Good news, though. I managed to talk to it again over JTAG. I installed a more recent version of OpenOCD and it is flashing as I write this.
Once it's done, I'm not exactly sure which uboot it will start with, but would it be possible for you to help me out with the commands to update it from the uboot console? The specific addresses etc. I don't want to have to JTAG again if I can help it :)
There's some information floating around on the internet, but the instructions contradict each other so I'd trust your word more.
Re: JTAG woes
April 26, 2015 06:35AM
megal0maniac,

> Once it's done, I'm not exactly sure which uboot
> it will start with, but would it be possible for
> you to help me out with the commands to update it
> from the uboot console? The specific addresses
> etc. I don't want to have to JTAG again if I can
> help it :)
> There's some information floating around on the
> internet, but the instructions contradict each
> other so I'd trust your word more.

Sure. When you are in, you can post your JTAG console log (from beginning to the U-Boot prompt) just for completeness. You can flash the latest Dockstar u-boot with tftp or ext2load from an USB thumb drive (simpler approach).

I'll come back in about 12 hrs or so :)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: JTAG woes
April 26, 2015 07:32AM
So I followed the approach from this site while I was away from the forum: http://plume.redox.ws/article13/dockstar-debricking-jtag-with-buspirate
The u-boot is loaded into RAM, booted, then from the u-boot console written to NAND.
The u-boot header is
U-Boot 2010.09 (Oct 23 2010 - 11:49:22)
Marvell-Dockstar/Pogoplug by Jeff Doozan

It boots successfully, I write the data back to the NAND, but it does not survive a reset.

Marvell>> nand write.e 0x800000 0x0 0x80000

NAND write: device 0 offset 0x0, size 0x80000
 524288 bytes written: OK
Marvell>> reset
resetting...

And then nothing :/
So I can get this far, but somehow, I can't get uboot to stick.

Next, I'm going to try this: http://lunarius.fe80.eu/blog/openwrt-dockstar-jtag.html
It writes u-boot directly to the flash. Last I tried, I think it only worked with the u-boot on that page (uboot.j.kwb) and not Jeff's one. But I'll try again and see.
Re: JTAG woes
April 26, 2015 04:24PM
megal0maniac,

> The u-boot is loaded into RAM, booted, then from
> the u-boot console written to NAND.
> The u-boot header is
>
> U-Boot 2010.09 (Oct 23 2010 - 11:49:22)
> Marvell-Dockstar/Pogoplug by Jeff Doozan
>
>
> It boots successfully, I write the data back to
> the NAND, but it does not survive a reset.
>
>
> Marvell>> nand write.e 0x800000 0x0 0x80000
> 
> NAND write: device 0 offset 0x0, size 0x80000
>  524288 bytes written: OK
> Marvell>> reset
> resetting...
>
>
> And then nothing :/
> So I can get this far, but somehow, I can't get
> uboot to stick.
>
> Next, I'm going to try this:
> http://lunarius.fe80.eu/blog/openwrt-dockstar-jtag
> .html
> It writes u-boot directly to the flash. Last I
> tried, I think it only worked with the u-boot on
> that page (uboot.j.kwb) and not Jeff's one. But
> I'll try again and see.

It really does not matter which version, as long as it is a valid image, loaded to memory and written to NAND at the correct address. But did you erase mtd0 first? And do you have a log?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 04/26/2015 04:38PM by bodhi.
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: