[Guide]Update Firmware using Heimdall - T813

OhioYJ

Senior Member
Feb 25, 2011
1,378
661
133
So as many have found out the latest builds of Lineage require updating the firmware on our tablets. Even as a Linux user I found this very frustrating and ran into many problems actually, so I figured I'd do a quick guide.

I take no responsibility for anything that happens by following this guide, use at your own risk.

Heimdall is honestly just finicky in my opinion, and if you don't have all the "pieces of the puzzle" in place it's not going to work. It works easier in Linux in my opinion so even if you aren't a Linux user, I would still use a flash drive to temporarily boot into Linux to flash this. This method however will prevent you from having to wipe your tablet.

To create a bootable Linux flash drive you can use Unetbootin, which you can download for free here (Your other option would be to burn the ISO straight to a DVD and skip the unetbootin step):

https://unetbootin.github.io/

For Linux, I'm using Linux Mint Cinnamon, You can download for free here:

https://www.linuxmint.com/download.php

Then run unetbootin (yours will look a little different, I'm running it in Linux):



Point it to the Linux ISO, and tell it where an empty flash drive is. It will erase everything on the flash drive. Afterwards you can load whatever you want on the flash drive. However be aware when booting Linux from this drive you can't access what is on the drive (at least not by normal methods).

After this has successfully completed, reboot the PC, and boot from the USB drive. Your PC will boot into Linux.

Next we need to install heimdall program. You need to open up the "start menu" and open the "synaptic package manager". You can find this stuff in the menus, however the easiest way to get to these items is to just start typing the name of the item. See below:



Search for heimdall, click all three boxes, choosing install on each, and then click apply. It's that easy it will download everything that's need and install. If heimdall does not show up just click reload. Note you will need internet for this to work.



Note you need heimdall version 1.4.2 for any of this to work. It's very likely that the version in synaptic was not version 1.4.2. If it was not. Go to the site below, scroll to the bottom and download, heimdall-flash_1.4.2-0ubuntu1~17.10~ricotz1_amd64.deb

https://launchpad.net/~ricotz/+archive/ubuntu/unstable/+build/13609401

This heimdall-flash_1.4.2-0ubuntu1~17.10~ricotz1_amd64.deb by default will be in the home folder under downloads, and is an installable file. Install this. Ignore the warning about an older version being available in Synaptic.

Time to open up a terminal window:



As this point I'm going to assume you already have your necessary files. I have a US tablet, and I did use the Canada file from SamMobile if that helps anyone. To get the files needed unzip the Tar.md5 file from the zip file you downloaded. Then remove the .md5 from the end. Now you can open the .tar and extract all these files. I placed all these in folder on my Desktop for ease of access.



To flash these you will need to be in Download mode. You can enter download mode by using the reboot menu, entering through TWRP, or Home + Volume Down + Power when powering the tablet on.

You will need to navigate to this folder for flashing. "CD" changes directory, "LS" lists files in the directory. Capital letters matter. I put the files in a folder called temp on my desktop so in my terminal I end up with something like this:



Now thanks to @Deltadroid we know what to flash, copy and paste this into the terminal window.

sudo heimdall flash --SBL1 sbl1.mbn --ABOOT aboot.mbn --RPM rpm.mbn --TZ tz.mbn --HYP hyp.mbn --SEC sec.dat --KEYMASTER keymaster.mbn --CMNLIB cmnlib.mbn --DSP adspso.bin --MODEM modem.bin --APNHLOS NON-HLOS.bin

Even with this updated, you can still boot into your old Lineage install. However you are also now free to update to the latest nightlies now.

Once you are done, choose shutdown and remove the USB, and your PC will boot back up as normal.

Any questions, ask, don't get yourself in trouble. Flashing firmware can be serious.
 
Last edited:

TKruzze

Senior Member
Jul 25, 2010
1,659
23,761
153
Ann Arbor, MI
I ended up using your guide to update my USA tablet and it was easy peasy. Under Widows 7, I used Rufus to flash the Linux Mint ISO to a USB flash drive and booted right up. Entire process took 20 minutes and it felt much safer than using ODIN.

Thanks, again, for the easy-to-follow guide!
 

GambaJo

Member
Feb 6, 2011
13
2
0
Hi. Do I have to start the tablet to downloade mode?
When I try your guide, I get this:

Code:
[email protected]:/media/do/Daten/temp/T813XXS2BSG1_T813OXA2BSA1_HOME$ sudo heimdall flash --SBL1 sbl1.mbn --ABOOT aboot.mbn --RPM rpm.mbn --TZ tz.mbn --HYP hyp.mbn --SEC sec.dat --KEYMASTER keymaster.mbn --CMNLIB cmnlib.mbn --DSP adspso.bin --MODEM modem.bin --APNHLOS NON-HLOS.bin
[sudo] Passwort für do:        
ERROR: Failed to open file "sec.dat"
[email protected]:/media/do/Daten/temp/T813XXS2BSG1_T813OXA2BSA1_HOME$ ls
aboot.mbn   boot.img        cmnlib.mbn       hyp.mbn        modem.bin     recovery.img  sbl1.mbn         tz.mbn
adspso.bin  cache.img.ext4  hidden.img.ext4  keymaster.mbn  NON-HLOS.bin  rpm.mbn       system.img.ext4
 

OhioYJ

Senior Member
Feb 25, 2011
1,378
661
133
Hi. Do I have to start the tablet to downloade mode?
When I try your guide, I get this:

Code:
[email protected]:/media/do/Daten/temp/T813XXS2BSG1_T813OXA2BSA1_HOME$ sudo heimdall flash --SBL1 sbl1.mbn --ABOOT aboot.mbn --RPM rpm.mbn --TZ tz.mbn --HYP hyp.mbn --SEC sec.dat --KEYMASTER keymaster.mbn --CMNLIB cmnlib.mbn --DSP adspso.bin --MODEM modem.bin --APNHLOS NON-HLOS.bin
[sudo] Passwort für do:        
ERROR: Failed to open file "sec.dat"
[email protected]:/media/do/Daten/temp/T813XXS2BSG1_T813OXA2BSA1_HOME$ ls
aboot.mbn   boot.img        cmnlib.mbn       hyp.mbn        modem.bin     recovery.img  sbl1.mbn         tz.mbn
adspso.bin  cache.img.ext4  hidden.img.ext4  keymaster.mbn  NON-HLOS.bin  rpm.mbn       system.img.ext4
No, you can even restart in Download mode from the reboot menu. However make sure the file sec.dat is actually in the folder you are flashing from. IIRC from the LOS post there was a region or two that the sec.dat file was not included on for some reason or another. If you don't have this file, and tell heimdall do flash it, you will get an error.

This post and This post have information about that sec.dat, and maybe useful to you.
 

GambaJo

Member
Feb 6, 2011
13
2
0
No, you can even restart in Download mode from the reboot menu.
I know. I wanted to know, if I have to boot to download mode to flash this files.

However make sure the file sec.dat is actually in the folder you are flashing from. IIRC from the LOS post there was a region or two that the sec.dat file was not included on for some reason or another. If you don't have this file, and tell heimdall do flash it, you will get an error.
I tried another download, but this file was still not there.
Is it a problem, if I take a file from another region?
 

OhioYJ

Senior Member
Feb 25, 2011
1,378
661
133
I know. I wanted to know, if I have to boot to download mode to flash this files.

It doesn't matter how you get to download mode to flash these files. You can boot that way, or get there from the reboot menu.

I tried another download, but this file was still not there. Is it a problem, if I take a file from another region?
To be honest, from the LOS thread, I believe I read that LOS will update without that file. @Deltadroid or @AL_IRAQI could answer that better. The first link I posted Deltadroid said there hadn't been any changes to the sec.dat file. I know the Canada file has sec.dat file. Also AL_IRAQI posted firmware only file in that LOS thread, that has the file I believe? (I used the Sammobile site)
 

GambaJo

Member
Feb 6, 2011
13
2
0
It doesn't matter how you get to download mode to flash these files. You can boot that way, or get there from the reboot menu.
I didn't ask how to boot to download mode, but if. In your tutorial there is no information about if boot to download mode, or to recovery or whatever.
But now I know, that I had to boot to download mode.

To be honest, from the LOS thread, I believe I read that LOS will update without that file. @Deltadroid or @AL_IRAQI could answer that better. The first link I posted Deltadroid said there hadn't been any changes to the sec.dat file. I know the Canada file has sec.dat file. Also AL_IRAQI posted firmware only file in that LOS thread, that has the file I believe? (I used the Sammobile site)
Strange, my file is from the Sammobile site too. Ok, I will try without this file. Hope, this will not brik my tablet.

---------- Post added at 07:01 PM ---------- Previous post was at 06:49 PM ----------

Ok, I tried, and it worked without sec.dat. Flashing worked and the update to the current LOS build.
Thx.
 

OhioYJ

Senior Member
Feb 25, 2011
1,378
661
133
I didn't ask how to boot to download mode, but if. In your tutorial there is no information about if boot to download mode, or to recovery or whatever. But now I know, that I had to boot to download mode.
Ah, I get it now, I was misunderstanding. You are right, that would be helpful. I was more concentrating on all the problems with heimdall. I know personally had several. I will edit the guide and add that. Thank you for pointing that out.
 

trisolaris

Member
Sep 24, 2018
10
4
3
@OhioYJ Thank you so much for this perfect Guide! It works great! :good:

Maybe you can put a notice to your guide that it is possible to enable USB-Debugging before start the flash prozess?!?
 

OhioYJ

Senior Member
Feb 25, 2011
1,378
661
133
Do I need to do this firmware update, if my tab is already updated to t813xxs2bsg1?
If you are running stock Samsung software, you don't need this guide. This was for those running Lineage. If you are on an AOSP Rom you may run into an issue where you need to update your firmware, and this method allows you do this without going back to stock, then going back to AOSP.
 

kainokani

New member
Jan 20, 2020
2
0
0
If you are running stock Samsung software, you don't need this guide. This was for those running Lineage. If you are on an AOSP Rom you may run into an issue where you need to update your firmware, and this method allows you do this without going back to stock, then going back to AOSP.
At the moment I have Samsung Android, but I was planning to install Lineage instead. Not quite sure how much of the original firmware remains underneath the Lineage or is it totally wiped out, I was wondering does the Samsung Android version has anything to do with the need to do the firmware update described in this thread? (Sorry, if this too noob.)
 

Deltadroid

Recognized Contributor
Apr 19, 2013
3,768
9,885
263
At the moment I have Samsung Android, but I was planning to install Lineage instead. Not quite sure how much of the original firmware remains underneath the Lineage or is it totally wiped out, I was wondering does the Samsung Android version has anything to do with the need to do the firmware update described in this thread? (Sorry, if this too noob.)
Installing the latest stock rom updates the firmware discussed in this thread.