Flashing ROM to Samsung Phone

On Linux there is a great Heimdall tool.  I used it recently to flash stock ROM and custom recovery (TWRP) to my old Samsung S3 mini. Best to be used from command line.

Heimdall is in Ubuntu repos (or build from source):

Steps to flash:

  1. Restart phone in download mode – push all tree button: Vol -, Home, Power
  2. Connect to USB

  3. Heimdall must always run as root.
    If phone is not found try other USB ports ( worked only on one in my notebook).
  4. Get PIT in readable form:
  5. Unzip, untar ROM archive
  6. Match file names to partition names – look into PIT dump:
    — Entry #21 —
    Binary Type: 0 (AP)
    Device Type: 2 (MMC)
    Identifier: 20
    Attributes: 5 (Read/Write)
    Update Attributes: 5 (FOTA)
    Partition Block Size/Offset: 524288
    Partition Block Count: 2457600
    File Offset (Obsolete): 0
    File Size (Obsolete): 0
    Partition Name: SYSTEM
    Flash Filename: system.img
    FOTA Filename:
  7. Flash partitions –  in case of stock ROM I did not have to flash all (probably because re-flashing same ROM back):

    To flash custom recovery:


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">