Failed to install TWRP on Samsung A520F with Heimdall

First, I have no windows system (only Mint and Ubuntu) on my computers.

I tried to follow e/OS installation steps described in

heimdall print-it seems to work (phone display information and reboot).

but after heimdall flash, I can not switch off the phone to reboot it on recovery mode and it reboot with the current system Android 8 (R16NW.1520FXXUGCTKA)

heimdall flash --RECOVERY twrp-3.7.0_9-0-a5y17lte.img --no-reboot --verbose
Heimdall v1.4.2

Copyright (c) 2010-2017 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...
      Manufacturer: "SAMSUNG"
           Product: "Gadget Serial"

            length: 18
      device class: 2
               S/N: 0
           VID:PID: 04E8:685D
         bcdDevice: 021B
   iMan:iProd:iSer: 1:2:0
          nb confs: 1

interface[0].altsetting[0]: num endpoints = 1
   Class.SubClass.Protocol: 02.02.01
       endpoint[0].address: 83
           max packet size: 0010
          polling interval: 09

interface[1].altsetting[0]: num endpoints = 2
   Class.SubClass.Protocol: 0A.00.00
       endpoint[0].address: 81
           max packet size: 0200
          polling interval: 00
       endpoint[1].address: 02
           max packet size: 0200
          polling interval: 00
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...
WARNING: Empty bulk transfer after receiving packet failed. Continuing anyway...
PIT file download successful.

Uploading RECOVERY
RECOVERY upload successful

Ending session...
Releasing device interface...

I saw on the TWRP documentation for A5 2017 that there may be a protection “dm-verity” preventing system modifications.

Here is the screen at the end of the heimdall flash execution

Is there a way to solve this that I missed ? I am not used to phone “hacking” and have no windows computer to operate.

I would like (and I also need) to experiment e/OS as some important applications do not accept to run on Android 8 forcing me to change my phone which works.

Thanks for your help :slight_smile:

Hi @fcodvpt welcome to the /e/ forum.

From your description of this Samsung behaviour, I think the most likely thing is explained in this link Your first boot into TWRP.

I am uncertain, but “Product: Gadget Serial” might indicate a different issue.

Hi @aibd,

Thanks for your welcome et for your helpful answer !

The complete It fixed the TWRP install with heimdall and I have been able to go to further in the installation.

Now I seem to be in a wrong state (I used TWRP 3.7 and did not have the same options as the install guide), there was errors on /data and now it seems to loop on “Encrytion unsuccessful” / “Factory data reset”.

I can loose the data of this phone so I clicked on “erase all data”, but I am now block on this “Encrytion unsuccessful” screen.

If someone has another pointer or another advice to do the right thing, it seem I am not so far from succeeding :smiley:

My first guess is that TWRP is too advanced. Try a version around 3.5.

Finally I have downloaded TWRP again (the same), but I found the “format data” button (click on the “wipe” button first). I quite did this missing step and now I have e/OS displayed !!

I now have to get started on e/OS :D, again thanks for your usefulp help for accessing TWRP on Samsung !

Unfortunately I have now a “no sim card” that does not seem so easy to fix.
The phone was bought by me and is not linked to a carrier.

You might try running the First Start Wizard with SIM card in place. This would require a Factory reset first – the factory reset will return you to /e/OS

I ashamed, I inserted the SD card and not the SIM card, it works !!!
I think I was tired :upside_down_face:
Sorry for bothering, thanks again for your help !

1 Like

This topic was automatically closed after 90 days. New replies are no longer allowed.