Jump to content


Photo

CON4 - The Quest to Trace It. JTAG? Something else?


  • Please log in to reply
135 replies to this topic

#81 rebthor

rebthor

    Member

  • Jr. Member
  • PipPip
  • 19 posts

Posted 08 March 2011 - 03:52 PM

OK, so the instructions are done. All feedback welcome!

http://www.cobblewar...wpdnserial.html

I finally had a chance to read through the instructions. I've been following this thread from near the beginning and kudos to you on both the initial investigation and the clear instructions!

Very well done.

#82 JulieB

JulieB

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 114 posts

Posted 09 March 2011 - 05:47 PM

Impressive work there!

#83 gnarlyc

gnarlyc

    Advanced Member

  • Hero Member
  • PipPipPip
  • 96 posts
  • LocationNC

Posted 09 March 2011 - 07:29 PM

I re-worked my cable per the instructions, but it's ugly. Apparently, I also messed something up. The PDN doesn't do a thing with the serial cable connected. SO... I'm going to take a closer look and probably pull it all apart and start over. At this rate, I'll have to buy new parts! :) I'm not nearly as skilled at this as Robert. It's fun, but not easy work for me. Practice, practice, practice, I know.
Projects --> https://github.com/gnarlyc (mostly inactive)

#84 bmisiti

bmisiti

    Newbie

  • New Members
  • Pip
  • 2 posts

Posted 10 March 2011 - 09:16 PM

OK, so the instructions are done. All feedback welcome!

http://www.cobblewar...wpdnserial.html


Great writeup and pics.
Going to order the parts and start working on one.

Thanks!

Bill

#85 gnarlyc

gnarlyc

    Advanced Member

  • Hero Member
  • PipPipPip
  • 96 posts
  • LocationNC

Posted 12 March 2011 - 03:45 PM

So, I rebuilt the cable and paid more attention to random bits of solder which might connect things that are not supposed to be connected. Now, I'm back to having gibberish on boot up. Hmmm. So, I'm not really sure what's going on. Maybe my bootloader is borked too? I never picked up any more resistors, so I might try one more attempt with 4k7 resistors instead of the 3.3K. I also switched to TeraTerm, but that really shouldn't matter.

Just to make sure that I have that right... I'm using 3.3k ohm 1/4 watt resistors now. And it's my understanding that these should work, but 4.7k ohm resistors have been tested.

Sound right?

P.S. This was much easier the second time, but my cable is still ugly. :)

EDIT: I'm also not using the serial <> USB adapter. I'm going straight into a 9-pin serial.

Edited by gnarlyc, 12 March 2011 - 03:47 PM.

Projects --> https://github.com/gnarlyc (mostly inactive)

#86 RobBrownNZ

RobBrownNZ

    Advanced Member

  • Hero Member
  • PipPipPip
  • 83 posts

Posted 12 March 2011 - 04:03 PM

I'm also not using the serial <> USB adapter. I'm going straight into a 9-pin serial.

Err... can I just get this straight: are you wiring directly to the 9-pin serial on the back of your PC? If so, unplug it immediately :D

The serial port on a PC works on a different voltage range (nominally +/- 15V, usually +/- 10V or so in practice). You will never get a 3.3V device to communicate directly with a PC port, and you may damage your PDN by trying.

If you are using a level shifter between the PDN and the PC serial port, then it'll work, but the wiring will be a little different.

Can you give an infinitely detailed description of how you've wired yours up, or even better, some pictures?

Did you get my PM? I'm not sure I sent it right.

#87 LurkAzusa

LurkAzusa

    Member

  • Jr. Member
  • PipPip
  • 22 posts

Posted 12 March 2011 - 04:34 PM

Check your serial connector. Is it DTK/Intel or AT/Everex? The wiring is different and may be the cause of the jibberish.

#88 gnarlyc

gnarlyc

    Advanced Member

  • Hero Member
  • PipPipPip
  • 96 posts
  • LocationNC

Posted 12 March 2011 - 04:56 PM

Err... can I just get this straight: are you wiring directly to the 9-pin serial on the back of your PC? If so, unplug it immediately :D

The serial port on a PC works on a different voltage range (nominally +/- 15V, usually +/- 10V or so in practice). You will never get a 3.3V device to communicate directly with a PC port, and you may damage your PDN by trying.

If you are using a level shifter between the PDN and the PC serial port, then it'll work, but the wiring will be a little different.

Can you give an infinitely detailed description of how you've wired yours up, or even better, some pictures?

Did you get my PM? I'm not sure I sent it right.


:) It's ok. Yes, I grabbed a 9-pin female connector and wired into pins 2,3, & 5. It doesn't seem to have done any damage to anything. Of course, I can't tell if it damaged the PDN, but I DO still get the gibberish just like before. And the serial port is on a docking station for a laptop. I have several spares, so no big deal there...

I almost understand what you are saying.

I did just check my PMs. I usually don't notice them on Slatedroid for some reason.

I'll add pics in a bit.

EDIT: So, my intention was to follow the instructions exactly up until the serial <> USB adapter part. I then connected the three wires that go to the serial side of the adapter to my serial connector instead. It seems to make sense to me that this would work. (That's where serial should go, right? ) Of course, I do other things on a daily basis and not this, so it's quite possible that I got it totally wrong! No big deal. I'm in this to learn as much as anything.

Thanks folks!

EDIT the EDIT: On man... You really can see my soldering work in this pic. Go easy on me! :)

Attached Files


Edited by gnarlyc, 12 March 2011 - 05:17 PM.

Projects --> https://github.com/gnarlyc (mostly inactive)

#89 RobBrownNZ

RobBrownNZ

    Advanced Member

  • Hero Member
  • PipPipPip
  • 83 posts

Posted 12 March 2011 - 06:22 PM

I'm not here to criticise: as long as the electrons can get through your soldering, it's good enough. They don't care too much about aesthetics :)

But unfortunately, you are wrong about the serial connector, and you'll need to add something else to your circuit before it will work. The serial data on the PC port is the same data format as the USB-Serial adapter (as in, bit times etc), but the electrical levels are different. On the PC port, a binary '0' is represented by +10V or so, and a '1' is represented by -10V or so. On the USB-Serial and on the PDN, a '0' is 0V and a '1' is 3.3V.

The screwy voltages on the PC are a historical legacy from the days of teletype machines. Absolutely nothing uses those voltages nowadays, so everything needs a level shifter to work with PC serial ports.

I just had a quick look and didn't find any simple and convenient level shifters, although I'm sure they must be out there. If you have a USB port I'd really recommend you get a USB-serial adapter, but if you only have serial ports on the PC, let me know and we'll find a solution.

#90 gnarlyc

gnarlyc

    Advanced Member

  • Hero Member
  • PipPipPip
  • 96 posts
  • LocationNC

Posted 12 March 2011 - 06:48 PM

I'm not here to criticise: as long as the electrons can get through your soldering, it's good enough. They don't care too much about aesthetics :)

But unfortunately, you are wrong about the serial connector, and you'll need to add something else to your circuit before it will work. The serial data on the PC port is the same data format as the USB-Serial adapter (as in, bit times etc), but the electrical levels are different. On the PC port, a binary '0' is represented by +10V or so, and a '1' is represented by -10V or so. On the USB-Serial and on the PDN, a '0' is 0V and a '1' is 3.3V.

The screwy voltages on the PC are a historical legacy from the days of teletype machines. Absolutely nothing uses those voltages nowadays, so everything needs a level shifter to work with PC serial ports.

I just had a quick look and didn't find any simple and convenient level shifters, although I'm sure they must be out there. If you have a USB port I'd really recommend you get a USB-serial adapter, but if you only have serial ports on the PC, let me know and we'll find a solution.


That makes sense. I would never have known if you hadn't told me, but it makes sense. I'll get an adapter and report back. Not to be redundant, but thanks again!

EDIT: I placed the order for the adapter. It's a good thing that I picked up the PDN for only $90! ;)

Edited by gnarlyc, 12 March 2011 - 07:49 PM.

Projects --> https://github.com/gnarlyc (mostly inactive)

#91 gnarlyc

gnarlyc

    Advanced Member

  • Hero Member
  • PipPipPip
  • 96 posts
  • LocationNC

Posted 19 March 2011 - 05:32 PM

Ok folks. I have the cable together now and have u-boot. I've typed 'help' and am looking up things now. Progress!
Projects --> https://github.com/gnarlyc (mostly inactive)

#92 RobBrownNZ

RobBrownNZ

    Advanced Member

  • Hero Member
  • PipPipPip
  • 83 posts

Posted 19 March 2011 - 08:34 PM

Ok folks. I have the cable together now and have u-boot. I've typed 'help' and am looking up things now. Progress!

Nice work! :D

I did a complete reflash, writing bootloader, kernel, and filesystem, through u-boot. Very handy. I can't remember the commands, but I should try to get back to it. I know there was quite a bit of confusion with addresses, which were sometimes byte addresses and sometimes page/sector addresses.

I'm looking at why my backlight doesn't work, because frankly my PDN is going to end up in the "broken junk" pile if I can't get it going again soon.

#93 gnarlyc

gnarlyc

    Advanced Member

  • Hero Member
  • PipPipPip
  • 96 posts
  • LocationNC

Posted 20 March 2011 - 06:18 AM

Nice work! :D

I did a complete reflash, writing bootloader, kernel, and filesystem, through u-boot. Very handy. I can't remember the commands, but I should try to get back to it. I know there was quite a bit of confusion with addresses, which were sometimes byte addresses and sometimes page/sector addresses.

I'm looking at why my backlight doesn't work, because frankly my PDN is going to end up in the "broken junk" pile if I can't get it going again soon.


Don't they know that I'm already confused enough? :)

So, yeah, it looks like it's loading the kernel at 50008000, but it's supposed to be at 0x000000200000-0x000000a00000. I'll have to figure that out, but what you say sort of makes sense to me I think... Attached is the output that I get when I try to launch the recovery.

I've tried 'loadb (address)' to load img files and the kernel, but I might be getting the address wrong by what you are saying and what I'm seeing. It's always possible that I'm doing that the wrong way too, but I'll keep poking around, reading, and trying different things.

I hate that about your backlight. If you need to pick up another PDN, I'm sure some of us can help out with the cost. It seems you've had more pressing issues lately than this, I would think. The area that I live in is pretty much earthquake free, so I can barely imagine...

EDIT: I'm looking at the onenand commands now...

Attached Files


Edited by gnarlyc, 20 March 2011 - 06:31 AM.

Projects --> https://github.com/gnarlyc (mostly inactive)

#94 RobBrownNZ

RobBrownNZ

    Advanced Member

  • Hero Member
  • PipPipPip
  • 83 posts

Posted 20 March 2011 - 06:05 PM

So, yeah, it looks like it's loading the kernel at 50008000, but it's supposed to be at 0x000000200000-0x000000a00000. I'll have to figure that out, but what you say sort of makes sense to me I think... Attached is the output that I get when I try to launch the recovery.

Oh, and I forgot: there's a 32k offset at the start of the kernel for some reason, and so the kernel starts at 0x50000000 but executes at 0x50008000, or maybe I even had to load it at 0x4fff8000... I really need to look at that again. I found that writing it to the wrong address seemed to work, but the kernel would crash. Funny that!

[Edit: There's also a 64 byte offset, which is just the packing that gets put around the actual kernel image, so that U-Boot can recognise it. I hereby give up trying to remember this stuff, I'll run it up today or so and hopefully we'll be able to agree on what really happens!]

Thanks for the offer about another PDN. Money's not a problem, but getting my hands on one is: they don't sell them outside the U.S. (or maybe Canada as well). Perhaps if I wanted to get another one I could PayPal some money to someone and get them to send it over. But I haven't given up on my current one yet, so it's not an immediate issue. I got mine in San Francisco when I was over last year. I'm supposed to be going over again this year, but my wife is due to give birth in a couple of months (very inconvenient - I'll have to see if I can find out what's causing it ;) ) so my plans are fluid at the moment.

Keep updating with your progress, it's great to see someone else getting involved with this!

Edited by RobBrownNZ, 20 March 2011 - 06:59 PM.


#95 gnarlyc

gnarlyc

    Advanced Member

  • Hero Member
  • PipPipPip
  • 96 posts
  • LocationNC

Posted 21 March 2011 - 06:11 AM

Oh, and I forgot: there's a 32k offset at the start of the kernel for some reason, and so the kernel starts at 0x50000000 but executes at 0x50008000, or maybe I even had to load it at 0x4fff8000... I really need to look at that again. I found that writing it to the wrong address seemed to work, but the kernel would crash. Funny that!

[Edit: There's also a 64 byte offset, which is just the packing that gets put around the actual kernel image, so that U-Boot can recognise it. I hereby give up trying to remember this stuff, I'll run it up today or so and hopefully we'll be able to agree on what really happens!]

Thanks for the offer about another PDN. Money's not a problem, but getting my hands on one is: they don't sell them outside the U.S. (or maybe Canada as well). Perhaps if I wanted to get another one I could PayPal some money to someone and get them to send it over. But I haven't given up on my current one yet, so it's not an immediate issue. I got mine in San Francisco when I was over last year. I'm supposed to be going over again this year, but my wife is due to give birth in a couple of months (very inconvenient - I'll have to see if I can find out what's causing it ;) ) so my plans are fluid at the moment.

Keep updating with your progress, it's great to see someone else getting involved with this!


So, funny thing is... When I do a 'md 50008000 100', I see the build.prop. That seems funny to me anyway. I have to wonder if it's a left over from my bad flash? Or maybe I'm getting the addressing mixed up? Anyway. I get this feeling that I'm really, really close to being able to unbrick and use my PDN again, which is awesome. In the meantime, I hope to learn even more about it.

"very inconvenient - I'll have to see if I can find out what's causing it" - It's the water. Drink beer instead and it won't happen. That's what 'they' say. It hasn't worked for me though. Anyway, babies are fun! A lot of work, but fun.

I'm very determined to get this working and I'm old enough to be patient with it too, so I have no doubt that it will happen. (And I don't have enough money to 'move on' to another device. This is it for a while. :) )
Projects --> https://github.com/gnarlyc (mostly inactive)

#96 RobBrownNZ

RobBrownNZ

    Advanced Member

  • Hero Member
  • PipPipPip
  • 83 posts

Posted 21 March 2011 - 01:49 PM

I get this feeling that I'm really, really close to being able to unbrick and use my PDN again, which is awesome.

Somehow I hadn't realised that your PDN was unusable! I must be blind. Anyway, since you've got access to U-Boot I'm sure you'll be able to get it up and running.

#97 gnarlyc

gnarlyc

    Advanced Member

  • Hero Member
  • PipPipPip
  • 96 posts
  • LocationNC

Posted 21 March 2011 - 02:29 PM

Somehow I hadn't realised that your PDN was unusable! I must be blind. Anyway, since you've got access to U-Boot I'm sure you'll be able to get it up and running.


Yep. When this works, it will be proof that many of the bricked devices can be unbricked.

I think I'm down to just finding the memory addresses that I need to load the img's into. The offsets and addressing have confused me. And since the memory in mine doesn't look like it's supposed to look... It's hard to find things and say "oh, that's it!". :)

Also, I'm still not sure if I need to just do a loadb, load something and cp, use the onenand write command, or something else entirely. Or any of those might work? Anyway, I'm getting there.

I'm also wondering if I'm confusing DRAM and flash. lol Probably.

Edited by gnarlyc, 21 March 2011 - 02:41 PM.

Projects --> https://github.com/gnarlyc (mostly inactive)

#98 desiv

desiv

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 97 posts

Posted 21 March 2011 - 02:35 PM

Are there any commands that someone can run on a working WPDN that will help you ID the memory locations?
Preferably terminal commands from rooted WPDNs, as there are more of us with that access, but no JTAG cables..

desiv

Edited by desiv, 21 March 2011 - 02:36 PM.


#99 RobBrownNZ

RobBrownNZ

    Advanced Member

  • Hero Member
  • PipPipPip
  • 83 posts

Posted 21 March 2011 - 06:07 PM

Are there any commands that someone can run on a working WPDN that will help you ID the memory locations?
Preferably terminal commands from rooted WPDNs, as there are more of us with that access, but no JTAG cables..

desiv

Thanks for the offer! I suspect that the Flash hardware addresses are not available from inside Linux, but I'll keep it in mind.

My PDN works (apart from not being able to see the screen) so I'll be able to get addresses from U-Boot on it.

#100 RobBrownNZ

RobBrownNZ

    Advanced Member

  • Hero Member
  • PipPipPip
  • 83 posts

Posted 22 March 2011 - 05:30 AM

(Grrr... we're still having power fluctuations around here. The power went off while I was typing up a long message, and the whole thing disappeared...)

OK, I got my ol' PDN up and running. First off, I was wrong about the 32k byte and 64 byte offsets: they are relevant if you're hacking around with the kernel (which I've done a bit of, and will do more of), but they're unimportant if you're just flashing.

Some background:
The 256MB of RAM is at 0x50000000 - 0x5FFFFFFF in the CPU memory map.

The OneNAND isn't in the CPU memory map as far as I know, so you can't just look at its contents using U-Boot's md command. For example, if you do:

md 200000 100

you won't see the start of the kernel. But if you read the OneNAND into RAM you can look at it:

onenand read 51000000 200000 100
md 51000000 100

you will see the start of the kernel.

One thing that confused me is that U-Boot rounds up length parameters for OneNAND commands to the next higher 256kB boundary (0x40000). I presume that's because OneNAND operations are always 256kB (for erase and write anyway, not sure about reads).

To restore a busted PDN that has a working U-Boot, you first need some firmware to download. I really like this: kewlguy's flashloop fixer because it's small and reliable. Transferring files by kermit over the serial link is very slow! Download the file and unzip it somewhere.

Then get into U-Boot on the PDN. I'm not sure whether the OneNAND needs to be unlocked, but I do it just to be sure it works:


onenand lock off 200000 240000
onenand erase 200000 240000
loadb 51000000
<in TeraTerm, select File->Transfer->Kermit->Send, and select the "kernel" file from the zip you downloaded above>
onenand write 51000000 200000 240000

onenand lock off b00000 80000
onenand erase b00000 80000
loadb 51000000
<in TeraTerm, select File->Transfer->Kermit->Send, and select the "recovery.img" file from the zip you downloaded above>
onenand write 51000000 b00000 80000

onenand lock off 1500000 40000
onenand erase 1500000 40000
loadb 51000000
<in TeraTerm, select File->Transfer->Kermit->Send, and select the "ramdisk.img" file from the zip you downloaded above>
onenand write 51000000 1500000 40000

Then you can give U-Boot the "poweroff" command, which might make the PDN power down, although the serial adapter may keep it on so it just reboots. I sometimes pull the battery connector (carefully!). In any case, you want to put a real update zip on your SD card and do the volume up + power button reset, so the PDN updater will do the update.

I just did all this and it worked for me. Please let me know how it goes for you!

Edited by RobBrownNZ, 22 March 2011 - 05:33 AM.

  • Mark Adams, mrsburnout, desiv and 1 other like this