Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,805,427 Members 40,822 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE]SP Flash Tools Explained with OT-6012

Tip us?
 
CyberianIce
Old
(Last edited by CyberianIce; 23rd March 2014 at 12:57 PM.)
#1  
CyberianIce's Avatar
Senior Member - OP
Thanks Meter 77
Posts: 260
Join Date: Aug 2008
Location: Apatin

 
DONATE TO ME
Info 2 [GUIDE]SP Flash Tools Explained with OT-6012

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

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-specific ones such as boot, system, data but also nvram, uboot and so on. 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. Each of them is 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 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 full their own backup mad 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. 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 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. Inside this I provided is 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 contend 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 a dump

6. Once readback is complete you will see green circle as sign all pass well. Congratulations now you have nice 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
 

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.
My Devices:
 

Current:
SAMSUNG Galaxy SIII GT-I9300 Int | TWRP 2.7.0.0 | CM11 ROM
Blueberry NetCat M-12 | CWM 6.2.0.8 | Custom kernel | Custom 4.2.2 ROM

History:


My Contributes:

If you like my work you may donate me for coffie. If you can't, just hit "Thanks" button.
The Following 6 Users Say Thank You to CyberianIce For This Useful Post: [ Click to Expand ]
 
paradiselost28
Old
(Last edited by paradiselost28; 2nd April 2014 at 09:37 PM.)
#2  
Member
Thanks Meter 12
Posts: 79
Join Date: Aug 2012
Location: 127.0.0.1
Hi CyberianIce and thanks for this tutorial, but BitDefender detected a Trojan in MTKDroid_Tools...
With Virustotal (scan of rar archive) : 17 / 51
EDIT : After verification, the same problem is in MTKDroid_Tools official link too but I'm not sure it's a false positive...
- Alcatel One Touch Idol Mini (Sosh/Orange ROM)
- LG G Pad 8.3 (CM11 LINARO/SABERMOD Nightly Build)
- Sony Xperia Mini Pro (CM10.2 LegacyXperia Build 20140304)

Just hit the THANKS button if I helped you
 
CyberianIce
Old
#3  
CyberianIce's Avatar
Senior Member - OP
Thanks Meter 77
Posts: 260
Join Date: Aug 2008
Location: Apatin

 
DONATE TO ME
Quote:
Originally Posted by paradiselost28 View Post
Hi CyberianIce and thanks for this tutorial, but BitDefender detected a Trojan in MTKDroid_Tools...
With Virustotal (scan of rar archive) : 17 / 51
EDIT : After verification, the same problem is in MTKDroid_Tools official link too but I'm not sure it's a false positive...
One must turn A/V off when using MTK Droid Root & Tool and SP Flash Tool because they recognize common android exploits (faramir, boromir, etc) as potentially threat. However, that is false alarm, because it is harmless when used for this purpose and absolutely needed for rooting.
My Devices:
 

Current:
SAMSUNG Galaxy SIII GT-I9300 Int | TWRP 2.7.0.0 | CM11 ROM
Blueberry NetCat M-12 | CWM 6.2.0.8 | Custom kernel | Custom 4.2.2 ROM

History:


My Contributes:

If you like my work you may donate me for coffie. If you can't, just hit "Thanks" button.
 
dfani511
Old
#4  
Member
Thanks Meter 0
Posts: 39
Join Date: Jan 2012
Quote:
Originally Posted by CyberianIce View Post
One must turn A/V off when using MTK Droid Root & Tool and SP Flash Tool because they recognize common android exploits (faramir, boromir, etc) as potentially threat. However, that is false alarm, because it is harmless when used for this purpose and absolutely needed for rooting.
Can you upload somewhere a full backup with all partitions for sp flash tool ?

I have Alcatel 6012x and I bricked it with Sp Flash tool , I used format ALL + download without preloader and others,only cache,userdata and Android ( system ) ,I got an error and now only what can I see it is a blue LED .
 
CyberianIce
Old
#5  
CyberianIce's Avatar
Senior Member - OP
Thanks Meter 77
Posts: 260
Join Date: Aug 2008
Location: Apatin

 
DONATE TO ME
Preloader is still alive, you have chance to get things back working if you have Your backup, my files wont help much:

http://forum.xda-developers.com/show...php?p=49902338
My Devices:
 

Current:
SAMSUNG Galaxy SIII GT-I9300 Int | TWRP 2.7.0.0 | CM11 ROM
Blueberry NetCat M-12 | CWM 6.2.0.8 | Custom kernel | Custom 4.2.2 ROM

History:


My Contributes:

If you like my work you may donate me for coffie. If you can't, just hit "Thanks" button.
 
dfani511
Old
#6  
Member
Thanks Meter 0
Posts: 39
Join Date: Jan 2012
ok now it is alive,but I do not understand ,it had a very bad signal or what?
Because with Vodafone Romania I do not have signal no where inside of my home,outsite I have signal,and with Cosmote Romania 2G GSM I have 1-2 signal lines and with Cosmote Romania 3G WCDMA everywhere is on roming and I have with it 3-4 signal lines insite of my house .
 
CyberianIce
Old
#7  
CyberianIce's Avatar
Senior Member - OP
Thanks Meter 77
Posts: 260
Join Date: Aug 2008
Location: Apatin

 
DONATE TO ME
Quote:
Originally Posted by dfani511 View Post
ok now it is alive,but I do not understand ,it had a very bad signal or what?
Because with Vodafone Romania I do not have signal no where inside of my home,outsite I have signal,and with Cosmote Romania 2G GSM I have 1-2 signal lines and with Cosmote Romania 3G WCDMA everywhere is on roming and I have with it 3-4 signal lines insite of my house .
It is possible you ruined your GSM calibration data which are located in NAND chip NVRAM. They contains unit-specific GSM radio calibration data and IMEI? How could you format all without preloader? Such operation is hardly possible because if you uncheck any part of emmc, format become regular update of selected partitions.
My Devices:
 

Current:
SAMSUNG Galaxy SIII GT-I9300 Int | TWRP 2.7.0.0 | CM11 ROM
Blueberry NetCat M-12 | CWM 6.2.0.8 | Custom kernel | Custom 4.2.2 ROM

History:


My Contributes:

If you like my work you may donate me for coffie. If you can't, just hit "Thanks" button.
 
dfani511
Old
#8  
Member
Thanks Meter 0
Posts: 39
Join Date: Jan 2012
No that isn't from the last write without preloader , because that problem I had it in the past and for that I tried to re-write the fw
Can I do something ?
 
EvangelineX
Old
#9  
Account currently disabled
Thanks Meter 9
Posts: 182
Join Date: Aug 2013
Applies to all other phone?
 
CyberianIce
Old
#10  
CyberianIce's Avatar
Senior Member - OP
Thanks Meter 77
Posts: 260
Join Date: Aug 2008
Location: Apatin

 
DONATE TO ME
Quote:
Originally Posted by dfani511 View Post
No that isn't from the last write without preloader , because that problem I had it in the past and for that I tried to re-write the fw
Can I do something ?
Just restore previous backup as described in first post.

Quote:
Originally Posted by EvangelineX View Post
Applies to all other phone?
Yes but you must obtain scatter.txt for your specific phone.
My Devices:
 

Current:
SAMSUNG Galaxy SIII GT-I9300 Int | TWRP 2.7.0.0 | CM11 ROM
Blueberry NetCat M-12 | CWM 6.2.0.8 | Custom kernel | Custom 4.2.2 ROM

History:


My Contributes:

If you like my work you may donate me for coffie. If you can't, just hit "Thanks" button.

The Following User Says Thank You to CyberianIce For This Useful Post: [ Click to Expand ]
Tags
idol mini, mt6572, mtk, ot-6012, sp flash tools
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


CyanogenMod 11 M10 Available for Supported Devices

Summer vacation isover for most students out there, and it’s the time to get back to … more

XDA Forums Added for the First Batch of Android One Devices!

Just yesterday, we talked about the highly anticipated launch of the first batch … more

XDA Xposed Tuesday: DonkeyGuard, Don’t Be a Donkey, Control Your Device – XDA Developer TV

Some applications ask for the world … more

Use Facebook Pictures as a LWP with Facebook View

One of the best things that Android has always offeredits users is the ability to tailor … more