3.2.1 Necessary Condition
You need prepare 6 components(windows):
- exe(win) / xflash(linux)
- Normal load(Include image files and scatter file etc.)
- Special images and scatter file
- cfg.xml
- exe(win) / fastboot command(linux)
- fastboot command script file
3.2.2 Flash Tool access path
\vendor\mediatek\proprietary\system\core\xflash
3.2.3 How to build special images
Execute following commands, build system will automatically create FES folder and come out the special lk.bin, where FES store the needed files for xflash download to target before entering fastboot mode.
1 2 3 4 5 | $ source build/envsetup.sh $ lunch full_amt6797_64_open-eng $ make -j16 PLATFORM_FASTBOOT_EMPTY_STORAGE=yes -k 2>&1 | tee build.log |
Then, you can find a folder named FES.
PATH: \out\target\product\amt6797_64_open\FES
3.2.4 Download
3.2.4.1 Windows Preparation
- exe
\xflash\bin\win\xflash.exe
- Normal load(Include image files and scatter file etc.)
You can put it anywhere, eg, \xflash\bin\win\img
- Special images and scatter file
You can put it anywhere, eg, \xflash\bin\win\FES. How to build it?
Please see “How to build special images”.
- cfg.xml
\xflash\bin\win\config
- exe
\xflash\bin\win, you shoud put it in normal load folder.
- fastboot command script file
Written by yourself, you should put it in normal load folder.
eg:fastboot command script file named xflash.bat
fastboot devices
fastboot flash gpt PGPT
****
fastboot flash userdata userdata.img
fastboot reboot
3.2.4.2 Windows Download
Step 1. Make a device to enter fastboot mode
- Prepare special images and corresponding scatter file.
- Run program in command line mode like this:
xflash.exe enter-fastboot “G:\xflash\bin\win\FES\MT6797_Android_scatter.txt”
- Then plug in USB cable to device without power adapter
- Plug in power adapter then
- Xflash will scan and open device COM port and connect it, download some necessary images to devices, then make device to enter fastboot mode.
Step 2. Run fastboot command script file
- You need write a download script.
Such as xflash.bat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | fastboot devices fastboot flash gpt PGPT fastboot flash preloader preloader_amt6797_64_open.bin fastboot flash recovery recovery.img fastboot flash scp1 tinysys-scp.bin fastboot flash scp2 tinysys-scp.bin fastboot flash lk lk.bin fastboot flash lk2 lk.bin fastboot flash boot boot.img fastboot flash logo logo.bin fastboot flash tee1 trustzone.bin fastboot flash tee2 trustzone.bin fastboot flash system system.img fastboot flash cache cache.img fastboot flash userdata userdata.img fastboot reboot |
- Run the download script, download success.
3.2.4.3 Linux Preparation
- xflash
\xflash\bin\linux\xflash
- Normal load(Include image files and scatter file etc.)
You can put it anywhere, eg, \xflash\bin\linux\img
- Special images and scatter file
You can put it anywhere, eg, \xflash\bin\linux\FES. How to build it?
Please see “How to build special images”.
- cfg.xml
\xflash\bin\linux\config
- fastboot
If your OS doesn’t support fastboot command, please install this cammand first.
- fastboot command script file
Writen by your self, you should put it in normal load folder.
3.2.4.4 Ubuntu Download
Step 1. Make a device to enter fastboot mode
- Prepare special images and corresponding scatter file.
- Run program in command line mode like this:
sudo ./xflash enter-fastboot “/**/xflash/bin/win/FES/MT6797_Android_scatter.txt”
- Then plug in USB cable to device without power adapter
- Plug in power adapter then
- Xflash will scan and open device COM port and connect it, download some necessary images to devices, then make device enter fastboot mode.
Step 2. Run fastboot command script file
- You need write a download script.
Such as xflash.sh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #!/bin/bash fastboot devices fastboot flash gpt PGPT fastboot flash preloader preloader_amt6797_64_open.bin fastboot flash recovery recovery.img fastboot flash scp1 tinysys-scp.bin fastboot flash scp2 tinysys-scp.bin fastboot flash lk lk.bin fastboot flash lk2 lk.bin fastboot flash boot boot.img fastboot flash logo logo.bin fastboot flash tee1 trustzone.bin fastboot flash tee2 trustzone.bin fastboot flash system system.img fastboot flash cache cache.img fastboot flash userdata userdata.img fastboot reboot |
- Run the download script, download success.