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

Search This thread

Benjamin Dobell

Inactive Recognized Developer
Jul 1, 2010
843
600
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,917
1,657
SGH-T989
AT&T Samsung Galaxy Note I717
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
600
Melbourne
www.glassechidna.com.au
Thanks guys.

Also, I forgot to add in the README that you also need the same PIT file as the one that is installed on your device, probably version 512.

I can see by my website's bandwidth usage that people have been downloading the alpha. Has anyone tested it yet?
 
  • Like
Reactions: forest1971

Benjamin Dobell

Inactive Recognized Developer
Jul 1, 2010
843
600
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,917
1,657
SGH-T989
AT&T Samsung Galaxy Note I717
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
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
600
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
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
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
600
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.
 

mike.sw

Senior Member
Jul 31, 2010
403
23
Oh god, I'm an idiot.
Connected phone to wall charger, and was sure it's my USB cable.... *facepalm*
 

Benjamin Dobell

Inactive Recognized Developer
Jul 1, 2010
843
600
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
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
600
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
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
600
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
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!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 254
    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.
    8
    My response to the extremely rude user whose e-mail is included in my previous post:

    [Name Redacted],

    Am *I* kidding...? Really?

    Instead of whinging to developers who volunteer their free-time to provide the community with free and open-source software, perhaps you could get of your arse and contribute.

    Firstly, did you actually read the README? It includes extremely detailed steps that explain precisely how to use both Heimdall and Heimdall Frontend? Did you even bother to look for official documentation? Considering you intend to flash a device I'd say 8 hours of reading isn't at all unreasonable. You should actually have some comprehension of what it is you're trying to achieve, unless you'd like world's most expensive paperweight sitting on your desk. The process is only a disarray if you take no logical steps to understand it, the obvious first step being; read the README!

    Secondly, how in all honesty do you expect me to support every variation of Samsung device ever released? I can assure, there's a lot. I live in Australia, we don't even operate archaic CDMA networks here! The software was originally written for the international Galaxy S (GT-I9000). The fact that it works with any of Samsung's other of devices is little more than a coincidence. *If* you would like support for the Galaxy CDMA tablet, aside from implementing it yourself (it's open-source after all), then perhaps you should consider donating towards the cost of purchasing such a device. Alternatively, perhaps you would consider mailing your tablet to me and paying the postage for me to return it to you when I'm done. Then I'll volunteer *my free-time* to add support for yet another device. Because believe it or not I can't afford to spend tens of thousands of dollars purchasing every variation of every device under the sun in exchange for the occasional donation, which mind you, don't even cover my bandwidth costs!

    I strongly suggest next time you give some thought to what you write before contacting someone who gives up their free-time to help people just like you.

    - Ben
    7
    Hey everyone,

    Sorry for disappearing for a little while, I've been quite busy. However the good news is that I just managed to set aside some time to work on an update to Heimdall!

    The update will be command line only (for now) and adds the following functionality:
    - Support for the Galaxy S II! (Hopefully, keep reading.)
    - Support for SHW-M110S (Korean Galaxy S).
    - Improved support for Galaxy Tab, Captivate and Vibrants (see below).
    - No reboot option.
    - Dump the devices PIT file and print the information in a human readable format.
    - Support for more named partition parameters i.e. --hidden, --movinand.
    - One more major feature (read below).

    However the biggest change is probably the proper support for PIT files. This means that less things are hard-coded. Instead Heimdall will be grabbing data from your device's PIT file or the PIT file you specify when repartitioning. This may seem like it has minor impact on the usefulness of Heimdall but it actually allowed me to add a second method of specifying files to be flashed to your phone.

    You can now type
    heimdall --<partition identifier> <filename>
    i.e.

    This essentially means you can flash any file your device supports as long as you know the partition identifier. Of course I don't expect you to know them off the top of your head. This is where the PIT file dumping functionality comes in.
    Walah! You now have a complete list of all the files your device supports.

    Another minor change is that I've removed the restriction on needing to specify bootloaders (or any files in particular) when repartitioning. However, this was in place as a safety feature. I honestly have no idea whether repartitioning without certain files is safe, and I have no immediate plans to find out, so please be careful!

    Back to the Galaxy S II. I don't own a Galaxy S II, so I'm unable to test any changes at present. However I very much would like to own a Galaxy S II! I'm certainly not one to hold out on releasing open-source software until a certain amount of donations have been received. I don't particularly agree with that. However let's just say that I'd very much like to be able to develop (and test) for the Galaxy S II and your donations would be very much appreciated! Again, a very big thanks to those of you who have donated!!!

    Donate Link: http://www.glassechidna.com.au/donate/

    Source Code ETA: < 24 hours
    Platform-specific binaries might take a little while longer to churn out.
    5
    Source for 1.2.0 (beta) Heimdall command line tool has been pushed to Github. I'm going to get some sleep, when I wake up I'll start posting binaries.

    Galaxy S II users, let me know if it works.
    4
    I've used GUI only, and there I've needed PIT file for partition to be recognized.

    This is correct, Heimdall Frontend does require a PIT file in order to provide you with a list of possible partitions to flash. However, as mentioned in my previous comment, a PIT file is not required from command line.

    In any case, the current PIT can be downloaded from your device and saved to your computer using the "download-pit" command from command line, or from the Utilities tab in Heimdall Frontend.