[Galaxy S 4 Q&A, Help & Troubleshooting] cusromenthusiast:
Hello All,

My Device is S4 SGH M919(T-Mobile USA), Not Rooted and have been running on Lineage OS 17.1 + TWRP recovery for several months until recently when the phone started to randomly shut off mic or reboot or crash often. nandroid backup used to be my savior. In an attempt to resolve the issue, I tried to reformat the phone, install different Lineage OS versions 17.1 and 18.1 which didn't improve my situation. I then switched to Lineage recovery(which I now regret was a bad move!) which not only improvised my situation but I lost ability to perform nandroid backups since then. I have been trying to revert to TWRP recovery but am facing the several issues which are listed below. My phone is very unstable now; it boots sometimes, crashes often and most times it gets stuck trying to enter recovery. i am able to get into download mode.

Issues:

Missing/Corrupted PIT Partition

Unable to boot to Recovery

Frequent crash

Troubleshooting Attempts Performed:

Flash PIT partition file using ODIN

<ID:0/003> Added!!​

<ID:0/003> Odin engine v(ID:3.1401).​

<ID:0/003> File analysis..​

<ID:0/003> Total Binary size: 0 M​

<ID:0/003> SetupConnection..​

<ID:0/003> Initialzation..​

<ID:0/003> Set PIT file..​

<ID:0/003> DO NOT TURN OFF TARGET!!​

<ID:0/003>​

<ID:0/003> Re-Partition operation failed.​

<OSM> All threads completed. (succeed 0 / failed 1)​

Flash stock android via ODIN with/without PIT partition file

<ID:0/003> Odin engine v(ID:3.1401)..

<ID:0/003> File analysis..

<ID:0/003> Total Binary size: 2616 M

<ID:0/003> SetupConnection..

<ID:0/003> Initialzation..

<ID:0/003> Set PIT file..

<ID:0/003> DO NOT TURN OFF TARGET!!

<ID:0/003>

<ID:0/003> Re-Partition operation failed.

<OSM> All threads completed. (succeed 0 / failed 1)

Flash TWRP recovery using ODIN

<ID:0/003> Added!!​

<ID:0/003> Odin engine v(ID:3.1401)..​

<ID:0/003> File analysis..​

<ID:0/003> Total Binary size: 8 M​

<ID:0/003> SetupConnection..​

<ID:0/003> Initialzation..​

<ID:0/003> Get PIT for mapping..​

<ID:0/003>​

<ID:0/003> There is no PIT partition.​

<OSM> All threads completed. (succeed 0 / failed 1)​

Flash TWRP recovery + PIT file using ODIN

<ID:0/003> Added!!​

<ID:0/003> Odin engine v(ID:3.1303)..​

<ID:0/003> File analysis..​

<ID:0/003> Total Binary size: 8 M​

<ID:0/003> SetupConnection..​

<ID:0/003> Initialzation..​

<ID:0/003> Set PIT file..​

<ID:0/003> DO NOT TURN OFF TARGET!!​

<ID:0/003>​

<ID:0/003> Re-Partition operation failed.​

<OSM> All threads completed. (succeed 0 / failed 1)​

Checking PIT Partition using Heimdall

heimdall print-pit

Heimdall v1.4.2

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

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:

Donate | Glass Echidna

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...

ERROR: Failed to receive PIT file size!

ERROR: Failed to download PIT file!

Ending session...

Rebooting device...

Releasing device interface...

Things already verified

Connecting to PC USB Port with original quality USB cable; Tried changing USB cable and the port

Installed required samsung USB drivers

tried with multiple ODIN versions which all used to work in the past

How to recover from here?

May be I am not using the correct PIT file? I tried and couldn't find many so far.

Assuming there is no physical damage to the board inside, what additional steps I could try to get back to recovery mode? I look forward for your expert suggestion/next steps here.

Thank You!