Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Totally bricked when downgrading. Is there a Jtag pinout/service manual? Or buy new?

777
  1. [translate]    #1
    Member
    Join Date
    Mar 2010
    Location
    dp.ua
    Posts
    33

    Default Totally bricked when downgrading. Is there a Jtag pinout/service manual? Or buy new?

    Hi,

    After downgrade attempt my Spica doesn't even turn on. Is there anything I can do?
    I'm OK with making an own jtag - my friend can do this.

    (And don't you try to do what I did!)

    I tried to downgrade from CyanogenMod-7.1.0-RC0-Spica-alpha4, flashed SGM-froyo-BETA2.1.zip from recovery.
    Wiped all caches before and after application.

    Spica stopped booting: after first bootlogo screen went dark every time. I could still boot to recovery or download mode.

    I flashed CM 6.1 one package via Odin, which helped me before.

    After the flash finished, the phone didn't reboot - and didn't ever since.

    Battery removal didn't help.
    Looks like I need new phone or is there anything I can do?

  2. [translate]    #2
    Moderator
    Join Date
    Jun 2010
    Location
    Warsaw, Poland
    Posts
    2,828

    Default

    The JTAG connector is hidden behind the sticker with IMEI, with following pin-out:
    i5700pinout.jpg

    I have successfully flashed a fully bricked phone (after using a wrong bring-up image from i5800 in a lame 3rd party service center...) using just (ARM Linux) GDB connected to J-Link GDB server (OpenOCD should also do) and my OneNAND flasher, attached to this post. I believe you need to flash Pbl and Sbl using it, attached them too.

    The way it works is very simple. Target flash image has to be uploaded at address 0x50000000 (beginning of the RAM) and the flasher can be uploaded anywhere in the RAM. Then you jump to the flasher, wait several seconds until it completes and reset the phone. You can make sure that it completed by adding a breakpoint at the last instruction of the flasher which is just an infinite loop. You can extract the address (or rather offset) by disassembling the resulting binary using objdump, like

    Code:
    armv6zk-unknown-linux-gnueabi-objdump -D -b binary flasher.bin --architecture=arm
    In (ARM Linux) GDB it would look like:
    Code:
    > restore boot.bin binary 0x50000000
    > restore flasher.bin binary 0x51000000
    > break *0x510000ec # this address depends on flasher compilation options, it's just an example
    > jump *0x51000000
    OneNAND flasher written be me (see code comments for more details): flasher.tar.gz

    Bootloader images: bootloaders.tar.gz
    Last edited by tom3q; 07-26-2011 at 03:43 PM.

  3. [translate]    #3
    Senior Member
    Join Date
    Jun 2010
    Location
    india
    Posts
    135

    Default

    Guys don't you think we should find out what is the ugly cause after all these bricks. I am not much afraid of losing my Spica, but afraid of losing the thrill and excitement of being here at Samdroid, which I may lose if I lose my phone
    CM 7.1 Tom3Q
    its time to remove samsuck logo from phone and write Tom3Q

  4. [translate]    #4
    Senior Member
    Join Date
    Jul 2010
    Location
    india
    Posts
    834

    Default

    Thank you tom3q

    Sent from my GT-I5700 using Tapatalk

  5. [translate]    #5
    Moderator
    Join Date
    Jun 2010
    Location
    Warsaw, Poland
    Posts
    2,828

    Default

    Quote Originally Posted by nipungupta7 View Post
    Guys don't you think we should find out what is the ugly cause after all these bricks. I am not much afraid of losing my Spica, but afraid of losing the thrill and excitement of being here at Samdroid, which I may lose if I lose my phone
    It's just a wrong design of flash memory handling by Samsung. Especially the whole XSR system, which is not only a kernel module, but a complete system for managing NAND flash memories including partition layout, bad block remapping, internal meta data, etc.

    The primary (also called primitive) boot loader (Pbl) relies on correctness of these meta data when loading the second (secure?) boot loader (Sbl), in the same time not having any fail-safe recovery system (usb download mode), provided only by Sbl. So guess what can happen if a kernel level code (XSR module) corrupts some meta data. Same can happen with Odin which just uploads the images to the phone and they are handled by the boot loader using its internal XSR code.

    Other point is why the meta data get corrupted. To me it looks like a bug in XSR code, most probably a race condition which triggers only when some specific conditions are met, which can be some kernel configuration options, some events received from OneNAND controller, some requests received from the user space, pretty much everything.
    Last edited by tom3q; 07-26-2011 at 06:13 PM.

  6. [translate]    #6
    Member
    Join Date
    Mar 2010
    Location
    dp.ua
    Posts
    33

    Default

    Thank you a lot tom3q! Will try to compile and run this. We happen to have jlink here at work, will see.

    What do you think, could Odin include additional range checks and prohibit flashing in an overriding file? It won't give a 100% guarantee, but at least some level of security.

    BTW, once I flashed that image and it was OK. Is it possible that bootloader was moved in 2.3? That ROM's logo size is 112687 bytes - should it overwrite bootloader?

  7. [translate]    #7
    Moderator
    Join Date
    Jun 2010
    Location
    Warsaw, Poland
    Posts
    2,828

    Default

    The logo can't overwrite any of the boot loaders, because it's located after both of them. The only thing it can overwrite is the param block, but it begins at 192th kilobyte of the logo partition. This case should be recoverable from a serial console, using an UART JIG and a TTL-RS232 level converter.

    We don't have Odin sources, so we can't modify it (not counting binary patching). Anyway, Odin won't be used anymore with my kernel, which will use only recovery based flashing (and because of getting rid of kernel level XSR and accessing the flash directly with Linux MTD API and some other magic which I will describe a bit later, because it's not ready yet).

    As for boot loaders, most of ROMs don't touch it. Also they can't be moved, because their location is hard coded into respective lower level boot loaders (i.e. Ibl has the location of Pbl hard coded and Pbl has the location of Sbl hard coded). My guess is that you met a kernel level XSR meta data corruption, which caused Sbl to flash the image incorrectly. In addition that CM One image contains both Pbl and Sbl inside and they get flashed, so if the flashing fails they can be left corrupted.
    Last edited by tom3q; 07-26-2011 at 06:24 PM.

  8. [translate]    #8
    Senior Member
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    789

    Default

    Quote Originally Posted by tom3q View Post
    It's just a wrong design of flash memory handling by Samsung. Especially the whole XSR system, which is not only a kernel module, but a complete system for managing NAND flash memories including partition layout, bad block remapping, internal meta data, etc.

    The primary (also called primitive) boot loader (Pbl) relies on correctness of these meta data when loading the second (secure?) boot loader (Sbl), in the same time not having any fail-safe recovery system (usb download mode), provided only by Sbl. So guess what can happen if a kernel level code (XSR module) corrupts some meta data. Same can happen with Odin which just uploads the images to the phone and they are handled by the boot loader using its internal XSR code.

    Other point is why the meta data get corrupted. To me it looks like a bug in XSR code, most probably a race condition which triggers only when some specific conditions are met, which can be some kernel configuration options, some events received from OneNAND controller, some requests received from the user space, pretty much everything.
    In other words, it's a bug we can't predict
    Creator of apKitchen -> apkitchen.pt.vu

    Android App here

    CM+X 14.2

  9. [translate]    #9
    Member
    Join Date
    Mar 2010
    Location
    dp.ua
    Posts
    33

    Default

    Quote Originally Posted by Maxxd View Post
    In other words, it's a bug we can't predict
    Well, there always could be some facilities, like basic sanity/consistency checks, CRCs for the metadata (whatever it is) etc.

    BTW still waiting for my friend to solder a jack to JTag. Will let you know how it goes.

  10. [translate]    #10
    Senior Member
    Join Date
    Mar 2011
    Location
    Top Fucking Secret
    Posts
    159

    Default

    @tom3q
    Is it possible to flash Spicas with other OS (kind of Linux for ARMs, Windows Mobile, MeeGo) using JTag?

    It would be great having Spica with MeeGo.

    Tapatalked from my Galaxy Spica
    sunbeam@my-spica

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •