https://bbs.alpha-star.org/activity-release/%E3%80%90mediatek-x20%E5%BC%80%E5%8F%91%E6%9D%BF%E8%AF%95%E7%94%A8%E4%BD%93%E9%AA%8C%E3%80%912-mtx20%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA%EF%BC%8C%E6%BA%90%E4%BB%A3%E7%A0%81%E4%B8%8B
https://blog.csdn.net/panbiao1999/article/details/77339961
MTX20开发环境搭建,源代码下载、编译、xflash下载、运行
极客社区对于开发环境搭建,源代码下载、编译、xflash下载、运行都给出了详细的说明,我这里只是照着做一遍。
一)ubuntu系统安装,本着一切一样的原则,这次自己安装了开发板要求的ubuntu版本ubuntu14.04 64位。
然后是install一些必须的库文件。
二)源代码下载方法:可以任选一种,注意编译前安装要求将kernel和sla中的代码正确拷贝。
- 1. AOSP
- repo init -u https://android.googlesource.com/platform/manifest -b android-6.0.0_r1
- Repo sync –j16
- 2. Linux
- https://github.com/helio-x20/linux/tree/helio-x20
- 3. SLA
- https://builds.96boards.org/releases/helio-x20/mediatek/aosp/latest/
- 目录下的mediatek-x20-aosp-16.10-source.tar.xz文件(解压缩后会有SLA.tar.gz)。
- 编译方案:
- 1、将AOSP代码解压(如果是repo获得可以忽略此步骤)
- 2、获取Linux代码后mv到AOSP目录下重命名为kernel-3.18
- 3、解压开SLA,覆盖相应文件
- 即可获得全套可以编译X20-Board代码。
- 国内用户的福音
- 你还在为翻墙而烦恼吗?百度云Link来啦。
- 1、AOSP
- 链接: http://pan.baidu.com/s/1boAZqJt 密码:mooh
- 2、Kernel
- 链接: http://pan.baidu.com/s/1o8IuBUU 密码:9ys6
- 3、SLA
- https://builds.96boards.org/releases/helio-x20/mediatek/aosp/latest/
- 目录下的mediatek-x20-aosp-16.10-source.tar.xz文件(解压缩后会有SLA.tar.gz)
复制代码
三)源代码编译
将近3个小时,不能使用小型机每次完全编译android源代码的时间够长啊。
四)更新系统并运行
How-To-Download-By-Xflash.pdf文档说的很清楚,仔细参照文档来做应该没有问题。下面是更新的全部log。
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win>xflash.exe
- enter-fastboot F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin
- win\FES\MT6797_Android_scatter.txt
- START.
- wait for device.
- connect boot rom.
- boot from preloader.
- download required partition images.
- #1 write to lk
- #2 write to logo
- #3 write to tee1
- jump to: tee1
- END.
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win>cd F:\Medi
- TekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>xflash
- bat
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t devices
- 0123456789ABCDEF fastboot
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t flash gpt PGPT
- target reported max download size of 134217728 bytes
- sending 'gpt' (16 KB)...
- OKAY [ 0.138s]
- writing 'gpt'...
- OKAY [ 0.050s]
- finished. total time: 0.191s
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t flash preloader preloader_amt6797_64_open.bin
- target reported max download size of 134217728 bytes
- sending 'preloader' (170 KB)...
- OKAY [ 0.144s]
- writing 'preloader'...
- OKAY [ 0.033s]
- finished. total time: 0.179s
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t flash recovery recovery.img
- target reported max download size of 134217728 bytes
- sending 'recovery' (10338 KB)...
- OKAY [ 0.494s]
- writing 'recovery'...
- OKAY [ 0.295s]
- finished. total time: 0.792s
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t flash scp1 tinysys-scp.bin
- target reported max download size of 134217728 bytes
- sending 'scp1' (50 KB)...
- OKAY [ 0.139s]
- writing 'scp1'...
- OKAY [ 0.014s]
- finished. total time: 0.158s
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t flash scp2 tinysys-scp.bin
- target reported max download size of 134217728 bytes
- sending 'scp2' (50 KB)...
- OKAY [ 0.143s]
- writing 'scp2'...
- OKAY [ 0.012s]
- finished. total time: 0.157s
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t flash lk lk.bin
- target reported max download size of 134217728 bytes
- sending 'lk' (433 KB)...
- OKAY [ 0.152s]
- writing 'lk'...
- OKAY [ 0.022s]
- finished. total time: 0.177s
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t flash lk2 lk.bin
- target reported max download size of 134217728 bytes
- sending 'lk2' (433 KB)...
- OKAY [ 0.152s]
- writing 'lk2'...
- OKAY [ 0.022s]
- finished. total time: 0.178s
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t flash boot boot.img
- target reported max download size of 134217728 bytes
- sending 'boot' (9290 KB)...
- OKAY [ 0.459s]
- writing 'boot'...
- OKAY [ 0.254s]
- finished. total time: 0.715s
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t flash logo logo.bin
- target reported max download size of 134217728 bytes
- sending 'logo' (1519 KB)...
- OKAY [ 0.191s]
- writing 'logo'...
- OKAY [ 0.050s]
- finished. total time: 0.244s
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t flash tee1 trustzone.bin
- target reported max download size of 134217728 bytes
- sending 'tee1' (80 KB)...
- OKAY [ 0.140s]
- writing 'tee1'...
- OKAY [ 0.010s]
- finished. total time: 0.153s
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t flash tee2 trustzone.bin
- target reported max download size of 134217728 bytes
- sending 'tee2' (80 KB)...
- OKAY [ 0.142s]
- writing 'tee2'...
- OKAY [ 0.010s]
- finished. total time: 0.155s
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t flash system system.img
- target reported max download size of 134217728 bytes
- erasing 'system'...
- OKAY [ 0.378s]
- sending sparse 'system' (131067 KB)...
- OKAY [ 5.404s]
- writing 'system'...
- OKAY [ 31.992s]
- sending sparse 'system' (128418 KB)...
- OKAY [ 5.043s]
- writing 'system'...
- OKAY [ 12.043s]
- sending sparse 'system' (131046 KB)...
- OKAY [ 5.119s]
- writing 'system'...
- OKAY [ 14.777s]
- sending sparse 'system' (125743 KB)...
- OKAY [ 4.967s]
- writing 'system'...
- OKAY [ 16.741s]
- sending sparse 'system' (130638 KB)...
- OKAY [ 5.302s]
- writing 'system'...
- OKAY [ 29.249s]
- sending sparse 'system' (32097 KB)...
- OKAY [ 1.392s]
- writing 'system'...
- OKAY [ 7.141s]
- finished. total time: 139.688s
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t flash cache cache.img
- target reported max download size of 134217728 bytes
- erasing 'cache'...
- OKAY [ 0.078s]
- sending 'cache' (8832 KB)...
- OKAY [ 0.432s]
- writing 'cache'...
- OKAY [ 1.424s]
- finished. total time: 1.937s
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t flash userdata userdata.img
- target reported max download size of 134217728 bytes
- erasing 'userdata'...
- OKAY [ 0.429s]
- sending 'userdata' (54109 KB)...
- OKAY [ 2.099s]
- writing 'userdata'...
- OKAY [ 6.081s]
- finished. total time: 8.634s
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>fastbo
- t reboot
- rebooting...
- finished. total time: 0.003s
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>pause
- 请按任意键继续. . .
- F:\MediaTekX20\mediatek-x20-aosp-16.10\Images\X-Flash\xflash\bin\win\img>
复制代码
系统成功后系统会自动进入系统,我这里没有触摸屏,所必须使用usb鼠标,所以更新完成后需要断电设置usb的模式。
https://bbs.alpha-star.org/hardware/helio-x20-development-board-usb%E9%80%9A%E9%81%93%E5%88%87%E6%8D%A2这个帖子说的很清楚,照着做就是。
注意:需要下载的时间时候将3拨到红线方向,需要使用usb鼠标的时候将3拨到黄线方向。
这里吐槽一下,这种方式比那种按住某个按键(比如声音+按键)后可以进入fastboot的方式可操作性差了许多!
看一下设置的信息,验证运行中的系统是我们编译的img。
下面会先加载一个驱动到Kernel中,熟悉一下DTS方式下驱动如何在Android内核中编译和加载,为后面添加USB摄像头驱动做准备。