[PROGRAM] Heimdall - Open-Source Cross-Platform Flashing Suite (1.4.0 Now Available)

Benjamin Dobell

Inactive Recognized Developer
Jul 1, 2010
843
596
0
Melbourne
www.glassechidna.com.au
What is Heimdall?
Heimdall is a cross-platform open-source tool suite used to flash ROMs onto Samsung Galaxy S devices.

How does it work?
Heimdall uses the same protocol as Odin to interact with a device in download mode. USB communication in Heimdall is handled by the popular open-source USB library, libusb-1.0.

Why “Heimdall”?
The flashing software Odin is named after the king of gods in Norse mythology. Loke, the software component on the Galaxy S that provides functionality to flash, may also to be named after an important character in Norse mythology, often translated as Loki. As such I have named my flashing software Heimdall, after the Norse god, and guardian of the Bifrost Bridge.

What platforms does Heimdall run on?
Linux, OS X and Windows (XP, Vista, 7 etc.)

Why use Heimdall when we can use Odin?
Odin is generally unreliable and only runs on Windows systems. Furthermore, Odin is leaked Samsung software that is not freely available or well understood by the community.

Is Heimdall safe?
No matter what method you chose, flashing firmware onto your phone has a lot of potential for disaster. We have tested Heimdall with a variety of phones flashing several different firmware versions resulting in a 100% success rate. As such we believe that Heimdall is generally reliable. However keep in mind, just like any flashing software, Heimdall has the potential to brick your phone if not used correctly.

How do Galaxy S phones get bricked when flashing?
Besides the inherent risks like power outs, accidental removal of the USB cable etc. The Galaxy S appears to be running extremely unreliable USB control software.

A failure to flash does not automatically equate to a bricked phone. However if you're extremely unlucky and the flash fails whilst transferring the primary boot-loader, secondary boot-loader or params.lfs (all quite small) than you've got yourself a paper weight that you're hoping Samsung will replace.

Please be extremely careful mixing files from different firmware releases. Don't do so unless you're certain it will work!

What Galaxy S variants has Heimdall been tested with?
We’ve tested Heimdall with a Galaxy S GT-I9000 (8 GB) from the United Kingdom and Galaxy S GT-I9000 (16 GB) from Australia. We don’t personally have access to any other devices to test with, however users have confirmed Heimdall functions correctly with the AT&T Captivate, Bell Vibrant, Telstra GT-I9000T, Epic 4G and the Galaxy Tab.

Enough talk, where can we get it?
The latest release is available here. Please read the instructions and README files included in the archives.

I love you, man. Will you have my baby?
No, but I will very gladly accept donations. If you appreciate my work and would like to support future development you can make a donation here. If you think you have something else to offer, then feel free to shoot me a PM or contact me via the contact form on the Glass Echidna website.
 
Last edited:

AllGamer

Retired Forum Moderator
May 24, 2008
11,835
1,633
0
Kudos for you! wow it looks impressive :D

A question though....

the instructions seems to be very... Windows oriented.
What about Linux or MAC OS?

Do we need to run it with WINE, or just run it as a DOS executable?

same question for MAC OS, you know people in MAC are so used to plug and play, If i were a MAC user i'll just plug my phone in, and expect to run Heimdall by click on it and have it come up.
However at the moment it seems to require Windows emulation for it to run.
 
Last edited:

Benjamin Dobell

Inactive Recognized Developer
Jul 1, 2010
843
596
0
Melbourne
www.glassechidna.com.au
the instructions seems to be very... Windows oriented.
What about Linux or MAC OS?

Do we need to run it with WINE, or just run it as a DOS executable?

same question for MAC OS, you know people in MAC are so used to plug and play, If i were a MAC user i'll just plug my phone in, and expect to run Heimdall by click on it and have it come up.
However at the moment it seems to require Windows emulation for it to run.
The alpha release is just the Windows binaries. Whilst the source code certainly compiles for OS X and Linux I want to make sure that everything is running fine on Windows first, with Odin nearby if need be.
 

AllGamer

Retired Forum Moderator
May 24, 2008
11,835
1,633
0
The alpha release is just the Windows binaries. Whilst the source code certainly compiles for OS X and Linux I want to make sure that everything is running fine on Windows first, with Odin nearby if need be.
ahh, Good to know, i was worried there for a second :)

I can't test it yet, my phone hasn't come back from repair.

i'll help test as soon as my phone is back.
 

husq510

Senior Member
Jul 6, 2010
71
3
0
go public linux binary too, else ppl will use odin instead your and you wont receive much feeback as much as if you release linux binaries.
 

Benjamin Dobell

Inactive Recognized Developer
Jul 1, 2010
843
596
0
Melbourne
www.glassechidna.com.au
go public linux binary too, else ppl will use odin instead your and you wont receive much feeback as much as if you release linux binaries.
I know it's a pain that Linux users have to wait (as usual). As much as I do want feedback, I don't want feedback from Linux users saying that the flash failed for some reason and that they don't have access to Windows/Odin.

I'm not actually sure if I'll ever release Linux binaries as binary compatibility across multiple Linux distributions is problematic. Of course once I've confirmed everything is working on other peoples' devices, what phone models are supported etc. then I will release the source code with instructions to compile for all supported platforms.

EDIT: Has Heimdall really been downloaded ~45 and no-one has bothered to install and run it? :(
 
Last edited:
  • Like
Reactions: forest1971

mike.sw

Senior Member
Jul 31, 2010
403
23
0
I'm having trouble with the following step:

4. Under Universal Serial Bus Controllers right click on the Samsung composite driver and chose Properties.

I don't have such device in device manager.
Windows 7 x86
 
  • Like
Reactions: SinisterAndroid

jodue

Senior Member
Dec 15, 2009
453
37
0
vienna
very cool stuff, thank you a lot!!!

first of all. i am a linux only user and had to run odin on a virtual box which is a pain in the ass but i fully understand your argument to first only release a windoze version to get it out of alpha state.

now, while i know that it's also possible to brick the device with odin and i have flashed several times now. i am a little afraid to try heimdall (to be honest). did you implement the additional security measures (delay+resend) after you bricked your device or before? you wrote that heimdall supports only full firmware flashes atm. it would be cool if we could also use it to just flash a kernel. any plans to implement this?

thanks!
 

Benjamin Dobell

Inactive Recognized Developer
Jul 1, 2010
843
596
0
Melbourne
www.glassechidna.com.au
I'm having trouble with the following step:

4. Under Universal Serial Bus Controllers right click on the Samsung composite driver and chose Properties.

I don't have such device in device manager.
Windows 7 x86
Is your device plugged in to your PC and in download mode?

I suppose you would also have needed to install Kies at some stage. However, Odin makes use of this driver so if Odin works it should be there.
 

Benjamin Dobell

Inactive Recognized Developer
Jul 1, 2010
843
596
0
Melbourne
www.glassechidna.com.au
very cool stuff, thank you a lot!!!

first of all. i am a linux only user and had to run odin on a virtual box which is a pain in the ass but i fully understand your argument to first only release a windoze version to get it out of alpha state.

now, while i know that it's also possible to brick the device with odin and i have flashed several times now. i am a little afraid to try heimdall (to be honest). did you implement the additional security measures (delay+resend) after you bricked your device or before? you wrote that heimdall supports only full firmware flashes atm. it would be cool if we could also use it to just flash a kernel. any plans to implement this?

thanks!
I implemented the delay and resend after my phone was bricked.

I think I was ludicrously unlucky in how my phone got bricked. Given that the primary boot loader is only 256 KiBs whilst the factory filesystem is over 250 MiB (plus other files). The chance of failing whilst the primary or secondary boot loader is being sent is quite slim.

When I was debugging Heimdall I would often intentionally stop at other points during the flash. After resetting it would just result in the connect phone to PC image being displayed (instead of booting). Then I could just restore with Odin (after several attempts) and then further restore using ClockworkMod backups.

However, by no means do I want to pressure anyone into running the software, especially whilst it's only an alpha release.

EDIT: I just realised I didn't answer your question about just kernel flashing. Yes, I definitely intend to implement functionality to only flash singular components at a time. I'd also like to implement functionality to dump files if possible. However I won't know if I can do that until I get my phone repaired or get my hands on another Galaxy S device.
 
Last edited:

mike.sw

Senior Member
Jul 31, 2010
403
23
0
Hey again
I'm looking the flash.bat and see it need two files that my firmware (I9000JPJG8) don't have in zip/tar file:
-boot boot.bin -sbl Sbl.bin

How heimdall will handle it? Is it safe to go on?
 

Benjamin Dobell

Inactive Recognized Developer
Jul 1, 2010
843
596
0
Melbourne
www.glassechidna.com.au
Hey again
I'm looking the flash.bat and see it need two files that my firmware (I9000JPJG8) don't have in zip/tar file:
-boot boot.bin -sbl Sbl.bin

How heimdall will handle it? Is it safe to go on?
Heimdall won't let you continue as the first thing it does (before connecting to your phone) is check that the specified files exist. Those two files are the primary boot loader and the secondary boot loader. I'm a bit surprised they're missing from your firmware. :confused: They're usually in the Code tar archive.

You'll have to grab them from somewhere. If you don't want to download more firmware then you can retrieve them from your device. Err, I'll update this post in a minute or two with instructions.
 
  • Like
Reactions: angelomaldito

mike.sw

Senior Member
Jul 31, 2010
403
23
0
This is one little tricky FW.
The last one I tried was I9000XWJM5 and it had 3 tar files as supposed.
This one just have one tar file, and people who installed it with Odin said to use only the PDA section with the single tar file.

I'm not sure, but it seem to work for them.

BTW in your README I think you should remind for the folks to put the pit file in the dir as well :)
Also here in WIN7 it didn't let me change the driver as simply as stated in README.
What I had to do is to use the Have Disk option, and point it to the dir. Otherwise it says that Windows already have the correct driver installed.
 
Last edited:

Benjamin Dobell

Inactive Recognized Developer
Jul 1, 2010
843
596
0
Melbourne
www.glassechidna.com.au
This is one little tricky FW.
The last one I tried was I9000XWJM5 and it had 3 tar files as supposed.
This one just have one tar file, and people who installed it with Odin said to use only the PDA section with the single tar file.
If you still have I9000XWJM5 laying around you could give that a go, it is the firmware I use.

If not you can get the boot loaders by copying them first to your sdcard using:
Code:
sudo dd if=/dev/block/bml1 of=/sdcard/boot.bin
sudo dd if=/dev/block/bml4 of=/sdcard/Sbl.bin
Clearly your phone needs to be rooted to use sudo.

EDIT: I need to go to bed now (it's actually well and truly morning here). I'll be on in 5-6 hours if you require any more help. Thanks for going to all this effort so far!
 

jodue

Senior Member
Dec 15, 2009
453
37
0
vienna
I implemented the delay and resend after my phone was bricked.

I think I was ludicrously unlucky in how my phone got bricked. Given that the primary boot loader is only 256 KiBs whilst the factory filesystem is over 250 MiB (plus other files). The chance of failing whilst the primary or secondary boot loader is being sent is quite slim.

When I was debugging Heimdall I would often intentionally stop at other points during the flash. After resetting it would just result in the connect phone to PC image being displayed (instead of booting). Then I could just restore with Odin (after several attempts) and then further restore using ClockworkMod backups.

However, by no means do I want to pressure anyone into running the software, especially whilst it's only an alpha release.

EDIT: I just realised I didn't answer your question about just kernel flashing. Yes, I definitely intend to implement functionality to only flash singular components at a time. I'd also like to implement functionality to dump files if possible. However I won't know if I can do that until I get my phone repaired or get my hands on another Galaxy S device.
thank you for the additional information on the process. i think i will give it a shot next time i want to flash a new firmware. donation is on the way!