[Advanced] Installing factory Android image w/ SP Flash

** Warning ** : This is for advanced users only. Can lead to corruption of your storage which might not be fixable locally and may require a paid replacement of your phone. You have been warned.

There are a few situations, like downgrading to an older Android version or reverting to factory image from a custom rom, that may require flashing Android to your Teracube using a PC. The steps below will help you to use SP Flash to write a system image to a phone.

Note: Flashing a system image will completely erase all data on the phone. Back up all important data before performing these steps.

Note: Leave your phone unplugged form the PC until instructed to plug it in.

Prepare the PC

  1. Download SP Flash here

  2. Unzip SP Flash, then navigate inside the unzipped directory and run flash_tool.exe

  3. Download and extract the system image you want to flash to your phone. The currently available images are (download the image based on your phone model)

  1. In SP Flash, select the Download tab.

  2. Click the “Choose” button beside the option named “Scatter-loading file”.

  3. In the file selection dialog, navigate to the extracted system image directory and select the scatter file. It should be a .txt file with the word “scatter” in its name. For example, the scatter file in the SW6 archive is named MT6771_Android_scatter.txt.

  4. After selecting a scatter file, the table at the bottom of the SP Flash panel should be filled with a list of partitions, and files to flash to the partitions. Make sure the drop-down menu above this table is set to “Download Only”, and make sure all of the rows are checked for flashing.

Shut down your phone

Your phone must be powered off to be flashed by SP Flash.

Flash the Image

When the phone and PC are both prepared, follow the steps below to flash the image:

  1. Click the Download button in SP Flash. The button has a green arrow icon. SP Flash will begin waiting for your phone to become visible.

  2. Make sure your phone is powered off. Plug in the phone, then wait. SP Flash will display a series of progress bars as the image is flashed to your phone. When the process is complete, a small window with a checkmark will appear to let you know the process was successful.

Note: If your phone is boot-looping, then replace steps 8-9 with the following:
8. Click the “Download” button on SP Flash.
9. Then insert the USB cable into the phone precisely when its screen is dark. You may have to repeat this to get the timing right.

Note: Windows 10 should have the drivers needed to use SP Flash by default. If SP Flash fails to detect your Teracube, you may need to install the drivers below, then reboot your PC, before flashing.
Driver Link

System Setup

Because all data is erased by flashing an image, the phone will need to be configured as if it were brand new.

9 Likes

Thank you for providing this! As a sustainable phone, it is great to know that we can fix it ourselves from both a hardware and software perspective. As someone who likes to experiment with alternative kernels and OSes to find my optimal performance/battery life ratio, I’ve messed up a phone or two which had no software recovery option, leaving the device a brick. So thank you very much for providing all of the necessary tools to the public!

1 Like

I’m having issues with my ThinkPad detecting my powered down Teracube 2e when connecting. The laptop detects the device just fine when powered on, but nothing happens in SP Flash when I get to Step 9 in the above tutorial. Could someone provide direction on how I would install the drivers mentioned in the Note… what driver do these files relate to and should update? Thank you!

I hit up YouTube and found this incredibly helpful tutorial - https://www.youtube.com/watch?v=NbJCbdfPlF8

Device successfully flashed!

1 Like

Thanks for this but I don’t have Windows.
How can I do under Linux ?

EDIT :
I found by myself:

  1. Download linux version from here https://spflashtool.com/download/
  2. Unzip it
  3. chmod +x *
  4. run as root flash_tool.sh
3 Likes

The driver bundle provided doesn’t include a digital signature (*.cat) file, so it can’t be installed on any modern version of Windows; all 64-bit versions of Windows require a digital signature for the driver bundle (which has been a real PITA for anyone that needs to make .inf files to describe hardware that works with existing signed .sys drivers). Windows 10 also doesn’t recognize the device - the tool doesn’t move or show any signs of life, and for a brief period, all I see is “MT65xx Preloader” as an unknown device in Device Manager.

Kinda getting super frustrated trying to do this super easy process :thinking: Has anyone tried this on a clean PC to see if it’s as easy as quoted, without any pre-existing development tools/drivers installed?

update: Here is a signed driver bundle: Download MediaTek Preloader USB VCOM Drivers (for MT65xx, MT67xx and MT68xx Chipest) and installation guide - TechReen - probably a good idea to replace that link with one that doesn’t ask someone to change their Windows configuration to allow unsigned drivers (very, very inadvisable practice!) and use a bodged driver like that. Just get a signed version :wink: which isn’t available automatically in Windows by default.

1 Like

Thanks - link updated to signed drivers.

1 Like

I was attempting to flash /e/ following the directions on their site . After a PM with @Gagan he thought that the 2e that was shipped to me possibly came with SW after SW6 causing my initial error in the link provided. I am now attempting to flash SW6 using a Linux machine and having issue with the “timing” outlined in steps 8-9 with a bootloop. I can’t get the tool to flash, it keeps returning the error in the screen shot below. I still have access to boot /recovery and /fastboot. When I boot recovery the message,

“E: Failed to bind mount /mnt/staging/emulated/media/0 to /storage/emulated: No such file or directory
E:emulated failed to bind mount /mnt/staging/emulated/media/0on /storage/emulated: No such file or directory”

Any direction to get the flash tool working to get me back to SW6 would be greatly appreciated. Thanks in advance.

did you run LineageOS-18.1 before?

1 Like

No, directly from the Vanilla ROM it shipped with. I believe the install directions on /e/'s site are for SW6 as previously discussed. I believe this is why the flash errors in my post on /e/'s forum were happening.

EDIT: However I did flash /e/'s recovery successfully from what I could see in the terminal and on phone log, while /e/'s ROM flash failed. After this I believe the stock ROM factory reset the partition it was on. I did also attempt to flash Lineage 18.1 but it failed, maybe this is why my current recovery is labelled as such (18.1)?

While I’d normally recommend people to use SPFT on Windows, on Linux you can either set udev rules for /dev/ttyACM* or just run SPFT as root (which is what I end up doing, honestly).
If running SPFT as root (or setting correct udev rules) does not fix the issue, please share SPFT logs (Help > Open Logs Folder).

Just to recap the flashing process, make sure the drop-down reads “Download only”. Hit the “Download” button in SPFT first, then connect your phone powered off or connect your phone and restart it. If SPFT has the right permissions (usually to /dev/ttyACM0 on Linux), it’ll start flashing right away.

2 Likes

Thank you for this. I will attempt to do this as root and if I am unsuccessful I have a Windows box I can try. Will report back.

1 Like

Yes, that is why you are seeing Lineage-18.1’s recovery.
You can flash any custom ROM once you’re on SW6. Again, I’m working on fixing builds on SW16+

1 Like

Was able to correct using the commands below after unziping the SPFT Linux tool (as outlined by @swap38 previously). My inexperience with Linux was the culprit all along. Thank you @Gagan and @AgentFabulous

chmod +x flash_tool
sudo bash flash_tool.sh

Now to see if I can get /e/ up and going with this SW6! If successful I will report this to their team to update the installation directions (current need to flash SW6, this will need updating after @Gagan finishes :point_down: )

:pray: thank you again.

SW6 was not the issue. When I attempt to wipe the data when in fastboot I receive the following error:

fastboot -w
wiping userdata…
Invalid logical-block-size 512: must be a power of 2 and at least 4096.
mke2fs 1.45.5 (07-Jan-2020)
/tmp/TemporaryFile-nKtgVK: Unimplemented ext2 library function while setting up superblock
/usr/lib/android-sdk/platform-tools/mke2fs failed with status 1
mke2fs failed: 1
error: Cannot generate image for userdata

Also receiving this error if attempting to flash the system image. Are any of the newer 2e’s being shipped with different partition set ups that previous? I just received this device yesterday, 6/25/2021.

fastboot flash system system.img
target reported max download size of 134217728 bytes
sending sparse ‘system’ 1/14 (131068 KB)…
OKAY [ 4.068s]
writing ‘system’ 1/14…
FAILED (remote: This partition doesn’t exist)
finished. total time: 4.076s

I do now have TWRP sucessfully flashed and functioning.

EDIT: I have successfully installed iodeOS via a simple ADB sideload through TWRP. Hope I can get /e/ on here someday but I can’t figure it out as of now.

EDIT: Finally resolved my issue with help from aibd on /e/'s forms. It was an issue with me using the “System” Android tools and not the “Latest”. Purged the “System” and did commands ./from the “Latest” folder and fixed the issue. Thank you for the 2e, super excited for this project!

Congratulations, and I’m happy to know that you’ve successfully installed /e/ on your device! :smiley:

1 Like

I am running Debian 11.

When trying to run flash_tool.sh, I was getting an error message re: not finding libpng12-0.so.0 or similar.

symlink to current version did not work.

Tried to download and install the dpkg which was from Jessie. Had a multiarch-support dependency. Ugh.

Noticed there was a lib directory in the SP_Flash_Tool extracted directory. Opened the deb file with ark and extracted libpng12.so.0.50.0 to the SP_FlashTool’s lib directory and created a symbolic link for libpng12.so.0 to libpng12.so.0.50.0.

SP Flash then launched.

Maybe this can save someone else some pain and suffering.

2 Likes

Hey guys I run teracube one and have Mint 20 kernal 5.4.0-81-generic.

I have been trying to flash the teracube one to andriod nine and I only get this in the phone flash tool.

Any help would be greatly appreciated. I am out a phone now.


y

I’m assuming you don’t have access to a Windows 10 computer? Also - what version of SP Flash are you using and where did you get it from?

Hi egx470,
could you please explain the commands you have used to fix the issue. Sorry, I do not understand. Where are the “System” and “Latest” version ?
Could be usefull to describe the process for other Linux beginners :wink:
Many thanks
spray