国产毛片a精品毛-国产毛片黄片-国产毛片久久国产-国产毛片久久精品-青娱乐极品在线-青娱乐精品

明遠智睿MY-IMX6 L3035編譯手冊

發(fā)布時間:2018-3-15 10:26    發(fā)布者:myzr123
準備源碼包(prepare source code pacakge)
3.0.35版本代碼(3.0.35 version code)u-boot源碼(u-boot source code)
文件名:u-boot-2009.08--svn*.tar.xz
name of file:u-boot-2009.08--svn*.tar.xz

kernel源碼(kernel source code)
文件名:linux-3.0.35--svn*.tar.xz
name of file:linux-3.0.35--svn*.tar.xz

交叉編譯工具 (cross compifer tool)
文件名:gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.bz2
name of file:gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.bz2

配置編譯環(huán)境(configuration of compifer environment)
準備源碼(prepare source code)準備源碼包 (prepare source code package)
1)創(chuàng)建工作目錄
create working directory
創(chuàng)建 ~/my-imx6 作為工作目錄
create ~/my-imx6 as working directory
$ mkdir ~/my-imx6

創(chuàng)建 ~/my-imx6/02_source/imx_3.0.35_4.1.0 作為源碼目錄
create ~/my-imx6/02_source/imx_3.0.35_4.1.0 as source code directory
$ mkdir ~/my-imx6/02_source/imx_3.0.35_4.1.0 -p

創(chuàng)建 ~/my-imx6/03_tools 作為工具目錄
create ~/my-imx6/03_tools as tool directory
$ mkdir ~/my-imx6/03_tools -p

2)復制源碼包到開發(fā)主機中
copy source code package to the development host
這一步驟自己采取相應的方式進行。
do it in this step in your own way。
  提示:這里將網盤中“02_源碼”復制到Linux開發(fā)主機的“~/my-imx6/02_source/imx_3.0.35_4.1.0”,將網盤中“03_工具/toolchain”復制到Linux開發(fā)主機的“~/my-imx6/03_tools”。
tip:this step is to copy “02_source code”from network disk to “~/my-imx6/02_source/imx_3.0.35_4.1.0”in development host,and copy “03_tool/toolchain”to “~/my-imx6/03_tools”。in development host

解壓源碼包 (decompress source code package)
1)解壓u-boot源碼和內核源碼
decompress u-boot source code and kernel source code
$ cd ~/my-imx6/02_source/imx_3.0.35_4.1.0
$ tar xf u-boot-2009.08--svn*.tar.xz
$ tar xf linux-3.0.35--svn*.tar.xz

2)解壓交叉編譯工具
decompress cross compiler tool
$ cd ~/my-imx6/03_tools/
$ tar jxf gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.bz2


開發(fā)環(huán)境配置(development environment configuration)安裝需要的包 (install package needed)
1)更新源列表
list of updated source
$ sudo apt-get update

更新完成后如下圖所示:
after update,it will look like below:

2)安裝aptitude包管理工具和ia32-libs
install aptitude package management tool and ia32-libs
提示:如果編譯主機的Linux是32位的,可以跳過此步驟。
tips:if Linux of compiler host is 32bit,you can skip this step。
  • 安裝aptitude包管理工具
install aptitude package management tool

$ sudo apt-get –y install aptitude
  • 使用aptitude安裝ia32-libs
install ia32-libs with aptitude
$ sudo aptitude –y install ia32-libs
提示:下圖為安裝過aptitude和ia32-libs后,再次執(zhí)行安裝命令的截圖。
tips:following is the screenshots with re-execution of installation command after installation of aptitude and ia32-libs is finished。

3)安裝mkimage工具
install mkimage tool
$ sudo apt-get -y install uboot-mkimage
提示:下圖為安裝過mkimage工具后,再次執(zhí)行安裝命令的截圖。
tips:following is the screenshots with re-execution of installation command after installation of mkimage tool is finished。

4)安裝ncurses-dev
install ncurses-dev
說明:make menuconfig對其具有依賴性質。
instruction:make menuconfig is dependent on it。
$ sudo aptitude -y install ncurses-dev
提示:下圖為安裝過ncurses-dev工具后,再次執(zhí)行安裝命令的截圖。
tips:following is the screenshots with re-execution of installation command after installation of ncurses-dev tool is finished。

配置MY-IMX6編譯的環(huán)境變量 (configure environment variables of MY-IMX6 compilation)
1)將平臺信息寫入到一個新的配置文件
write platform information to a new configured file
$ echo "export ARCH=arm" > ~/my-imx6/03_tools/myimx6_3035_build_env
2)將交叉編譯工具鏈路徑寫入到配置文件
write compiler tool chain path to configured file
  • 進入交叉編譯工具目錄
enter cross compiler tool directory
$ cd ~/my-imx6/03_tools/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/
  • 將路徑寫入到配置文件
write path to configured file
$ sed -i "\$a IMX6_GCC462_PATH=$PWD" ~/my-imx6/03_tools/myimx6_3035_build_env
  • 將交叉編譯工具寫入到配置文件
write cross compiler tool to configured file
$ sed -i "\$a export CROSS_COMPILE=\$IMX6_GCC462_PATH/arm-none-linux-gnueabi-" ~/my-imx6/03_tools/myimx6_3035_build_env
3)查看配置文件
view configured file
$ cat ~/my-imx6/03_tools/myimx6_3035_build_env
4)附圖
figures

注意:如果在某一步操作錯誤,則需要刪除 ~/my-imx6/03_tools/myimx6_3035_build_env 文件,并重新按照本小節(jié)操作。
note:if an error occurs in any step, need to delect ~/my-imx6/03_tools/myimx6_3035_build_env ,and operate again all steps of this segment。

編譯u-boot(compile u-boot)
進入u-boot源碼目錄(enter u-boot source code directory)
$ cd ~/my-imx6/02_source/imx_3.0.35_4.1.0/u-boot-2009.08/


使配置文件生效(validate configured file)
  • 執(zhí)行source命令
execute source command
$ source ~/my-imx6/03_tools/myimx6_3035_build_env

  • 查看編譯配置
view compiler configuration
$ echo $ARCH
$ echo $CROSS_COMPILE
提示:可看到ARCH和CROSS_COMPILE被設置
tips:you can see that ARCH和CROSS_COMPILE is configured

  • 驗證交叉編譯工具配置
verify cross compiler tool configuration
$${CROSS_COMPILE}gcc –v
提示:執(zhí)行命令后可以看到終端顯示出交叉編譯工具的版本信息。如下圖:
tips:you can see version information of cross compiler tool shown on terminal after execution of command.as below:


清除u-boot配置(remove u-boot configuration)
$ make distclean


u-boot配置(u-boot configuration)
  • 評估板及對應的 u-boot 編譯配置:
evaluation board and its corresponding u-boot compiler configuration:
評估板主型號
(evaluation board main model)
CPU類型-內存容量
(CPU type-memory capacity)
對應的u-boot配置
(corresponding u-boot configuration)
MY-IMX6-EK2006Q(四核)- 1G       
(6Q(quad. core)- 1G)
myimx6ek200_6q_config
6Q(四核)- 2G       
(6Q(quad core)- 2G)
myimx6ek200_6q_2g_config
6U(雙核簡化)- 1G
(6U(dual core tile)- 1G)
myimx6ek200_6u_config
6S(單核)- 512M
(6S(single core)- 512M)
myimx6ek200_6s_config
MY-IMX6-EK3146Q(四核)- 1G       
(6Q(quad.core)- 1G)
myimx6ek314_6q_config
6Q(四核)- 2G       
(6Q(quad.core)- 2G)
myimx6ek314_6q_2g_config
6U(雙核簡化)- 1G
(6U(dual core tile)- 1G)
myimx6ek314_6u_config
6S(單核)- 512M
(6S(single core)- 512M)
myimx6ek314_6s_config
  • MYIMX6EK200-6Qxx-1G配置示例:
MYIMX6EK200-6Qxx-1G configuration example:
$ make myimx6ek200_6q_config


編譯(compilation)
  • 執(zhí)行編譯
execute compilation
$ make
提示:這里為了提高編譯速度,在make后面加了“-j4”。這里編譯的Linux主機是雙核4線程的,所以“-j”后面用了4,也就是采用4線程編譯。“-j”后面的數(shù)字可以根據(jù)系統(tǒng)資源分配,但是不應該超過編譯主機最大支持的線程數(shù)。
Tips:To speed up the compilation,add "-j4" after make.The Linux host used to compile is dual-core ,4 threads .So "-j" is followed by 4, which takes 4 threads to compile. The number behind "-j" is allocated based on system resources,but It should not exceed the maximum threads the host support。

  • 編譯完成
complete compilation
提示:u-boot編譯過程大概需要幾分鐘時間。
tips:u-boot compilation process will take a few minustes or so。


目標文件(target file)
編譯完成后通過ls命令即可看到編譯得到的目標文件u-boot.bin
you can get the compiled file u-boot.bin with ls command after compilation
$ ls


編譯內核(compile kernel)
進入內核源碼目錄(enter kernel source directory)
$ cd ~/my-imx6/02_source/imx_3.0.35_4.1.0/linux-3.0.35/


使配置文件生效(validate configured file)
  • 執(zhí)行source命令
execute source command
$ source ~/my-imx6/03_tools/myimx6_3035_build_env

  • 查看編譯配置
view compiler configuration
$ echo $ARCH
$ echo $CROSS_COMPILE
提示:可看到ARCH和CROSS_COMPILE被設置
tips:you can see that ARCH和CROSS_COMPILE is configured

  • 驗證交叉編譯工具配置
verify cross compiler tool configuration
$ ${CROSS_COMPILE}gcc –v
提示:執(zhí)行命令后可以看到終端顯示出交叉編譯工具的版本信息。如下圖:
tips:you can see version information of cross compiler tool shown on terminal after execution of command.as below:


準備配置內核(prepare for kernel configuration)
  • 清除內核配置
remove kernel configuration
$ make distclean

  • 生成.config文件
generated.config file
說明:MY-IMX6-EK200系列評估板及MY-IMX6-EK314系列評估板使用的配置文件是myimx6_defconfig
instructions:configuration files used for MY-IMX6-EK200 seires of evaluation board and MY-IMX6-EK314 series of evaluation board is myimx6_defconfig
$ make myimx6_defconfig


編譯內核(compile kernel)
  • 編譯uImage
compile uImage
$ make uImage
說明:截圖中使用了4線程編譯。
instruction:4 threads compilation is used in the screenshots。

  • 編譯完成
complete compilation

  • 目標文件
target file
arch/arm/boot/uImage即為編譯得到的目標文件,使用ls命令可查看文件信息。
arch/arm/boot/uImage is the target file through compilation,you can view the file information with ls command。
$ ls arch/arm/boot/uImage –la


編譯模塊(compile module)
  • 編譯
compile
$ make
說明:截圖中使用了4線程編譯。
instruction:4 threads compilation is used in the screenshots。

  • 編譯完成
complete compilation

  • 目標文件
target file
編譯完成后各模塊的.ko文件位于代碼所在的目錄,通過find命令可以找出編譯完成的模塊,參考命令如下:
.ko file of each module is in the directory where code is located after compilation ,you can find the module compiled with find command after compilation,refering command as below:
$ find -name *.ko


Linux應用程序編譯(Linux application compilation)
編寫應用程序(write application)
1) 創(chuàng)建應用程序目錄
create application directory
$ mkdir ~/my-imx6/02_source/application/ -p
$ cd ~/my-imx6/02_source/application/

2) 編寫應用程序(這里以hello.c為例)

創(chuàng)建 hello.c 文件寫入以下代碼并保存:

  • include
int main(int argc, char **argv)
{
   printf("Hello, MYZR!\n");
   
   return;
}
3) 查看代碼
$ cat hello.c


使編譯配置文件生效(validate compiler configured file)
  • 執(zhí)行source命令

$ source ~/my-imx6/03_tools/myimx6_3035_build_env

  • 查看編譯配置

$ echo $ARCH
$ echo $CROSS_COMPILE
提示:可看到ARCH和CROSS_COMPILE被設置


  • 驗證交叉編譯工具配置

$ ${CROSS_COMPILE}gcc –v
提示:執(zhí)行命令后可以看到終端顯示出交叉編譯工具的版本信息。如下圖:



編譯應用程序 (compile application)
2) 編譯

$ ${CROSS_COMPILE}gcc hello.c -o hello.out
注意:上面的命令有包含“$”號,即“${CROSS_COMPILE}gcc”,是引用我們source時產生的環(huán)境變量。


3) 查看目標文件類型

$ file hello.out
可以看到目標文件 hello.out 的屬性。



文件系統(tǒng)(file system)
文件系統(tǒng)說明(file system instruction)
文件系統(tǒng)包位于網盤對應的鏡像文件夾中。支持的文件系統(tǒng)類型及下載方式可參照《MY-IMX6 燒錄指導》。


解壓文件系統(tǒng)到編譯主機(decompress file system to compiler host)
1)創(chuàng)建文件系統(tǒng)的目錄并進入

$ mkdir ~/my-imx6/04_rootfs/ -p
$ cd ~/my-imx6/04_rootfs/

2)將文件系統(tǒng)復制到~/my-imx6/04_rootfs/目錄

這一步驟自己采取相應的方式進行

3)解壓文件系統(tǒng)到指定目錄

$ mkdir rootfs
$ sudo tar jxf rootfs-linux.tar.bz2 -C rootfs


添加應用到文件系統(tǒng)(add application to file system)
$ cp ~/my-imx6/02_source/application/hello.out rootfs/app_test/

5)重新打包文件系統(tǒng)

$ rm -rf rootfs-linux.tar.bz2
$ cd rootfs/
$ sudo tar cjf ../rootfs-linux.tar.bz2 *


添加模塊到文件系統(tǒng)(add module to file system)
準備需要模塊的.ko文件,其它請參照“添加應用到文件系統(tǒng)”。


本文地址:http://www.qingdxww.cn/thread-523610-1-1.html     【打印本頁】

本站部分文章為轉載或網友發(fā)布,目的在于傳遞和分享信息,并不代表本網贊同其觀點和對其真實性負責;文章版權歸原作者及原出處所有,如涉及作品內容、版權和其它問題,我們將根據(jù)著作權人的要求,第一時間更正或刪除。
您需要登錄后才可以發(fā)表評論 登錄 | 立即注冊

廠商推薦

  • Microchip視頻專區(qū)
  • 想要避免發(fā)生災難,就用MPLAB® SiC電源仿真器!
  • 基于CEC1712實現(xiàn)的處理器SPI FLASH固件安全彈性方案培訓教程
  • 了解一下Microchip強大的PIC18-Q24 MCU系列
  • 5分鐘詳解定時器/計數(shù)器E和波形擴展!
  • 貿澤電子(Mouser)專區(qū)
關于我們  -  服務條款  -  使用指南  -  站點地圖  -  友情鏈接  -  聯(lián)系我們
電子工程網 © 版權所有   京ICP備16069177號 | 京公網安備11010502021702
快速回復 返回頂部 返回列表
主站蜘蛛池模板: 激情视频网站在线观看 | 久久精品国产四虎 | 91麻豆视频网站 | 青青国产线免观看手机版精品 | 操久久| 亚洲国产成人综合精品2020 | 亚洲最大福利网 | 国产日韩欧美在线一区二区三区 | 国产精品免费观看 | 青春草国产成人精品久久 | 亚洲免费网站在线观看 | 亚洲视频免费在线观看 | 真探秦先生电视剧在线 | 99精品网| 西野翔在线播放 | 国产精品久久久久久一区二区三区 | 手机看片国产日韩 | 亚洲精品播放 | 国产日韩欧美一区 | 一级一片一a一片 | 国产午夜精品视频 | 欧美网站在线观看 | 香蕉欧美 | 一个人hd高清在线观看 | 国产一区日韩二区欧美三 | 在线高清h视频在线观看 | 国产免费一区二区三区免费视频 | 狠狠色狠狠色综合系列 | 国产极品一区 | 欧美日韩中文字幕在线观看 | 在线免费观看欧美 | 日韩视频区 | 天天干天天插 | 亚洲一区二区三区四 | 亚洲国产精品免费在线观看 | 国产成人亚洲精品播放器下载 | 久久er国产精品免费观看2 | 视频国产免费 | 色噜噜国产精品视频一区二区 | 国产黄网站在线观看 | 这里只有精品66 |