歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> OdroidXu4開發環境搭建

OdroidXu4開發環境搭建

日期:2017/3/3 12:48:57   编辑:Linux技術

OdroidXu4開發環境搭建

一、 燒錄鏡像
1、 SD卡燒錄
首先准備一張至少16G的sd卡。
鏡像可以在官網:

http://odroid.com/dokuwiki/doku.php?id=en:odroid-xu4#software_os_release下的Software(OS)
Release 中下載

Windows下用win32diskimager-odroid -v1.3軟件進行SD卡的燒錄http://forum.odroid.com/viewtopic.php?f=53&t=947 該網址有詳細的介紹和下載地址。
2、 eMMC燒錄
eMMC的燒錄是通過sd卡啟動之後,在sd卡系統下運行命令燒錄到eMMC的過程,首先准備一張燒錄好系統的的sd卡和空的eMMC,接上開發板,通過sd卡模式啟動。步驟如下:
Needed tools:
eMMC card
SDCard
A Computer running Linux
1. Write the eMMC Android Installer to a SDCARD.
2. Setup ODROID-X board to boot of SD (Jumper).
3. Make sure that the eMMC installer SDCARD and eMMC are connected.
4. Turn on the board. Wait at least 15mins for the fully flash.
5. After waiting 15 minutes, power off the board, remove the sdcard set the jumper to eMMC boot!
6. Check if booted onto Android, if yes. Continue, otherwise double check the first five steps!
7. Write the Ubuntu image to the SDCARD!
8. Change the jumper to SD boot and boot up with your new SDCARD with Ubuntu on it.
9. Check if Ubuntu booted! If so, continue, otherwise double check steps above.
10. Power off the board, reconnect the SDCard to your PC and copy the Ubuntu image (with .xz extension, the compressed one to your sdcard rootfs partition)
11. Connect the eMMC with Android as well the SdCard with Ubuntu, set the jumper to SDCard boot.
12. Boot on your Ubuntu, Open a Terminal and navigate to where you saved your Ubuntu img.xz
13. Now figure out wheres your eMMC. Type
ls /dev/mmcblk*
Your eMMC will be the device with with boot0/boot1 on it as well p1/p2/p3/p4 as well. We'll assume that is mmcblk0! YOU MUST CHECK!
14. On the folder that your Ubuntu img.xz is type:
xzcat odroidx_20130128-linaro-ubuntu-desktop_SD_with_HDMI.img.xz | dd of=/dev/mmcblk0 bs=4M
15. Type sync
16. poweroff
17. Remove SDcard and set the jumper to eMMC boot.
18. Enjoy.
按上述步驟完成後撥碼開關撥到eMMC模式,就可以從eMMC啟動了!
二、u-boot編譯與固件升級
1、交叉編譯環境
在官網:http://odroid.com/dokuwiki/doku.php?id=en:xu3_building_u-boot 有交叉編譯器的下載與安裝方法,說的很詳細,大家可以看官網參考。
注意:該uboot的交叉編譯器貌似只能在Linux32位系統下才能運行,所以大家最好可以裝一個32位的Ubuntu虛擬機。或者最好在Ubuntu64位下下載一個32位的庫:
apt-get install ia32-libs
這樣最方便,因為後面kernel的編譯又需要64位的操作系統編譯。
2、u-boot的編譯
u-boot的下載與編譯可以按官網上所講
3、u-boot的升級
(1) Sd卡升級
Sd卡升級可以按照官網的方法:
注意:當你的更新過的uboot的大小大於328k,需要使用sd_fuse目錄下的hardkernel_1mb_uboot文件裡的東西,在u-boot目錄下可以運行如下:
$ cd sd_fuse/hardkernel_1mb_uboot
$./sd_fusing.1M.sh /dev/sdb
其中/dev/sdb是我自己SD卡設備的路徑。
(2) eMMC升級u-boot
官網裡有通過USB以及u-boot下命令fastboot方式去升級,方法簡單,但因為工作條件本人沒有去試,有興趣的的同事可以去試一下。
本人用的方法是通過sd卡下uboot命令去操作。
准備一張已經燒錄好uboot的sd卡,並將sd_fuse/ hardkernel目錄下的bl1.bin.HardKernel,
bl2.bin.
HardKernel, tzsw.bin.HardKernel,以及你已經編譯好的u-boot.bin拷貝到sd卡中重命名為bl1.bin,bl2.bin,tzsw.bin.(注:如果uboot.bin大於328k需要拷貝sd_fuse/hardkernel_1mb_uboot目錄下的)
插上sd卡和eMMC,讓開發板通過SD卡模式啟動,進入uboot命令下,鍵入如下的命令:
#------------------------------------------------------------------------------------------------------
# BL1 write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 bl1.bin
emmc open 1
movi w z f 1 40008000
emmc close 1
#------------------------------------------------------------------------------------------------------
# BL2 write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 bl2.bin
emmc open 1
movi w z b 1 40008000
emmc close 1
#------------------------------------------------------------------------------------------------------
# Bootloader write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 u-boot.bin
emmc open 1
movi w z u 1 40008000
emmc close 1
#------------------------------------------------------------------------------------------------------
# Turst Zone Soft Ware write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 tzsw.bin
emmc open 1
movi w z t 1 40008000
emmc close 1
#------------------------------------------------------------------------------------------------------
# UBOOT ENV Erase
#------------------------------------------------------------------------------------------------------
mmc write 1 40008000 0x4CF 0x20
#------------------------------------------------------------------------------------------------------
詳細信息可參考http://odroid.com/dokuwiki/doku.php?id=en:xu3_building_android 下方的說明
三、 kernel編譯與固件升級
1、 交叉編譯環境
官網http://odroid.com/dokuwiki/doku.php?id=en:xu3_building_kernel中有交叉編譯器的的下載地址和詳細的步驟,在這不做過多的說明。注意:此交叉編譯器需要64位的Linux操作系統。
2、 Kernel的編譯與更新
Kernel的編譯與更新官網上也做了詳細的步驟說明,且SD卡和eMMC都可適用。需要注意的是:
(1) 如官網所說,需要對卡進行分區如下
本人做法是先去燒錄一個官方提供的完整的Linux系統鏡像,按前面所講。然後再去進行kernel的更新。
(2) Kernel 源碼的下載最好通過Ubuntu下鍵入命令:
(3) git clone --depth 1https://github.com/hardkernel/linux.git -b odroidxu3-3.10.y odroidxu3-3.10.y
去下載。如果只能在Windows下載則在下面的github網址裡下載:
https://github.com/hardkernel/linux/tree/odroidxu3-3.10.y
但是,在編譯的時候通不過,有些文件可能被損壞,你需要在這個網址裡找出對應的文件,將其替換掉.
Copyright © Linux教程網 All Rights Reserved