原文: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
極客社區對於開發環境搭建,源代碼下載、編譯、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攝像頭驅動做準備。
© 2017 Alpha Star. All Rights Reserved.