I installed CyanogenMod on my Samsung Galaxy S3 (SGH i747), and now I need to re-install factory firmware to network unlock my phone. Heimdall seems to be able to successfully image the firmware package onto the device, but after imaging, it won't boot. I can still get to recovery mode and download mode, but nothing else. This is the command I'm using to image:

heimdall flash --SYSTEM I747UCDLK3_I747ATTDLK3_I747UCDLK3_HOME.tar.md5 

This is the output:

Heimdall v1.4.1

Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna

This software is provided free of charge. Copying and redistribution is

If you appreciate this software and you would like to support future
development please consider donating:

Initialising connection...
Detecting device...
Claiming interface...
Setting up interface...

Initialising protocol...
Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Uploading SYSTEM
SYSTEM upload successful

Ending session...
Rebooting device...
Releasing device interface...

I tried factory resetting before and after imaging the ROM via ClockworkMod, but it didn't help.

How do I fix this?

NOTE: I am using Linux.

1 Answer 1


.tar.md5 file is used by Odin (another firmware flashing tool), but AFAIK it cannot be used by Heimdall. Please make a backup of this file.

Remove md5sum

Run md5sum on any file to see what is it's output like. Something similar will be appended to original .tar file. Assuming you can open the .tar.md5 file in a text editor, remove the md5 sum from the end of file (and probably you'll have to remove last new line character). Then rename this file to I747UCDLK3_I747ATTDLK3_I747UCDLK3_HOME.tar.

Extract partitions

You should be able to run tar -xf I747UCDLK3_I747ATTDLK3_I747UCDLK3_HOME.tar. It should create a new directory with similar name and this directory will contain images of boot, cache, fat, hidden, recovery and system partitions (and maybe more):

  • boot.img
  • cache.img.ext4
  • hidden.img.ext4
  • system.img.ext4


You should make sure that partitions on your device have the same names as I've written below (APPS, CACHE, HIDDEN, SYSTEM). You can do it be running heimdall download-pit --output <filename> and then heimdall print-pit --file <filename>. Finally, here's the actual flashing (you may want to add --no-reboot to the first command):

# heimdall flash --APPS boot.img --verbose
# heimdall flash --SYSTEM system.img.ext4 --CACHE cache.img.ext4 --HIDDEN hidden.img.ext4 --verbose

Re-flash recovery (added later)

In case your phone boots to recovery instead of system, you should flash your recovery (doesn't have to be stock) image again.

  • there is no hidden.img.ext4, im going to skip that step Commented Dec 11, 2016 at 16:08
  • Gets pretty close, it finishes imaging all those (Exept hidden.img.ext4) then reboots into clockworkmod. I am greeted with a prompt asking if i want to install an untrusted zip (i selected yes). the phone then reboots a few times, then boots back into clockworkmod Commented Dec 11, 2016 at 16:14
  • It worked! im back at the factory firmware! Thanks! Commented Dec 11, 2016 at 16:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .