* Definitive guide to Bricking *

Search This thread

modest_mandroid

Senior Member
May 23, 2010
524
106
- Introduction -
This is a primer on why phones get bricked, how to recover from a brick, and how to prevent bricking your expensive hardware. I wrote this because I noticed the same questions popping up over and over, perhaps due to an instant onset of panic, from people that bricked their phones and there doesn't seem to be a single stickied thread that is dedicated to bricks. Sorry for my inability to be brief, but I would still highly recommend that you read this article in its entirety.



- The Android Boot Process -
In order to get a good understanding of why phones brick, we must have a good understanding of the boot process. All android phones have a similar boot process, so most of this information should be applicable to the i897 and any other Android handset.

So, here is what happens when you press the power button on your phone.

1. BOOT ROM - Your phone waits for the power to stabilize, then runs a piece of code that is stored in permanent rom on your cpu called the Boot Rom. The main job of this code is to detect the boot media and load it into memory (in this case, it is the First Stage Bootloader). This code is hard wired and can never be overwritten.

2. First Stage Bootloader - Once the boot rom loads the boot media, it hands control over to the First Stage Bootloader (you may see this in some roms as boot.bin). The job of this bootloader is basically to "find more ram" and load the second stage bootloader into it. When computers first boot up (even PC's), the default memory model usually only allows for very tiny programs to be loaded into memory. For this reason, there is usually two bootloaders, the first of which detects and sets up external ram and loads the second stage bootloader into it. NOTE: The first stage bootloader can be overwritten! If you damage your bootloader, you will have a permanent UNRECOVERABLE brick at this point!

3. Second Stage Bootloader - The first stage bootloader hands off execution to the Second stage bootloader (you may see this in some roms as sbl.bin) once it is loaded into memory. The job of the SBL is to "set everything up" so the main kernel can take over. It is in charge of setting up the file systems, setting up any additional memory, setting up all the hardware, bringing up the modem cpu and setting any sort of low level security that may need to be set. Fun fact: This is where your 3 button combo and "download mode" is handled. Once the hardware is set up, the sbl will look for the kernel. NOTE: The SBL can also be overwritten, meaning if you damage your SBL, you can lose your ability to boot into download mode and thus have a permanent, unrecoverable brick!

4. Kernel - The kernel, if one were to put it simply, is essentially "the os". I know there is far more to it, especially in the case of Android with Dalvik providing most of the things we typically think of as "Android". But for all intents and purposes, the kernel is the core part of the OS that handles all of the hardware interrupts, memory management, memory protection, manages file systems and drivers, threading and access to the processor, and so forth. Once the kernel is loaded into memory, it sets up anything else that needs to be set up, loads Dalvik, and from there the rest of Android is brought up. Fun fact: This is where recovery resides. NOTE: You can still brick your device at this step, though it is only a soft brick and very recoverable - nothing to lose sleep over.

Now that you have a general understanding of how Android boots, let's move on.



- But my phone is bricked -
You probably arrived at this article because it's too late and you've already botched something. You've probably read through the first part and are thinking "Ok professor, that's all good and well, but my phone is dead. Do I have to shoot myself in the head now?" The short answer is "Maybe."

The most important part of analyzing a brick is to figure out what part of the boot procedure it crapped out on. Fortunately, most of the time this is pretty easy to figure out IF YOU REMEMBER WHAT YOU WERE DOING IMMEDIATELY BEFORE THE BAD THINGS HAPPENED. If you look at the previous section, you'll notice a color coding of the various boot steps.

The reason why bad things happen to good telephones is something bad is happening during the boot process, preventing successive stages from completing. If you were flashing a rom (either through CWM or Odin) that included bootloaders and you saw that it died somewhere around the part where it was flashing boot.bin or sbl.bin, you may have a hard brick. If you think about it, it makes sense logically. It's crapping out at the part (or before) where the code that handles the key combos for download mode is being set up. If you've damaged that part of the process, there aren't really any other (easy) alternatives.

Here is a good barometer for checking if you have a hard brick:: Does something show up on your screen when you press power? (This can literally be anything - error messages, boot loops, naked chicks, that infuriating AT&T logo). If it does, congratulations! You're probably in the orange section of the boot process and can recover your phone. If not, and no matter how many times you mash the power button it stays at a black screen, you probably messed it up somewhere in the red part of the boot process and have a hard brick.



- How to recover from a brick -
If you have a hard brick (Black screen, power button isn't doing anything, multiple battery pulls didn't get you anywhere), you're probably out of luck. Sorry, dude. You can still recover it, but it'll require some surgery on your part.. You'll have to order a riff box (http://www.jtagbox.com/), remove the motherboard, and connect it to the riff box and flash your two bootloaders back onto the rom chips directly. Or, you can just do what everyone else here does and mail it back to Samsung or AT&T, with some story about how kies wrecked your junk and you have no idea wtf.

If you have a soft brick (something shows up on your screen), it's just a matter of getting your phone into recovery or download mode. Basically, when dealing with a soft brick, you want to be as unintrusive as possible to NOT MESS IT UP WORSE THAN YOU ALREADY DID. So here are a few basic procedures.

1. Don't panic.
2. Can you get into recovery?
  • Pull the battery out.
  • Put the battery back in!
  • Press and hold Volume Up, Volume Down, and Power, and wait until something shows up on the screen.
  • Release power! Keep holding Vol up+Vol down.
  • Did it go into recovery?

If that worked, try flashing a different kernel from recovery. If it still doesn't work, it's probably not the kernel but something else in the rom, so flash a different rom altogether. NOTE: The key combo for recovery is different with the new 2.3 bootloaders! It is now Vol up+power instead of Vol up+Vol down+Power.

3. If not, boot it into download mode.
  • Pull the battery out and make sure the phone is NOT connected by a usb cable.
  • Put the battery back in!
  • Hold vol up+Vol down. DO NOT PRESS POWER.
  • Plug in the USB cable.

NOTE: The key combo is different with the new 2.3 bootloaders. It is now Vol down+Power. You no longer need to connect the usb cable.

The phone should boot into download mode. If it still does not, you can try using a USB jig. They are very easy to build - it is just a 301k resistance across pins 4 and 5 of the microusb slot. You can find plenty of instructions by searching the General section. You can also find a usb breakout board here: http://www.sparkfun.com/products/10031 and 100k (make sure it's 100k and not 100) resistors at radio shack. To use the jig, simply pull the battery out, put the jig in the microusb slot, DO NOT TOUCH THE JIG WITH YOUR FINGERS AS YOU MAY CHANGE THE RESISTANCE, and put the battery back in. It should kick you into download mode within 3 seconds.

Once you are in download mode, flash back to stock. Refer to the Odin guide at the end of this article for instructions. ***NOTE***: DO NOT FLASH A ROM THAT INCLUDES BOOTLOADERS - THIS INCLUDES THE ODIN ONE CLICK PACKAGE - IT IS AN UNNECESSARY RISK AS YOUR PHONE ALREADY HAS PROPER WORKING BOOTLOADERS

I actually don't like the one-click package very much in general, simply because there seems to be an element of randomness around it. It seems to work with a certain build of phone, and seems to cause problems with newer phones.


- You may have to flash bootloaders -
So you're probably thinking, "What if I don't have a working 3 button combo?" Someone correct me if I'm wrong, but to my understanding a certain batch of phones were shipped out with corrupt sbl's. If you're one of those unlucky folks that has a phone with a busted 3 button combo, you'll have to flash new bootloaders to fix it. There is a bootloader fix package you can flash somewhere in the dev section, and if I'm not mistaken, the Cognition rom also flashes properly working bootloaders.

You will also have to flash new bootloaders if you want to upgrade from 2.1/2.2 to the official Samsung 2.3 roms (or any custom roms based off of the official 2.3's). Don't try to flash these individually if you happen to find them somewhere. The best way to get the new bootloaders is to download the stock JVB rom from www.samfirmware.com and flash it using Odin3.

Be warned - by flashing bootloaders, you may brick your phone permanently. Remember, you're flashing the red part of the boot process at this point. If things go boom, your phone ends up in an unrecoverable state. The chances of it crapping out while flashing the bootloaders may be a million to one, but there's still a chance it might happen and I've seen people brick their phone from this several times.

Be warned #2 - If you've successfully flashed working bootloaders, don't flash other bootloaders for sport. There isn't any point to it and it doesn't give you anything "extra", and even though the chances of things going sour are slim, keep it up and sooner or later you'll end up with an unresponsive device.

Be warned #3 (for 2.3 people only): Do not flash roms or odin packages that include bootloaders. I'm not entirely sure why some phones are bricking when being flashed back to stock, but something tells me that some of the odin packages are only flashing the second stage bootloader instead of both the first stage and second stage. There is probably some major incompatibility between the 2.1/2.2 first stage bootloader and the 2.3 sbl (perhaps the 2.3 sbl has a different entry point?). Either way, I've noticed that some people have perma-bricked their devices trying to flash back to stock using some of the odin packages. Flashing back to stock using a package that contains both the main bootloader and sbl should be fine (in theory), but I have not tried it and don't know how things will end up. If someone has, let me know and I'll ad it to the guide! Also - there isn't much of a point of going back to the old bootloaders once you have the new ones. I tried flashing 2.1 (JH2) and 2.2 (Serendipity 6.3) roms with the new bootloaders and everything works as expected. I didn't experience any problems or instability with either rom, and was able to boot into download mode and recovery with both.

edit: Apparently some people are reporting success with Odin one-click (JF6). Dunno dudes! Flash at your own risk.
edit edit: According to TRusselo, the odin one-click downloader (JF6) flashes both bootloaders, so it should be fine to use it to flash back to stock. Keep in mind that the JF6 one-click downloader does not work with certain handsets, and if yours is build# 1010 or above (you can check your build number by removing your battery, it should be printed on a label in the battery compartment), you should refer to this guide for how to flash back to stock:
http://forum.xda-developers.com/showpost.php?p=10056254&postcount=36
Also, I'm pretty sure the above guide will NOT flash new bootloaders. If for whatever reason you really really need the old bootloaders, I would suggest finding a package on samfirmware.com that flashes BOTH bootloaders.

- How to prevent perma-bricking -
Soft bricking is always going to happen. It's a minor software error that isn't a big deal, and common when we fiddle with our devices in ways the manufacturer never intended. The thing we worry about is hard bricking, which is fortunately for us, is easy to prevent!

Here are a few simple rules to help you avoid disaster:
  • Don't flash roms that flash bootloaders (sbl.bin)
  • Don't try to flash bootloaders individually.
  • If you have working bootloaders and can do the 3 buttom combo, don't use Odin packages that include bootloaders, they are an unnecessary risk.
  • Don't flash when you know your battery is low! Seriously, I see this happening all the time. We know you're excited about a new rom, but it can wait. Put your phone on the charger and let it sit there for a while until you have >50% charge.
  • Don't mess with your boot partition. I noticed CWM has an option to format your boot partition; I have no idea why.


- Odin guide -
You can find odin by searching the dev section. I use odin3 1.0 simply because that is what I have. I don't know if other versions are better or more stable, but it kind of doesn't matter if you aren't flashing bootloaders anyway.

There are a few videos in this thread: http://forum.xda-developers.com/showthread.php?t=919816 But I'll try to explain in text anyway.
So the first thing you need to do is DOWNLOAD THE DRIVERS! Odin won't recognize your phone in download mode if you don't have the proper drivers. You can find them here:
Windows 64bit: http://www.mediafire.com/?3dh4d6up72me9re
Windows 32bit: http://www.mediafire.com/?0b45zo7o75rc5d5

The next thing you want to do is find a rom to pop in to odin. There are a few in the dev section. There are also a lot of completely stock roms at www.samfirmware.com (WARNING: most of these include bootloaders). When I need to flash back to stock, I use this one: http://forum.xda-developers.com/showthread.php?t=751518 as it does not include bootloaders.

Open Odin and you'll notice a bunch of options. You can ignore most of them. Here is what you need to do: examine your rom package that you downloaded. If it was from samfirmware.com, just pick the files that correspond to the option name, ie if the file starts with PDA, put it in the pda slot. If it starts with CRC, put it in the CRC slot. If it's a rom you found on here, it should have come with instructions, so refer to those.

Choose a pit file. The rom should have come with a pit file, but if it didn't, you can use any pit file and it should work fine. Seriously dudes, the differences between the different pit files is negligible, there isn't any mysticism around how they work.

Unless otherwise noted, leave F. Reset Time and Auto Reboot checked. There isn't any need for repartitioning unless you are flashing back to stock from Cyanogenmod 7, in which case you NEED to select repartition.

The next thing you need to do is put your phone into download mode. Once it's in download mode and odin is set up properly, connect it to the computer. It should show up in odin under ID:COM. Once it's there, simply hit start and kick back for a while until it's done. It should reboot and you should be in Android 2.1 JH2.

*If you are using the Odin One-click downloader (JF6), the process is greatly simplified. Simply open odin, put your phone into download mode, connect it to the computer via usb, wait for odin to recognize it and hit start. Also, keep in mind that the one click downloader will flash bootloaders.

Edit: I just remembered something important. MAKE SURE YOU PLUG YOUR CABLE INTO A USB PORT THAT IS DIRECTLY CONNECTED TO THE MOTHERBOARD, OR ODIN WILL NOT RECOGNIZE IT. This usually means a usb port on the back of your computer. So, if you've installed the drivers and odin still isn't recognizing your phone, you might want to try different usb ports. If it's still not recognizing your phone, you might have a bad cable.

- Some additional ways to get into download mode or recovery -
Just thought I should point this out - you can get into both download mode and recovery through adb. You can download adb by downloading the android sdk at http://developer.android.com. It is in the 'platform-tools' folder.

To get into recovery, simply connect your phone and type 'adb devices' to make sure it is being detected. If it shows up in the list of devices, type 'adb reboot recovery'.
To get into download mode, do the above, but type 'adb reboot download' instead.


**Belatedly amending this document in lieu of old man Outler's unbrickable mod. Any place you see the word "unbrickable" in the article above, take it to mean "unbrickable (if the mod hasn't been applied)". - Jul 27 2012
 
Last edited:

bulletproof1013

Senior Member
Dec 11, 2008
910
81
Hmmm. About the 2.3 part and flashing back to stock.i am currently on the i9k gb and have flashed the bootloaders .and i also have flashed back to stock.no problems here. Any more info on that part?

Sent from my GT-I9000 using XDA Premium App
 

Dlev7

Senior Member
Nov 14, 2010
1,544
661
Which one, jf6?

Edit: Nevermind, the only one I could find is JF6, I was under the impression that there were others. Weird! Thanks for the info, made a note of it in the article.

Great read! Good stuff too, should be very helpful!

But im currently on Darky 10.0 RC5.3. With the stock JVB bootloaders. I have not had to flash back to stock with GB but in theory wouldnt this be the best way to flash back to stock with GB Bootloaders because it contains NO BOOTLOADERS, thus the only things that would be wrong when flashing back to stock are button combos, and the weird mix and different images at the boot up?

Here is the Odin Flash back to stock from icezar1:
http://forum.xda-developers.com/showthread.php?t=995143

Can anyone else comment on flashing back to stock with GB bootloaders? Im a build 1010 so I cannot use Odin One click or it just reboots the phone after a "Successful" flash and it flashes AT&T screen then turns off. So that makes me think if I were to do that let the phone "soft"-brick where it just flashes the AT&T screen. Boot it into download mode via. Jig and use this method to get back to stock: http://forum.xda-developers.com/showpost.php?p=10056254&postcount=36

Any help is GREATLY appreciated
 
  • Like
Reactions: jonathan.hemming

bulletproof1013

Senior Member
Dec 11, 2008
910
81
Well if you flashed back to stock from 2.3 without bootloaders you would still have the gb bootloaders installed .correct?

Sent from my GT-I9000 using XDA Premium App
 

Dlev7

Senior Member
Nov 14, 2010
1,544
661
Well if you flashed back to stock from 2.3 without bootloaders you would still have the gb bootloaders installed .correct?

Sent from my GT-I9000 using XDA Premium App

Ya thats why Im thinking the thing I posted above about flashing back to stock without bootloaders would be the safest way possible
 

TRusselo

Inactive Recognized Developer
Jan 20, 2011
4,736
2,931
Edmonton
great work but a couple minor edits you refer to " other odin one-click packages " (eg 3button fix) there is only ONE "odin3 one-click downloader". The other odin3 is " odin3 flashing utility " and the packages for that would not be one click packages. it is these incorrect references everywhere that are confusing to the noobs.

also in the same paragraph in red, about gingerbread bootloaders, you CAN flash other bootloader packages (eg 3button fix) BUT ONLY AFTER "Odin3 One click". (the real one click) as it repalces BOTH bootloaders and 3 button fix flashes only the 2nd bootloader, but they are still compatible so it is all good. All the other "odin packages that cause problems, only flash 2nd bootloader as well, and you cant mix a 2.3 with a 2.1/2 bootloader. So ONE CLICK FIRST then you are back to stock, test if you have working 3 button, then if not flash that, or whatever other rom with bootloader.

to be extra safe on those other odin packages, open up the tar file and look for "sbl.bin" (Secondary Boot Loader) and remove it from the odin package... before flashing. but dont do this to the 3 button fix package, it would defeat the purpose


besides that Great article!
after you edit, ill edit this.

and you might want to link to my Rogers Stock rom thread in my sig, for those odin packages and super awesome instructions AND NO BOOTLOADERS!!! (bootloader version coming though)
 
Last edited:

modest_mandroid

Senior Member
May 23, 2010
524
106
But im currently on Darky 10.0 RC5.3. With the stock JVB bootloaders. I have not had to flash back to stock with GB but in theory wouldnt this be the best way to flash back to stock with GB Bootloaders because it contains NO BOOTLOADERS, thus the only things that would be wrong when flashing back to stock are button combos, and the weird mix and different images at the boot up?

Well if you flashed back to stock from 2.3 without bootloaders you would still have the gb bootloaders installed .correct?

Should work fine. I flashed the stock JVB from samfirmware.com, then flashed back to stock a few times using the JH2 firmware mentioned in the article. I didn't flash the old bootloaders and had no problems booting up 2.1 with the new 2.3 bootloaders. The only difference I saw was the i9000 bootup screen before the AT&T logo; other than that there was no problems with the functionality of the phone.



Also, why is this not a sticky?

Zelendel is busy enjoying his easter :p

great work but a couple minor edits you refer to " other odin one-click packages " (eg 3button fix) there is only ONE "odin3 one-click downloader". The other odin3 is " odin3 flashing utility " and the packages for that would not be one click packages. it is these incorrect references everywhere that are confusing to the noobs.

also in the same paragraph in red, about gingerbread bootloaders, you CAN flash other bootloader packages (eg 3button fix) BUT ONLY AFTER "Odin3 One click". (the real one click) as it repalces BOTH bootloaders and 3 button fix flashes only the 2nd bootloader, but they are still compatible so it is all good. All the other "odin packages that cause problems, only flash 2nd bootloader as well, and you cant mix a 2.3 with a 2.1/2 bootloader. So ONE CLICK FIRST then you are back to stock, test if you have working 3 button, then if not flash that, or whatever other rom with bootloader.

to be extra safe on those other odin packages, open up the tar file and look for "sbl.bin" (Secondary Boot Loader) and remove it from the odin package... before flashing. but dont do this to the 3 button fix package, it would defeat the purpose


besides that Great article!
after you edit, ill edit this.

and you might want to link to my Rogers Stock rom thread in my sig, for those odin packages and super awesome instructions AND NO BOOTLOADERS!!! (bootloader version coming though)

Thanks dude! I didn't get a chance to proof read what I wrote; had to go to the parents' house for dinner tonight. I'll give it a read and edit per your suggestions in a bit, after I take the dog out for a walk.
 

Dlev7

Senior Member
Nov 14, 2010
1,544
661
great work but a couple minor edits you refer to " other odin one-click packages " (eg 3button fix) there is only ONE "odin3 one-click downloader". The other odin3 is " odin3 flashing utility " and the packages for that would not be one click packages. it is these incorrect references everywhere that are confusing to the noobs.

also in the same paragraph in red, about gingerbread bootloaders, you CAN flash other bootloader packages (eg 3button fix) BUT ONLY AFTER "Odin3 One click". (the real one click) as it repalces BOTH bootloaders and 3 button fix flashes only the 2nd bootloader, but they are still compatible so it is all good. All the other "odin packages that cause problems, only flash 2nd bootloader as well, and you cant mix a 2.3 with a 2.1/2 bootloader. So ONE CLICK FIRST then you are back to stock, test if you have working 3 button, then if not flash that, or whatever other rom with bootloader.

to be extra safe on those other odin packages, open up the tar file and look for "sbl.bin" (Secondary Boot Loader) and remove it from the odin package... before flashing. but dont do this to the 3 button fix package, it would defeat the purpose


besides that Great article!
after you edit, ill edit this.

and you might want to link to my Rogers Stock rom thread in my sig, for those odin packages and super awesome instructions AND NO BOOTLOADERS!!! (bootloader version coming though)

So are you saying even for someone like me who uses the One-Click and it sends my phone into a boot loop of AT&T screen then off. I should use that because it replaced the bootloaders.

Then use either button combo or my Jig to boot it into Download mode and flash the JH2 Odin via Odin3 for Build 1010+?
 

TRusselo

Inactive Recognized Developer
Jan 20, 2011
4,736
2,931
Edmonton
So are you saying even for someone like me who uses the One-Click and it sends my phone into a boot loop of AT&T screen then off. I should use that because it replaced the bootloaders.

Then use either button combo or my Jig to boot it into Download mode and flash the JH2 Odin via Odin3 for Build 1010+?
i didnt mention bootloop so slow down, boot-loaders.

you are wondering if? you used " Odin3 One-Click-Downloader " so you should use that?... - WHAT?

you shouldnt get boot loop,
everyone, including the OP says " Odin3 one click downloader " is THE WAY to flash stock. PERIOD.
after that it should boot.
THE ONLY REASON to flash ANY other stock is IF "3 button combo" doesnt work, or to flash my rogers stock. BUT ONLY AFTER one click.

thats what i said.

if you are in bootloop. try booting into recovery and doing facotry reset, clear everything. reboot.
if it doesnt work from there, try flashing one click again.
it works.

all else fails flash back to gingerbread with bootloaders, and flash back without bootloaders, using the many instructions above.
 
Last edited:

TRusselo

Inactive Recognized Developer
Jan 20, 2011
4,736
2,931
Edmonton
There is only ONE odin one click. if that is it, that is it.
if you really want THE ONE. get it from THE GB INSTRUCTIONS!
 

Dlev7

Senior Member
Nov 14, 2010
1,544
661
i didnt mention bootloop so slow down, boot-loaders.

you are wondering if? you used " Odin3 One-Click-Downloader " so you should use that?... - WHAT?

you shouldnt get boot loop,
everyone, including the OP says " Odin3 one click downloader " is THE WAY to flash stock. PERIOD.
after that it should boot.
THE ONLY REASON to flash ANY other stock is IF "3 button combo" doesnt work, or to flash my rogers stock. BUT ONLY AFTER one click.

thats what i said.

if you are in bootloop. try booting into recovery and doing facotry reset, clear everything. reboot.
if it doesnt work from there, try flashing one click again.
it works.

all else fails flash back to gingerbread with bootloaders, and flash back without bootloaders, using the many instructions above.

Odin One Click puts my build 1010 into an AT&T screen then off bootloop. I can boot it into download mode.

So that's why I used the JH2 way to flash back to stock in the method above.

You don't understand what I'm trying to say, I CANNOT USE ODIN ONE CLICK.

I may just use the JH2 method and deal with the i9000 screen flashing and different button combos

Sent from my SGH-I897 using XDA App
 

TRusselo

Inactive Recognized Developer
Jan 20, 2011
4,736
2,931
Edmonton
so you went back to gingerbread bootloaders, then flashed stock without bootloaders, keeping gingerbread ones because odin one click gave you boot-loop.

see how easy that was to say and understand?
and that method is in POST 1...

if your ability to flash is anything like your ability to explain your situation... boot-loop un-avoidable

Almost everyone uses ONE CLICK. that is not my idea! read the first post (its not me!) then read my post again.
EVERYONE suggests it if you want stock bootloaders back.
its the only way and it is KNOWN to work.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 43
    - Introduction -
    This is a primer on why phones get bricked, how to recover from a brick, and how to prevent bricking your expensive hardware. I wrote this because I noticed the same questions popping up over and over, perhaps due to an instant onset of panic, from people that bricked their phones and there doesn't seem to be a single stickied thread that is dedicated to bricks. Sorry for my inability to be brief, but I would still highly recommend that you read this article in its entirety.



    - The Android Boot Process -
    In order to get a good understanding of why phones brick, we must have a good understanding of the boot process. All android phones have a similar boot process, so most of this information should be applicable to the i897 and any other Android handset.

    So, here is what happens when you press the power button on your phone.

    1. BOOT ROM - Your phone waits for the power to stabilize, then runs a piece of code that is stored in permanent rom on your cpu called the Boot Rom. The main job of this code is to detect the boot media and load it into memory (in this case, it is the First Stage Bootloader). This code is hard wired and can never be overwritten.

    2. First Stage Bootloader - Once the boot rom loads the boot media, it hands control over to the First Stage Bootloader (you may see this in some roms as boot.bin). The job of this bootloader is basically to "find more ram" and load the second stage bootloader into it. When computers first boot up (even PC's), the default memory model usually only allows for very tiny programs to be loaded into memory. For this reason, there is usually two bootloaders, the first of which detects and sets up external ram and loads the second stage bootloader into it. NOTE: The first stage bootloader can be overwritten! If you damage your bootloader, you will have a permanent UNRECOVERABLE brick at this point!

    3. Second Stage Bootloader - The first stage bootloader hands off execution to the Second stage bootloader (you may see this in some roms as sbl.bin) once it is loaded into memory. The job of the SBL is to "set everything up" so the main kernel can take over. It is in charge of setting up the file systems, setting up any additional memory, setting up all the hardware, bringing up the modem cpu and setting any sort of low level security that may need to be set. Fun fact: This is where your 3 button combo and "download mode" is handled. Once the hardware is set up, the sbl will look for the kernel. NOTE: The SBL can also be overwritten, meaning if you damage your SBL, you can lose your ability to boot into download mode and thus have a permanent, unrecoverable brick!

    4. Kernel - The kernel, if one were to put it simply, is essentially "the os". I know there is far more to it, especially in the case of Android with Dalvik providing most of the things we typically think of as "Android". But for all intents and purposes, the kernel is the core part of the OS that handles all of the hardware interrupts, memory management, memory protection, manages file systems and drivers, threading and access to the processor, and so forth. Once the kernel is loaded into memory, it sets up anything else that needs to be set up, loads Dalvik, and from there the rest of Android is brought up. Fun fact: This is where recovery resides. NOTE: You can still brick your device at this step, though it is only a soft brick and very recoverable - nothing to lose sleep over.

    Now that you have a general understanding of how Android boots, let's move on.



    - But my phone is bricked -
    You probably arrived at this article because it's too late and you've already botched something. You've probably read through the first part and are thinking "Ok professor, that's all good and well, but my phone is dead. Do I have to shoot myself in the head now?" The short answer is "Maybe."

    The most important part of analyzing a brick is to figure out what part of the boot procedure it crapped out on. Fortunately, most of the time this is pretty easy to figure out IF YOU REMEMBER WHAT YOU WERE DOING IMMEDIATELY BEFORE THE BAD THINGS HAPPENED. If you look at the previous section, you'll notice a color coding of the various boot steps.

    The reason why bad things happen to good telephones is something bad is happening during the boot process, preventing successive stages from completing. If you were flashing a rom (either through CWM or Odin) that included bootloaders and you saw that it died somewhere around the part where it was flashing boot.bin or sbl.bin, you may have a hard brick. If you think about it, it makes sense logically. It's crapping out at the part (or before) where the code that handles the key combos for download mode is being set up. If you've damaged that part of the process, there aren't really any other (easy) alternatives.

    Here is a good barometer for checking if you have a hard brick:: Does something show up on your screen when you press power? (This can literally be anything - error messages, boot loops, naked chicks, that infuriating AT&T logo). If it does, congratulations! You're probably in the orange section of the boot process and can recover your phone. If not, and no matter how many times you mash the power button it stays at a black screen, you probably messed it up somewhere in the red part of the boot process and have a hard brick.



    - How to recover from a brick -
    If you have a hard brick (Black screen, power button isn't doing anything, multiple battery pulls didn't get you anywhere), you're probably out of luck. Sorry, dude. You can still recover it, but it'll require some surgery on your part.. You'll have to order a riff box (http://www.jtagbox.com/), remove the motherboard, and connect it to the riff box and flash your two bootloaders back onto the rom chips directly. Or, you can just do what everyone else here does and mail it back to Samsung or AT&T, with some story about how kies wrecked your junk and you have no idea wtf.

    If you have a soft brick (something shows up on your screen), it's just a matter of getting your phone into recovery or download mode. Basically, when dealing with a soft brick, you want to be as unintrusive as possible to NOT MESS IT UP WORSE THAN YOU ALREADY DID. So here are a few basic procedures.

    1. Don't panic.
    2. Can you get into recovery?
    • Pull the battery out.
    • Put the battery back in!
    • Press and hold Volume Up, Volume Down, and Power, and wait until something shows up on the screen.
    • Release power! Keep holding Vol up+Vol down.
    • Did it go into recovery?

    If that worked, try flashing a different kernel from recovery. If it still doesn't work, it's probably not the kernel but something else in the rom, so flash a different rom altogether. NOTE: The key combo for recovery is different with the new 2.3 bootloaders! It is now Vol up+power instead of Vol up+Vol down+Power.

    3. If not, boot it into download mode.
    • Pull the battery out and make sure the phone is NOT connected by a usb cable.
    • Put the battery back in!
    • Hold vol up+Vol down. DO NOT PRESS POWER.
    • Plug in the USB cable.

    NOTE: The key combo is different with the new 2.3 bootloaders. It is now Vol down+Power. You no longer need to connect the usb cable.

    The phone should boot into download mode. If it still does not, you can try using a USB jig. They are very easy to build - it is just a 301k resistance across pins 4 and 5 of the microusb slot. You can find plenty of instructions by searching the General section. You can also find a usb breakout board here: http://www.sparkfun.com/products/10031 and 100k (make sure it's 100k and not 100) resistors at radio shack. To use the jig, simply pull the battery out, put the jig in the microusb slot, DO NOT TOUCH THE JIG WITH YOUR FINGERS AS YOU MAY CHANGE THE RESISTANCE, and put the battery back in. It should kick you into download mode within 3 seconds.

    Once you are in download mode, flash back to stock. Refer to the Odin guide at the end of this article for instructions. ***NOTE***: DO NOT FLASH A ROM THAT INCLUDES BOOTLOADERS - THIS INCLUDES THE ODIN ONE CLICK PACKAGE - IT IS AN UNNECESSARY RISK AS YOUR PHONE ALREADY HAS PROPER WORKING BOOTLOADERS

    I actually don't like the one-click package very much in general, simply because there seems to be an element of randomness around it. It seems to work with a certain build of phone, and seems to cause problems with newer phones.


    - You may have to flash bootloaders -
    So you're probably thinking, "What if I don't have a working 3 button combo?" Someone correct me if I'm wrong, but to my understanding a certain batch of phones were shipped out with corrupt sbl's. If you're one of those unlucky folks that has a phone with a busted 3 button combo, you'll have to flash new bootloaders to fix it. There is a bootloader fix package you can flash somewhere in the dev section, and if I'm not mistaken, the Cognition rom also flashes properly working bootloaders.

    You will also have to flash new bootloaders if you want to upgrade from 2.1/2.2 to the official Samsung 2.3 roms (or any custom roms based off of the official 2.3's). Don't try to flash these individually if you happen to find them somewhere. The best way to get the new bootloaders is to download the stock JVB rom from www.samfirmware.com and flash it using Odin3.

    Be warned - by flashing bootloaders, you may brick your phone permanently. Remember, you're flashing the red part of the boot process at this point. If things go boom, your phone ends up in an unrecoverable state. The chances of it crapping out while flashing the bootloaders may be a million to one, but there's still a chance it might happen and I've seen people brick their phone from this several times.

    Be warned #2 - If you've successfully flashed working bootloaders, don't flash other bootloaders for sport. There isn't any point to it and it doesn't give you anything "extra", and even though the chances of things going sour are slim, keep it up and sooner or later you'll end up with an unresponsive device.

    Be warned #3 (for 2.3 people only): Do not flash roms or odin packages that include bootloaders. I'm not entirely sure why some phones are bricking when being flashed back to stock, but something tells me that some of the odin packages are only flashing the second stage bootloader instead of both the first stage and second stage. There is probably some major incompatibility between the 2.1/2.2 first stage bootloader and the 2.3 sbl (perhaps the 2.3 sbl has a different entry point?). Either way, I've noticed that some people have perma-bricked their devices trying to flash back to stock using some of the odin packages. Flashing back to stock using a package that contains both the main bootloader and sbl should be fine (in theory), but I have not tried it and don't know how things will end up. If someone has, let me know and I'll ad it to the guide! Also - there isn't much of a point of going back to the old bootloaders once you have the new ones. I tried flashing 2.1 (JH2) and 2.2 (Serendipity 6.3) roms with the new bootloaders and everything works as expected. I didn't experience any problems or instability with either rom, and was able to boot into download mode and recovery with both.

    edit: Apparently some people are reporting success with Odin one-click (JF6). Dunno dudes! Flash at your own risk.
    edit edit: According to TRusselo, the odin one-click downloader (JF6) flashes both bootloaders, so it should be fine to use it to flash back to stock. Keep in mind that the JF6 one-click downloader does not work with certain handsets, and if yours is build# 1010 or above (you can check your build number by removing your battery, it should be printed on a label in the battery compartment), you should refer to this guide for how to flash back to stock:
    http://forum.xda-developers.com/showpost.php?p=10056254&postcount=36
    Also, I'm pretty sure the above guide will NOT flash new bootloaders. If for whatever reason you really really need the old bootloaders, I would suggest finding a package on samfirmware.com that flashes BOTH bootloaders.

    - How to prevent perma-bricking -
    Soft bricking is always going to happen. It's a minor software error that isn't a big deal, and common when we fiddle with our devices in ways the manufacturer never intended. The thing we worry about is hard bricking, which is fortunately for us, is easy to prevent!

    Here are a few simple rules to help you avoid disaster:
    • Don't flash roms that flash bootloaders (sbl.bin)
    • Don't try to flash bootloaders individually.
    • If you have working bootloaders and can do the 3 buttom combo, don't use Odin packages that include bootloaders, they are an unnecessary risk.
    • Don't flash when you know your battery is low! Seriously, I see this happening all the time. We know you're excited about a new rom, but it can wait. Put your phone on the charger and let it sit there for a while until you have >50% charge.
    • Don't mess with your boot partition. I noticed CWM has an option to format your boot partition; I have no idea why.


    - Odin guide -
    You can find odin by searching the dev section. I use odin3 1.0 simply because that is what I have. I don't know if other versions are better or more stable, but it kind of doesn't matter if you aren't flashing bootloaders anyway.

    There are a few videos in this thread: http://forum.xda-developers.com/showthread.php?t=919816 But I'll try to explain in text anyway.
    So the first thing you need to do is DOWNLOAD THE DRIVERS! Odin won't recognize your phone in download mode if you don't have the proper drivers. You can find them here:
    Windows 64bit: http://www.mediafire.com/?3dh4d6up72me9re
    Windows 32bit: http://www.mediafire.com/?0b45zo7o75rc5d5

    The next thing you want to do is find a rom to pop in to odin. There are a few in the dev section. There are also a lot of completely stock roms at www.samfirmware.com (WARNING: most of these include bootloaders). When I need to flash back to stock, I use this one: http://forum.xda-developers.com/showthread.php?t=751518 as it does not include bootloaders.

    Open Odin and you'll notice a bunch of options. You can ignore most of them. Here is what you need to do: examine your rom package that you downloaded. If it was from samfirmware.com, just pick the files that correspond to the option name, ie if the file starts with PDA, put it in the pda slot. If it starts with CRC, put it in the CRC slot. If it's a rom you found on here, it should have come with instructions, so refer to those.

    Choose a pit file. The rom should have come with a pit file, but if it didn't, you can use any pit file and it should work fine. Seriously dudes, the differences between the different pit files is negligible, there isn't any mysticism around how they work.

    Unless otherwise noted, leave F. Reset Time and Auto Reboot checked. There isn't any need for repartitioning unless you are flashing back to stock from Cyanogenmod 7, in which case you NEED to select repartition.

    The next thing you need to do is put your phone into download mode. Once it's in download mode and odin is set up properly, connect it to the computer. It should show up in odin under ID:COM. Once it's there, simply hit start and kick back for a while until it's done. It should reboot and you should be in Android 2.1 JH2.

    *If you are using the Odin One-click downloader (JF6), the process is greatly simplified. Simply open odin, put your phone into download mode, connect it to the computer via usb, wait for odin to recognize it and hit start. Also, keep in mind that the one click downloader will flash bootloaders.

    Edit: I just remembered something important. MAKE SURE YOU PLUG YOUR CABLE INTO A USB PORT THAT IS DIRECTLY CONNECTED TO THE MOTHERBOARD, OR ODIN WILL NOT RECOGNIZE IT. This usually means a usb port on the back of your computer. So, if you've installed the drivers and odin still isn't recognizing your phone, you might want to try different usb ports. If it's still not recognizing your phone, you might have a bad cable.

    - Some additional ways to get into download mode or recovery -
    Just thought I should point this out - you can get into both download mode and recovery through adb. You can download adb by downloading the android sdk at http://developer.android.com. It is in the 'platform-tools' folder.

    To get into recovery, simply connect your phone and type 'adb devices' to make sure it is being detected. If it shows up in the list of devices, type 'adb reboot recovery'.
    To get into download mode, do the above, but type 'adb reboot download' instead.


    **Belatedly amending this document in lieu of old man Outler's unbrickable mod. Any place you see the word "unbrickable" in the article above, take it to mean "unbrickable (if the mod hasn't been applied)". - Jul 27 2012
    1
    Good read thanks

    Sent from my GT-I9000 using XDA Premium App
    1
    Which one, jf6?

    Edit: Nevermind, the only one I could find is JF6, I was under the impression that there were others. Weird! Thanks for the info, made a note of it in the article.

    Great read! Good stuff too, should be very helpful!

    But im currently on Darky 10.0 RC5.3. With the stock JVB bootloaders. I have not had to flash back to stock with GB but in theory wouldnt this be the best way to flash back to stock with GB Bootloaders because it contains NO BOOTLOADERS, thus the only things that would be wrong when flashing back to stock are button combos, and the weird mix and different images at the boot up?

    Here is the Odin Flash back to stock from icezar1:
    http://forum.xda-developers.com/showthread.php?t=995143

    Can anyone else comment on flashing back to stock with GB bootloaders? Im a build 1010 so I cannot use Odin One click or it just reboots the phone after a "Successful" flash and it flashes AT&T screen then turns off. So that makes me think if I were to do that let the phone "soft"-brick where it just flashes the AT&T screen. Boot it into download mode via. Jig and use this method to get back to stock: http://forum.xda-developers.com/showpost.php?p=10056254&postcount=36

    Any help is GREATLY appreciated
    1
    Odin One Click puts my build 1010 into an AT&T screen then off bootloop. I can boot it into download mode.

    So that's why I used the JH2 way to flash back to stock in the method above.

    You don't understand what I'm trying to say, I CANNOT USE ODIN ONE CLICK.

    I may just use the JH2 method and deal with the i9000 screen flashing and different button combos

    Sent from my SGH-I897 using XDA App

    If one click gives you a bootloop, the bootloaders have already done their job. So that means they were flashed properly and the issue is in the "orange zone" seems perfectly logical to me that flashing jh2 after the loop will fix it and you'll have 2.1-2 bootloaders.

    Or just flash the jh2 alone and keep the gb bootloaders like you said.
    1
    i completely apologize, i thought you were accusing me of bricking you, and bashing me for saying "one click".

    no one wants to flame on monday morning...

    Hahaha no I already know that Odin-One Click wont work (*prior experience had to use the Jig*). But I will just use the JH2 method and keep the GB bootloaders I was just wondering what people in our (Build 1010+ should do)

    And ya flame wars are more fun on the weekends....more patience...and so we wait till then.

    Thanks!