FORUMS
Remove All Ads from XDA

How to use Heimdall

2,740 posts
Thanks Meter: 682
 
Post Reply Email Thread
Heimdall is an open-source alternative to flashing firmware to devices. It claims to be safer and a better alternative to Odin pretty much.

Although Heimdall is safer, it is still a firmware flashing tool, and like all firmware flashing tools, there could be dire consequences for not following instructions. I take no responsibility for what unexpected results or damage that may happen when following this guide. (I followed this guide on my tab though and it worked great)

- You should probably backup all important data prior to using Heimdall

First, you'll have to acquire Heimdall. You can find Heimdall releases and information here: http://www.glassechidna.com.au/products/heimdall/

- Heimdall is for Windows, OS X, and Linux
- I recommend using the command-line version over the GUI

zImage Guide
Note: For flashing of just the kernel to your device
- Command for flashing zImage
Code:
heimdall flash --kernel zImage --verbose
Files Needed:
zImage

ROM, Kernel, Modem, etc. Guide
Note: For flashing a ROM, Kernel, and Modem to your device, or for "re-stocking"
- Command for flashing complete ROM, Kernel, and Modem
Code:
heimdall flash --repartition --primary-boot boot.bin --cache cache.rfs --dbdata dbdata.rfs --factoryfs factoryfs.rfs --pit gt-p1000_mr.pit  --modem modem.bin --param param.lfs --secondary-boot Sbl.bin --kernel zImage --verbose
Files Needed for Command Above:
gt-p1000_mr.pit (partitioning)
modem.bin (modem)
boot.bin
cache.rfs
dbdata.rfs
factoryfs.rfs (file-system or ROM?)
param.lfs
Sbl.bin
zImage (kernel)


From this point on, this will mostly be a Windows-based guide. I'll use a Samsung Galaxy Tab 7" P1000 GSM and I'll re-stock using files from Overcome, and then flash the Overcome kernel afterwards. You may have to modify parts of the guide for different devices, kernels, ROMs, Operating Systems, etc.

Windows Driver Preparation
1. Install Samsung's Drivers (SAMSUNG_USB_Driver_for_Mobile_Phones.msi either from Kies or SAMSUNG_USB_Driver_for_Mobile_Phones_x86.exe from GB-Stock-Safe-v5.zip)
Note: You should reboot your computer after installing, even if it doesn't tell you to. Drivers wouldn't initialize until I rebooted.
2. Connect your Tab to your computer at least once in Normal, Recovery, and Download mode so that all drivers initialize
3. Reboot your tab to Download mode
4. Run zadig.exe
5. Go to Options > List All Devices
6. Select Samsung USB Composite Device from the dropdown box
7. Click Install Driver (accept any unsigned driver prompts you get)
8. Once Zadig says the drivers are installed successfully, close it

Windows Flashing Preparation
1. Make a folder specifically for Heimdall someplace safe
2. Copy heimdall.exe and libusb-1.0.dll to the Heimdall folder
3. Acquire GB-Stock-Safe-v5.zip, and Overcome_Kernel_v4.0.0.tar
4. Extract the contents of GB-Stock-Safe-v5.zip in a folder somewhere
Note: In the GB-Stock-Safe-v5.zip extracted folder should at least be modem folders, gt-p1000_mr.pit, and GB_Stock_Safe_v5.tar
5. Take the modem.bin from the modem of your choosing and throw it in the Heimdall folder
6. Take gt-p1000_mr.pit and throw it in the Heimdall folder
7. Extract the contents of GB_Stock_Safe_v5.tar into the Heimdall folder
Note: You should have 13 files total equaling around 391MB

Windows Flashing (Re-stocking)
1. Reboot your tab into Download mode
2. Connect it to your PC with the same USB port you used to prepare drivers
3. Open Command Prompt
4. cd into the Heimdall folder
5. Type (or copy/paste)
Code:
heimdall flash --repartition --primary-boot boot.bin --cache cache.rfs --dbdata dbdata.rfs --factoryfs factoryfs.rfs --pit gt-p1000_mr.pit  --modem modem.bin --param param.lfs --secondary-boot Sbl.bin --kernel zImage --verbose
and press Enter
Note: This will take maybe 2 minutes, but quicker then Odin
Note: When flashing is complete, tab will automatically reboot
Note: You will have to manually wipe caches and factory reset from Recovery if you see it fails to mount /data on initial boot (if you see red text, then it failed)
6. When tab finishes booting, complete the Setup Wizard
Note: If you are going to flash another ROM (such as icedBOCA, CM9, etc), then just press Next through all of setup. Language will be Italian, but this does not matter for now
Note: If you just want to return to a pure factory state, this is as far as you should go
Note: This does not seem to wipe the internal SD card. For the cleanest experience possible, I recommend manually formatting the internal SD card right after the Setup Wizard

Windows Flashing (Overcome Kernel)
Note: This will convert partitions to ext4 and give you CWM recovery
Note: This is to be done after you have re-stocked
1. Acquire Overcome_Kernel_v4.0.0.tar
Note: You should have this already if you followed Windows Flashing Preparation
2. Copy heimdall.exe and libusb-1.0.dll to a new Heimdall folder
Note: Or use the same Heimdall folder you had previously
Note: I'll refer to the new folder as Heimdall2
3. Extract the zImage file from Overcome_Kernel_v4.0.0.tar to the Heimdall2 folder
4. Reboot your tab into Download mode
5. Connect it to your PC with the same USB port you used to prepare drivers
6. Open Command Prompt
7. cd into the Heimdall2 folder
8. Type (or copy/paste)
Code:
heimdall flash --kernel zImage --verbose
Note: This should take less then 5 seconds
Note: Your tab should automatically reboot when completed
9. Your tab should now convert partitions to ext4
Note: This is known as the Voodoo lagfix
Note: You will be stuck on the SGT bootscreen until this process is done
Note: You will hear a "sexy" voice telling you the steps of the ext4 process
Note: This process should take maybe 3-5 minutes
Note: Your tab will automatically reboot when complete, so you can walk away if needed
10. You are now on Gingerbread with Overcome kernel

- From this point on, you can now proceed to install (most, if not all) any compatible ROM/Kernel you want
- You should not need Heimdall from this point on also, as most ROM's and Kernels offer .zip packages that can be flashed from CWM/Recovery

Note: For any new ROM you flash, I recommend doing a data wipe afterwards, that way, you can gain access to the Setup Wizard and properly setup your Google Account, Market Sync, etc.

Windows Troubleshooting and Q&A

Q: I get a libusb error when trying to flash anything with Heimdall
A: This is due to either improper driver installation or using another USB port then the one you used to install the drivers
Note: You have to use zadig
Note: I would recommend uninstalling all previous USB filter drivers as well if you have problems

Q: Is it possible to use both Heimdall and Odin?
A: Yes, but it is recommended to have two USB ports. Do the zadig driver install on one USB port, and that port will be for Heimdall, and the second USB port will be untouched, and you'll be able to use Odin on it
Note: You cannot use Heimdall and Odin on the same port without uninstalling/installing the libusb filter driver from zadig that Heimdall needs

Q: Is Heimdall really faster then Odin?
A: Indeed. It's faster to start the flashing process, and faster to flash in-general. For instance, to re-stock my tab, I simply plug it into my Heimdall USB port, run a batch file (simply containing the command used above), and it's re-stocked in about 1 minute. With Odin, you have to manually select the files, and then flashing itself takes 2-3 minutes.
The Following 13 Users Say Thank You to espionage724 For This Useful Post: [ View ] Gift espionage724 Ad-Free
 
 
2nd March 2012, 07:26 AM |#2  
espionage724's Avatar
OP Senior Member
Thanks Meter: 682
 
Donate to Me
More
it would appear Heimdall does not work on Windows Consumer Preview (zadig fails, saying the OS rejects unsigned drivers)
6th March 2012, 11:04 AM |#3  
Senior Member
Thanks Meter: 19
 
More
Good tutorial, thanks.

Is this tool only feasible for Samsung devices, or also for most other Android ones?

Two annoyances from this tool:
1. It does not have some facility (like a specific command line option) to reveal to the user that the connection to a "download mode" device (i.e., no way to tell if the driver is working)
2. After the --print-pit option (I used this to confirm that the communication is setup properly) will reboot the device, I think just printing something will cause a device reboot is extremely unexpected...

By the way, your title seems to misspelled the keyword "heimdall".
The Following User Says Thank You to zeroxia For This Useful Post: [ View ] Gift zeroxia Ad-Free
4th June 2012, 11:03 PM |#4  
GoSooners345's Avatar
Senior Member
Flag Joplin, MO
Thanks Meter: 469
 
More
factoryfs.rfs is the Factory installed filesystem and its the main rom
The Following User Says Thank You to GoSooners345 For This Useful Post: [ View ] Gift GoSooners345 Ad-Free
27th November 2012, 09:40 AM |#5  
Senior Member
Flag Android
Thanks Meter: 15
 
More
I have data.img... where I put it? datafs?

I am using heimdall frontend 1.3.1
14th December 2012, 01:34 AM |#6  
Junior Member
Thanks Meter: 0
 
More
what to do if wipe cache and recovery fail, the red text mount data? I followed all your steps but still stuck at samsung screen.
15th December 2012, 05:57 AM |#7  
goofey2012's Avatar
Member
Thanks Meter: 10
 
More
How to flash hidden.rfs by heimdall?

Sent from my GT-P1000
22nd January 2013, 10:36 PM |#8  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by goofey2012

How to flash hidden.rfs by heimdall?

Sent from my GT-P1000

--hidden hidden.rfs

Quote:
Originally Posted by zeroxia

annoyances from this tool:
1. It does not have some facility (like a specific command line option) to reveal to the user that the connection to a "download mode" device (i.e., no way to tell if the driver is working)
By the way, your title seems to misspelled the keyword "heimdall".

heimdall detect

Quote:
Originally Posted by zeroxia

2. After the --print-pit option (I used this to confirm that the communication is setup properly) will reboot the device, I think just printing something will cause a device reboot is extremely unexpected...

heimdall print-pit --no-reboot
24th January 2013, 07:45 PM |#9  
Junior Member
Thanks Meter: 0
 
More
Thanks!!!
27th February 2013, 06:01 AM |#10  
Junior Member
Thanks Meter: 2
 
More
heimdall syntax / files confusion
Hello all.

I imagine this is a noob question but I am stuck and reluctant to flash random files in hopes of getting it right.

I have these files from an extracted tar.md5 (T999UVDLJA_T999TMBDLJA_T999UVDLJA_HOME.tar.md5).
I'm trying to use heimdall to restore a SGS3 (d2tmo/T999) with a Stock ROM without bumping the flash counter. I only use Linux, so...

aboot.mbn
boot.img
cache.img.ext4
NON-HLOS.bin
recovery.img
rpm.mbn
sbl2.mbn
sbl3.mbn
SS_DL.dll (not needed, eh?)
system.img.ext4
tz.mbn

But I do not know what to do with the "*.mbn" files or the "NON-HLOS.bin"

I'm guessing the syntax is something like:

heimdall flash --primary-boot boot.img --cache cache.img.ext4 --recovery recovery.img --factoryfs system.img.ext4 ...

But I have a lot of files left over. Would someone kindly confirm that part is correct and fill in the rest of the blanks?

$ heimdall version
v1.4 RC1

Thank you for your time,
27th February 2013, 06:24 AM |#11  
Senior Member
Thanks Meter: 1,281
 
More
this is actually a Galaxy Tab 7" forum.

But anyway, your questions was answered (somewhat) by the heimdall author

https://github.com/Benjamin-Dobell/Heimdall/issues/82

look for the last comment
The Following User Says Thank You to priyana For This Useful Post: [ View ] Gift priyana Ad-Free
Post Reply Subscribe to Thread

Tags
flash, guide, heimdall, p1000, windows

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes