[Android General] CyberianIce:
Greeting to all owners of MTK SmartPhones!

As this devices are technically documented mainly on Chinese, I will teach you today something about low-level device flashing using SP Flash Tool. For those who may have some experiences, SP Flash Tool is MediaTek's equivalent tool for low level flashing like Odin on Samsung devices or RK Batch Tool on RockChip SoC.

Introduction 1 - What is low level flash tool

Let's just say: it's deeper than android flashing. This way you can backup and restore all parts of your NAND chip, and all partitions, not just android and kernel specific ones such as boot, system, data, cache but also nvram, uboot and so on, important for GSM radio. There are two main parts: preloader.bin, which is installed in very first block of your device's eMMC chip - it's first program which phone run after cold stard, and windows driver which is host-side part needed for DL/DA protocol utilized by SP Flash Tools. Both are essential. If you don't have preloader.bin in your phone, you may have very hard brick which is unable to revive unless jtagged or board remains dead. So, whatever you are doing, keep in mind that you must always have preloader.bin in your phone. If you are using format tools, don't ever format preloader area. This SP Flash Tool is must have backup option as this is only way for You to make complete backup of all partitions and block devices in your phone. You must note that some files like NVRAM are unit specific, they contains IMEI and GSM callibration data and You can't use that from another phone, even if it's from same manufacturer and model. That is exactly why everyone should have their own full backup made with SP Flash Tool. And why should You use SP Flash tools for restore? If you asking me, I'm happiest when i don't need to, but there are cases when it's only solution, because no matter how hard you brick your phone, as long as preloader sits inside, you will be able to restore it to fully working state this way as opposite for custom recoveries which requires some working partitions (recovery, boot, ...) SP Flash Tool is so powerful that you may install custom recovery even without rooting ie. Let's go see how it works:

For this occasion, I will use my Alcatel one touch idol MINI (OT-6012X) as test device, but this may work also for all MTK smartphone devices with EMMC, but I don't know abot their new UBIFS.

Tools needed:

MTK Preloader Drivers - Collection of drivers for MTK Phones

SP Flash Tool - Latest Smart Phone Flash Tool v3 5.1408.00 (20/03/2014)

MTK Droid Root & Tools - Version 2.5.3 needed for splitting dump IMG file into separate partition images and retrieving SCATTER file

Chapter 1 - BACKUP

I'm starting this with assumption You already have drivers installed. If you did not installed drivers, see how to install drivers in Appendix.

1. Shut down your phone with cold start (disable Quick Start/Fast Boot options in shutdown menu or settings)

2. Extract SP Flash Tool you downloaded form URL above and run flash_tool.exe as administrator.

3. Go to

Download

page and pusth

scatter-loading

button, than load scatter.txt for You device. You can find this file sometimes in OTA update.zip, or you can create it with MTKDroid Tools but they can be faulty. I provided scatter.txt for Alcatel one touch idol MINI (OT-6012X) as MTKDroid Tools can't generate working scatter for this Alcatel phone.

4. Now navigate to

Readback

tab and push

Add

to add new set for read. Save file as ROM_0.img, and for OT-6012X fill other fields just as show on this picture below.

ROM_ALL.img

- start address

: 0x0000000000000000 and for

lenght

open scatter.txt and find where /cache partition starts. In my case it's 0x534C0000. This way You will dump all data of your eMMC chip up to cache partition.

Last two eMMC partitions are /cache and /data and we need to add them as well, but separately, beacuse we need all partitions to flash after formatting eMMC. In my case, for OT-6012X it's:

cache.img -

start address

: 0x00000000534c0000

lenght

: 0x09200000

userdata.img -

start address

: 0x000000005c6c0000

lenght

: 0x60000000

Note that I took only first 1.5 GB of data because SP Flash Tool won't let me take more for some reason. But content of /data is not relevant for me, not just because last 0.7 GB was empty space, and I wiped it in recovery right after flashing anyway.

5. Now push

Read Back

button and connect your phone which is still OFF to PC with USB cable. Soon readback process will start. Depending on your USB speed and configuration it will take up to 45 min or 1h for 3GB im not sure but it's plenty of time to take full dump

6. Once readback is complete you will see green circle as sign all pass well. Congratulations now you have partial dump of your phone memory, you may now disconnect USB, exit SP Flash Tool, and turn on your phone.

Chapter 2 - PREPARING FILES FOR RESTORE

1. Turn on your phone with USB Debugging enabled and installed ADB drivers.

2. Extract MTKDroid Tools and run MTKdroidTools.exe as administrator. Once your phone is detected by MTKDroid Tools you can push

Blocks Map

button and than you can push

Create scatter file

button in new window which will popup. This way you can creat scatter file for some devices. With my phone, file which has been generated this way didn't work for an unknown reason, that is why i included this file for download.

3. Navigate to

root, backup, recovery

tab and push button

To process file ROM_ from Flash Tool

, and select image dump file you created in previous chapter (ROM_ALL.img). Now MTKDroid Tool will split IMG file into many separate files for each part of eMMC which you will flash later in Chapter 3. If you are asked to create CWM just say

No

and push

Cancel

when prompted to input recovery file.

4. Few minuts later you will see "---Task Completed---" in log, and prepared files are located in subdirectory backups of MTKDroid Tool folder. Afterwards you may close MTKDroid Tool. All files are prepared for flashing back into phone as they may bee needed sooner or later.

Chapter 3 - RESTORE

Finally we come to restore but you don't need to take a breath now as this easily could be an easiest step to do :D

1. Shut down your phone with cold start (disable Quick Start/Fast Boot options in shutdown menu or settings)

2. Run SP Flash Tool again and navigate to tab

Download

, load scatter.txt for your phone (if you using OT-6012X its included in SP Flash Folder by pressing on

Scatter-loading

and selecting scatter.txt

3. Double click on each partition and select respectable file from backups folder in MTKDroid Tools you created in Chapter 2. Note that last two partitions (/cache and /data) are located wherever you saved them with SP Flash Tool. See picture for more details:

4. Select Format All + Download from drop-down menu like on picture below. This is essential becasue if you broke partition table, whole eMMC be formatted and all partitions must be rewritten. That is why we need both /cache and /data partitions, all checkboxes must be checked. If you try to unselect single partition you wont be able to do format before flashing.

5. Push

Download

button and connect your phone (which is off) with PC via USB cable. Process should start, with formating eMMC, and downloading all data respectable. It can take up to 30 mins or so, depending on partition image sizes. After process is finished you will see green circle on screen again. Unplug USB from phone and turn it on.

That would be all.

Appendix - INSTALLING DRIVERS

This going into appendix section as this is needed to be done only once - when You use SP Flash Tool for the very first time. Theoretical background behind this is: we use memory testing routine as it is safe to do and it will initiate preloader to be detected into Windows OS device manager. Once we get new hardware found, we install drivers.

Install adequate drivers from MTK Preloader Drivers via automated setup.

1. Shut down your phone or prepare for cold start if you are in bootloop

2. Run SP Flash Tool and navigate to

Memory Test

tab

3. Check

RAM Test

and

Data Bus Test

ONLY, all other checkboxex must remain clear, than push

Start

button. DO NOT CHECK

EMMC Test

!

4. Connect your phone (which is still OFF) and PC with USB cable, afterwards new hardware found wizard should popup. If you installed drivers it should be automatically found, if not, you still may install drivers manually, respectably to device type and OS you are using.

5. Once driver setup is finished, SP Flash Tool will show

green circle

as signal that RAM is tested and it's ok. If you see red circle RAM is nok.

Addendum - COLD START from BOOTLOOP

If your OT-6012X is in bootloop, try this solution. It it discovered on OT-6012X but may also works for other MTK devices with embedded battery. (devices without detachable battery)

1. Press and hold power button and vol - button together and keep pressed. After 8 sec (when phone turns off) release power button but keep pressed volume - for few seconds more, than release it. Now your phone should stay off.

2. Connect to USB and wait for charging battery few seconds than unplug USB. Now your device is in COLD START state.

3. Now (from cold start state) press volume + and power button at same time, and after phone turns on release power but keep volume + pressed untill recovery loads than restore NAND backup if you have TWRP installed.

If I didn't referred some methods used in this guide it means that they are discovered by myself. If this guide helped you, please don't forget to push thanks button. Have fun.