Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,737,799 Members 48,885 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE] Flashing with Heimdall

Tip us?
 
daenney
Old
(Last edited by daenney; 16th January 2011 at 12:56 PM.)
#1  
Member - OP
Thanks Meter 72
Posts: 65
Join Date: Oct 2009
Location: Enschede
Lightbulb [GUIDE] Flashing with Heimdall

Heimdall is an alternative, cross-platform tool to flash firmwares for the Galaxy S series of devices, including the Tab.

Heimdall
Some of you might not have heard but a brilliant guy one day woke up and thought 'damn it Odin' and started working on Heimdall. The guy reverse-engineered the protocol to flash our Galaxy's and turned up a piece of software called Heimdall that can do exactly the same as Odin.

This tool is open-source and runs on Qt for its GUI and libusb to communicate over USB making this tool completely cross-platform. This basically means flashing your Galaxy is not just limited to Windows anymore.

This guide will walk you through the steps to work with Heimdall. I'm a Mac user so the screenshots you'll see will be Mac-y. However, since the app and GUI are cross-platform the same apply for both Windows and Linux.

Disclaimer:

Flashing your device through anything but Kies can be a dangerous business and can brick your Galaxy S.
That said, Samsung seems to have engineered the Galaxy S series in a way that makes it relatively difficult to brick even if you **** up.

Proceed with caution and at your own discretion, both the developers of Heimdall and I can not be held accountable for the possible damage you do to your device by following this guide or using Heimdall.


Flashing with Heimdal
Flashing with Heimdall is a little bit different than with Odin. With Odin you usually select a PIT, if necessary, add the PDA.tar.md5, Modem.tar.md5 and CSC.tar.md5 to the locations, put the phone in download mode and hit go.

Heimdall takes a different approach. In the Heimdall GUI you need to select all components you want to flash. This means extracting the TAR-archives and pointing Heimdall to their respective files. This allow relative fine-grained control over what you flash and doesn't depend on files being named correctly.

In order to install Heimdall head over to the guy's website and download and install Heimdall.

Do yourself a favor, even if you're on Linux or Mac, just reboot after the install. On OS X the installation includes a kernel extension and though this can usually be reloaded by logging out and back in again the reboot is safer and can't hurt.

Quote:
Mac OS X specific
For Mac OS X the 1.1.0 version of Heimdall includes some nuked Qt binaries which means the GUI won't start. This can be fixed by afterwards installing Qt from here.

The above should not apply to the latest Heimdall release anymore according to the release notes. If however you still get errors about Heimdall failed to start, just install the Qt binaries linked above anyway, should take care of the error.

There is a second problem unfortunately on OS X. Due to a bug in older versions of the bootloader the device doesn't register correctly in download mode. If you then try to flash without having fixed the bootloader you'll nuke the Galaxy S and end up at a "black screen of death". Trust me, I tried, it broke and it scared the crap out of me.

Don't worry, this isn't the dreadful black screen of death meaning your device is busted, it just means your firmware is. You can just put it into download mode again and flash another firmware over it with Odin (Windows)

In order to avoid this we need to fix the bootloader first. Everyone who has installed the official Froyo update through Kies will already have a fixed bootloader and so you can ignore the next bit. If however you hocus-pocused around with Kies / Odin to flash Froyo like I did you probably don't have the updated bootloader.

Unfortunately we're going to need Windows for this and Kies so either get a VM ready, bootcamp into Windows or find a friend who'll lend you his pc for an hour.

See the second post, "Fixing the bootloader" for instructions.
Quote:
Linux specific

As far as I'm aware there are no Linux specific problems, not even the bootloader issue mentioned above for OS X. However, it might be wise to follow the instructions anyway since an updated bootloader can't hurt.
Quote:
Windows specific

As far as I'm aware there are no Windows specific problems, not even the bootloader issue mentioned above for OS X. However, it might be wise to follow the instructions anyway since an updated bootloader can't hurt.
Now, time to get busy.

I'm going to assume that you have downloaded a firmware, for example from samfirmware, and have extracted the .RAR and the .TAR inside and now have a folder with at least the following:
  • factoryfs.rfs (PDA > FactoryFS)
  • param.lfs (PDA > Param.lfs)
  • zImage (PDA > Kernel (zImage))

Additionally you might have:
  • cache.rfs (CSC > Cache)
  • modem.bin (Other > Modem)

Be aware, there are other configurations possible. For example, when you're rooting by flashing a rooted kernel there will probably only be a zImage.

Start Heimdall or Heimdall-frontend, you should get a screen similar to this:


Now, unless explicitly stated that you need a .PIT to flash this firmware you can leave this field blank. If you load a PIT, be sure to see if you need to repartition. The general rule is that you won't, unless you flashed with a firmware that had a different PIT than what samfirmware is indicating you need.

After that, start hitting the browse button for the components you want to flash with Heimdall and add them. Your screen will probably look something like this:


Now, it's time to put your phone in download mode. Power off the phone and wait for it to completely have shut down and unplug it from USB / charger. Hold down the Home and Volume Down buttons and then press Power. Keep holding those three buttons until you get into download mode (you'll know when you see it).

If you can't get into download mode / nothing seems to happen, you probably have a Galaxy with the broken 3-button combo problem, see here for a fix:
http://forum.xda-developers.com/showthread.php?t=785201

Now, connect the phone over USB with your computer. If you're on on Mac and Linux you can proceed immediately. If you're on Windows you'll probably need to wait for Windows to install a driver or two.

Now hit the Start button and watch it go!

If all goes well you'll see the progress bar on both Heimdall and in your phone filling up (might take a while for one to appear on the Galaxy S). Once it's done it'll probably say everything went OK and the Galaxy will reboot into recovery. Let it do it's thing, it will reboot again and begin booting the new firmware.

After having installed a new firmware the first boot might take a while. You'll just seem to be stuck at the glowing S, just let it run it will boot eventually.

If however Heimdall says "Failed" your phone will (probably) reboot or when you try to reboot you'll get stuck at the "black screen of death":



This isn't a "my device is bricked" screen, just that you ****ed up the firmware. Just follow the instructions again, put it in download mode and try again.


If, after having seen the above screen, you can't get your phone into download mode, then you're toast.
Attached Thumbnails
Click image for larger version

Name:	Screen shot 2010-12-19 at 00.19.27.jpg
Views:	109142
Size:	29.4 KB
ID:	467804   Click image for larger version

Name:	Screen shot 2010-12-19 at 00.28.17.jpg
Views:	108574
Size:	33.3 KB
ID:	467805  
device: Nokia Lumia 920
firmware: Windows Phone 8 / Portico
provider: NL KPN
The Following 31 Users Say Thank You to daenney For This Useful Post: [ Click to Expand ]
 
daenney
Old
(Last edited by daenney; 19th December 2010 at 12:16 AM.)
#2  
Member - OP
Thanks Meter 72
Posts: 65
Join Date: Oct 2009
Location: Enschede
Lightbulb Fixing the bootloader

Fixing the bootloader

In order to fix the bootloader we need to flash some firmware. There's always the risk of data loss so make a backup first!

First we need Kies available on Windows, so grab it and install it. See the XDA wiki about this.

Once Kies is done installing don't launch Kies or exit it first, then connect your Galaxy S. Let Windows purr for a while as it gets busy installing your device drivers. Once it says it's done, you can start Kies.

Now, it's time to get the Kies registry patcher. We'll use this tool to fool Kies into thinking an older version is running on the Galaxy S so that it presents us with the option to grab the Froyo update.

Once you've started Kies and Kies has recognised your phone, start the Kies registry patcher. Set the Fake mode to True and select your product code. As I'm Dutch, I selected XEN from the dropdown. There is a list on the XDA wiki to tell you which product code is suited for your country, I suggest you use that one.

Now hit the "Write registry" button and then inside Kies, select the update firmware button in the bottom right corner (the phone with the arrow). Kies will now probably tell you it has an update for your phone which should be in the JP* series or GJK3, meaning it is the Froyo update.

Tell Kies to update your phone. Kies will get busy downloading the firmware and flashing it. Your phone will reboot into download mode, once that done you'll see recovery mode and then it will start booting.

Now that you have installed the official Samsung Froyo Galaxy S update you'll have the fixed bootloader you need in order to be able to use Heimdall on OS X.
device: Nokia Lumia 920
firmware: Windows Phone 8 / Portico
provider: NL KPN
The Following 7 Users Say Thank You to daenney For This Useful Post: [ Click to Expand ]
 
behemot24
Old
#3  
behemot24's Avatar
Senior Member
Thanks Meter 94
Posts: 340
Join Date: Oct 2010
crystal clear and helpful. thank you.
 
omaga
Old
#4  
Senior Member
Thanks Meter 11
Posts: 947
Join Date: Jul 2007
Many THANKs for this Guide!! Great work
 
AllGamer
Old
#5  
AllGamer's Avatar
Retired Forum Moderator
Thanks Meter 1576
Posts: 11,521
Join Date: May 2008
Location: buried under loads of work IRL

 
DONATE TO ME
great guide !

... added to the wiki

Donation is appreciated but not required, a cup of Coffee would suffice

Samsung i9000m: on CM10
Samsung Nexus S: on JB 4.2.2
Samsung Galaxy S II SGH-T989: on CM10
Samsung Galaxy NOTE SGH-i717r: on CM10
Samsung Galaxy NOTE 3 SM-N900W8: stock 4.3
The Following User Says Thank You to AllGamer For This Useful Post: [ Click to Expand ]
 
daenney
Old
#6  
Member - OP
Thanks Meter 72
Posts: 65
Join Date: Oct 2009
Location: Enschede
Quote:
Originally Posted by AllGamer View Post
... added to the wiki
Thanks. Figured it might help some people .
device: Nokia Lumia 920
firmware: Windows Phone 8 / Portico
provider: NL KPN
 
asparta
Old
#7  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Jan 2011
Default No Windows

The reason why I'm using Heimdall is because I'm on a mac and don't have access to a Windows pc. The whole bootloader step kind of makes it impossible for me to use Heimdall. Is there a workaround?

Ps. When I say I don't have access to a windows pc, I mean it. I'm approx. 10 hours north of any major city, in the wilderness.
 
ragin
Old
#8  
ragin's Avatar
Senior Member
Thanks Meter 151
Posts: 1,724
Join Date: Dec 2007
Location: Hubli
If you had working 3-BR prior to flashing & getting the phone computer icon with a ! in the triangle, I think there is hope.

If you really blotched your flashing, & get that semi-bricked icon when you try to into download mode, Heat the phone a bit & press Vol down + Menu + Power button for a very long time. This has happened to me thrice on my SGS with working 3-BR, & the longest it took me to go into download mode was something like over 30 seconds.

Hope this helps.
if you like what I say, there is always a THANKS button below.

Super Sexy
GALAXY Note
 
Fibon@cci
Old
#9  
Junior Member
Thanks Meter 3
Posts: 23
Join Date: Sep 2009
Location: Lisboa
My Heimdall doesn't let me flash if I select a PIT file... And already tried with 3 diferent PIT files. Do you know why?
 
baul87
Old
#10  
Junior Member
Thanks Meter 1
Posts: 1
Join Date: Oct 2010
i followed the guide, but heimdall says "Failed to start Heidall"

i've a mac intel 10.6

The Following User Says Thank You to baul87 For This Useful Post: [ Click to Expand ]
Tags
flash, galaxy s, heimdall, odin
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes