• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

How to flash recovery using Linux and Heimdall? (SOLVED)

Search This thread

sergegalun

New member
Feb 24, 2021
4
0
Hi. Decided to try to give some new life to this old thing. But when I install the TWRP thing and shut it down it immediately boots up and overwrites the TWRT. I know the instructions says to let go of the buttons "very fast", but I've been practising this for hours now and I'm pretty sure it's impossible to do it any faster. I did try to open it up but it doesn't look like the battery is very easily accessible, bit worried about messing around in there while it's turned on. I've been considering just letting it run out of power, but if you guys have a better solution that would be great.
 

sergegalun

New member
Feb 24, 2021
4
0
Slight status update. Tried to let the thing just run out of power, but it didn't work. Then I found out that the key to restarting it properly was to boot it back into recovery mode before it has time to automatically reboot. So I've taken care of that part. But it seems as if the installation of TWRP just never happens despite that it looks like it is.

Code:
heimdall flash --RECOVERY twrp-3.5.0_9-0-chagallwifi.img --no-reboot                                                             1 ⨯
Heimdall v1.4.2

Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

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

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

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 RECOVERY
100%
RECOVERY upload successful

Ending session...
Releasing device interface...

I get the blue line, but it finishes very fast, in like a second, no where near the two minutes Heimdall says it could take. And in the instructions it says I'm supposed to get a message on the pad saying it's completed, and that never happens. So I'm thinking the TWRP image is uploaded to the device but it's never flashed.

The device says:
Code:
ODIN MODE
PRODUCT NAME: SM-T800
CURRENT BINARY: Custom
SYSTEM STATUS: Custom
Secure Download : Enabled
KNOX WARRANTY VOID: 1 (0x0304)
RP SWREV: A1

No indication of it installing anything or being complete. If anyone has any idea why this might be happening I'd love to know. I'm following these instructions by the way https://wiki.lineageos.org/devices/chagallwifi/install
 

retiredtab

Senior Member
Nov 16, 2017
940
514
This is the way I do it.

1. Boot into download mode.

2. heimdall flash --RECOVERY twrp-3.5.0_9-0-chagallwifi.img

3. As soon as you hit enter in step 2, start holding down the recovery mode keys. This is important as per document "NOTE: Be sure to reboot into recovery immediately after installing the custom recovery. If you don’t the stock ROM will overwrite the custom recovery with the stock recovery, and you’ll need to flash it again."

4. Keep holding those buttons until you see TWRP.
 

sergegalun

New member
Feb 24, 2021
4
0
This is the way I do it.

1. Boot into download mode.

2. heimdall flash --RECOVERY twrp-3.5.0_9-0-chagallwifi.img

3. As soon as you hit enter in step 2, start holding down the recovery mode keys. This is important as per document "NOTE: Be sure to reboot into recovery immediately after installing the custom recovery. If you don’t the stock ROM will overwrite the custom recovery with the stock recovery, and you’ll need to flash it again."

4. Keep holding those buttons until you see TWRP.

Thanks. But I'm starting to think my issue is bigger than that as every time I do this it just boots back into the regular Android thing, and I've done it like 30 times now. I don't think Heimdall is flashing anything, it's just uploading the file then nothing. I was under the impression that it overwrites the TWRP as soon as I start it up gain, but I'm rebooting into recovery so fast now that that the screen is only black for a second, and if it overwrites it that fast then I don't know what else to do.

Do you get an indication on the Android screen that flashing has completed?

My instructions say this "NOTE: The device will continue to display Downloading... Do not turn off target!! even after the process is complete. When the status message in the top left of the devices’s display reports that the process is complete, you may proceed."

But I don't get any message in the top left corner saying it complete.
 

retiredtab

Senior Member
Nov 16, 2017
940
514
I just did it the way I wrote. No problems booting into TWRP 3.5.0.9. Here's the log.
Code:
$ heimdall flash --RECOVERY twrp-3.5.0_9-0-chagallwifi.img
Heimdall v1.4.2

Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

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

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

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 RECOVERY
100%
RECOVERY upload successful

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

retiredtab

Senior Member
Nov 16, 2017
940
514
On my tablet, to boot into recovery mode, it's power + volume button farthest away from the power + home key. Hold all three until you see TWRP logo.
 

sergegalun

New member
Feb 24, 2021
4
0
On my tablet, to boot into recovery mode, it's power + volume button farthest away from the power + home key. Hold all three until you see TWRP logo.
Yes. That was my mistake. On the default loader the keys are "home+volume down+power" but to boot TWRP it's "home+volume up+power". As soon as I did that it worked. Thanks for the help.
 

retiredtab

Senior Member
Nov 16, 2017
940
514
Yes. That was my mistake. On the default loader the keys are "home+volume down+power" but to boot TWRP it's "home+volume up+power". As soon as I did that it worked. Thanks for the help.
I find that on some tablets, it's not obvious which is volume up and volume down depending on what it considers the default orientation. That's why I wrote it farthest away from power button.
 

Hutzpah

New member
Mar 28, 2012
3
0
I hope its alright to post here.

Having a similar problem, I am trying to install pit plus recovery file (twrp-3.0.2-0-J1 acelte.img) on to a Samsung Galaxy J1 (2016) Model SM-J120ZN without success.
I’m using Heimdall on linux, it seems to be flashing correctly but I
can’t boot into twrp recovery, even though after starting the flashing in Heimdall
I push volume Up + Home +power as fast as I can.
Any idea whats wrong?

Thanks
 

Hutzpah

New member
Mar 28, 2012
3
0
I hope its alright to post here.

Having a similar problem, I am trying to install pit plus recovery file (twrp-3.0.2-0-J1 acelte.img) on to a Samsung Galaxy J1 (2016) Model SM-J120ZN without success.
I’m using Heimdall on linux, it seems to be flashing correctly but I
can’t boot into twrp recovery, even though after starting the flashing in Heimdall
I push volume Up + Home +power as fast as I can.
Any idea whats wrong?

Thanks
I found it here
All sweet and working.
 

jirido

Member
Dec 3, 2021
8
0
Suomi
Hi. I have had problems with flashing twrp to recovery. The device I try to flash is a GALAXY TAB 4 t535 from 2014 with android 5.0.2 and a security patch from 2017-03-01. The kernel is 3.4.01023903, buildnr LRX22G T535XSS1BRH1.

I try to flash it from an arch linux with both adb/fastboot v1.0.41 and Version 31.0.3-android-tools
Also I have tried heimdall v1.4.2

"adb devices" finds the device as 10e0a213 but using fastboot with the device in download mode, ie trough "adb reboot-bootloader", fastboot can not find any device. I have made a rule so that my linux mount the device as "user", ie jirido but also tried both as root and with sudo.

lsusb tells me:
Bus 001 Device 031: ID 04e8:685d Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II] (Download mode)

ls -l /dev/bus/usb/001/031 tells me
crw-rw-rw-+ 1 jirido adbusers 189, 30 4 dec 15.05 /dev/bus/usb/001/031

Still no device shows up with fastboot.

When using heimdall I write to the device but it seam like it actually can't write the image down even thou the blue line shows up.

Here I flash the tar image but I have also tried with the .img image both with the recovery name and its original twrp-xxx name.
The results have been the same. No luck and stock recovery.
---------------------------------------------------------------------
$ heimdall flash --RECOVERY ./Downloads/recovery.tar --no-reboot
Heimdall v1.4.2

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

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

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 RECOVERY
100%
ERROR: Failed to confirm end of file transfer sequence!
ERROR: RECOVERY upload failed!

Ending session...
Releasing device interface...

----------------------------------------------------------------------
I then reboot directly to the recovery.. and right as expected there is the stock recovery.
From this I draw the conclusion that recovery is still unwritable.

Following this conclusion I searched and found out that I should toggle the "OEM unlock" setting that can be found under "developer options". But when I looked, it wasn't there. After searching some more on dear internet I found information that told me about a bunch of tricks involving unsetting automatic time and update, setting time backwards a couple of weeks and updating manually and so on.. all in the hope of that the "oem unlock" switch should show up.

With the time set to the past, and no automatic updating I then try to update manually when the update function tells me that: The operating system on your device has been modified in an unauthorized way. Try downloading updates using smart switch on your pc or visit customer service center.

Thinking that this might be something in the tab's history I then factory reset the device with the OEM recovery but sadly it did not help at all and I still get the same splash about unauthorized modification when trying to do a manual update
That is where I am at now wishing to the goddess for good advice.
 
Last edited:

Ri9000

Senior Member
Jun 24, 2013
237
78
Samsung Galaxy Tab S2
ERROR: Failed to confirm end of file transfer sequence!
ERROR: RECOVERY upload failed!

Hi jirido, the error msg above comes from end of your Heimdall log.
It looks like you are rebooting the device manually too soon?
Or you are using the wrong recovery file for your device? or bad cable?
Either way you might get better help if you post in the correct forum for your device. Cheers.
 

jirido

Member
Dec 3, 2021
8
0
Suomi
Hi, thanks for your suggestions.

Damned, I try to quote you, but it don't work..

I do boot to directly to the recovery from download mode by using the hardware keys far after heimdall is ready. And the image should be for this device as I have found it here linked from the crDroid rom post for my device.

So you don't think it has to do with that I have no "oem unlock" option?