查看“MY-IMX6 Linux-4.1.15 Build Manual”的源代码
←
MY-IMX6 Linux-4.1.15 Build Manual
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
<div> = '''Document instruction''' = ---- == '''System environment instruction''' == * CUP architeture of host used for compilation:64bit <br> *System of host:Linux <br> * Linux release version:Ubuntu<br> * Ubuntu version type:server version<br> * Ubuntu version no.:12.04.5<br> * Ubuntu system type:x86-64<br> <span style="color:red">Note: The development host should use ubuntu 12.04.5 x86-64(desktop and server version are available),Using other distribution of Linux and other versions of Ubuntu may encounter unnecessary problems .</span><br> == '''0peration instruction''' == 1)The line in the document which begins with “$”,which is followed by the Linux command.<br> 2)All the Linux commands in the document are recommended to be entered into the host manually for execution.(Copying ,pasting to the host directly to execute may fail).<br> 3)In all the Linux execution commands of the document,if the next character after the space is "-",(example:sudo apt-get –y install),please enter into Linux host to execute manually.(Copying ,pasting to the host directly to execute may fail ).<br> 4)Any line of Linux commands whichi is not finished is recommended to be entered into the host for execution. (Because copy or paste commands cannot contain special character such as "line breaks").<br> 5)Note whether the execution result is consistent with the document image when you enter and execute the command. check the command was entered incorrectly or failed to execute.<br> 6)Please follow the document strictly to compile for the first time.Otherwise ,there may be unexpected error.<br> == '''Screenshots instruction''' == To make the view look neat and tidy , the command prompt in the screenshot should use myzr$ uniformly.<br> == '''Linux command in the image''' == In the image of the document, you can see the input Linux command visually from the lines that start with “myzr$”.<br> == <span style="color:red">'''Important information instruction'''</span> == <span style="color:red">To avoid our customers wasting time and energy when they encounter unnecessary problems in building development environment and compiling process,it is recommended to use “vb43-u12045-serv-amd64” virtual machine system released by MYZR.</span><br> '''Details refered to 《[[MYZR virtual machine system instruction |MYZR virtual machine system instruction]]》''' = '''Prepare source code and relevant file''' = ---- == '''Source code''' == The corresponding Linux version of the evaluation board and the corresponding source code files are shown in the table below:<br> {| class="wikitable" |- !Evaluation board model || u-boot Source code|| linux Source code |- |MY-IMX6-EK200 || rowspan=4|u-boot-2016.03__svn121.tar.xz || rowspan=4|linux-4.1.15__svn189.tar.xz |- |MY-IMX6-EK314 |- |MY-IMX6-EK336 |- |MY-IMX6-EK140 |} == '''Cross compiler tool file''' == Linux program cross compiler tool:gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar<br> Linux cross compiler tool configuration file:gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf-env<br> == '''Creat working directory''' == 1)Cource code directory<br> $ mkdir ~/my-imx6/02_source –p <br> [[File:myimx6linux3.14_build_2.3.0.1.png]]<br> 2)Tool directory<br> $ mkdir ~/my-imx6/03_tools –p<br> [[File:myimx6linux3.14_build_2.3.0.2.png]]<br> 3)Image directory <br> $ mkdir ~/my-imx6/04_image –p<br> [[File:myimx6linux3.14_build_2.3.0.3.png]]<br> $ mkdir ~/my-imx6/04_image/image-linux-4115 –p<br> [[File:myimx6linux3.14_build_2.3.0.4.png]]<br> 4)Application directory<br> $ mkdir ~/my-demo<br> [[File:myimx6linux3.14_build_2.3.0.5.png]]<br> = '''Install cross compiler tool chain''' = ---- == '''Install Linux cross compiler tool chain''' == 1)Enter cross compiler tool chain directory<br> $ cd ~/my-imx6/03_tools/<br> 2)Copy Linux cross compiler tool to directory<br> copy gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar to“~/my-imx6/03_tools”,complete this step by yourself in a proper way.<br> 3)Uncompress Linux Cross Compilation Tools<br> $ tar xf gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar<br> [[File:myimx6linux3.14_build_4.1.0.1.png]]<br> 4)Copy cross compiler tool configuration file<br> Copy gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf-env to“~/my-imx6/03_tools”,complete this step by yourself in a proper way.<br> 5)Check installation<br> $ source gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf-env<br> $ ${CROSS_COMPILE}gcc –v<br> [[File:myimx6linux3.14_build_4.1.0.2.png]]<br> = '''U-Boot compilation''' = ---- == '''Prepare compilation''' == === Copy source code package to development host === Copy“u-boot source code”downloaded to “~/my-imx6/02_source”of Linux development host.<br> Complete this step by yourself in a proper way.<br> === Decompress u-boot source code package === $ cd ~/my-imx6/02_source/<br> $ tar xf u-boot-2016.03__svn121.tar.xz<br> [[File:myimx6linux3.14_build_5.1.2.1.png]]<br> == '''Compilation''' == === Validate compiler configuration file === $ source ~/my-imx6/03_tools/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf-env<br> [[File:myimx6linux3.14_build_5.2.1.1.png]]<br> === Enter u-boot source code directory === $ cd ~/my-imx6/02_source/u-boot-2016.03<br> [[File:myimx6linux3.14_build_5.2.2.1.png]]<br> ===Remove u-boot temporary files=== $ make distclean <br> [[File:myimx6linux3.14_build_5.2.3.1.png]]<br> === Configure u-boot === * Configuration of development and its corresponding compiler:<br> {| class="wikitable" |- !Development board main model ||CPU type-memory capacity|| Architeture of processor || Corresponding u-boot configuration |- |rowspan=7|MY-IMX6-EK200 | i.MX 6QuadPlus - 1G || Cortex-A9 || myimx6ek200-6qp_defconfig |- |i.MX 6QuadPlus - 2G || Cortex-A9 || myimx6ek200-6qp-2g_defconfig |- |i.MX6 Quad - 1G || Cortex-A9 || myimx6ek200-6q_defconfig |- |i.MX6 Quad - 2G || Cortex-A9 || myimx6ek200-6q-2g_defconfig |- |i.MX6 DualLite - 1G || Cortex-A9 || myimx6ek200-6u_defconfig |- |i.MX 6Solo - 512M || Cortex-A9 || myimx6ek200-6s_defconfig |- |i.MX 6Solo - 1G || Cortex-A9 || myimx6ek200-6s-1g_defconfig |- |rowspan=5|MY-IMX6-EK314 | i.MX 6QuadPlus - 1G || Cortex-A9 || myimx6ek200-6qp_defconfig |- |i.MX 6QuadPlus - 2G || Cortex-A9 || myimx6ek200-6qp-2g_defconfig |- |i.MX6 Quad- 1G || Cortex-A9 || myimx6ek314-6q_defconfig |- |i.MX6 Quad- 2G || Cortex-A9 || myimx6ek314-6q-2g_defconfig |- |i.MX6 DualLite - 1G || Cortex-A9 || myimx6ek314-6u_defconfig |- |rowspan=4|MY-IMX6-EK336 |i.MX 6QuadPlus - 1G || Cortex-A9 || myimx6ek336-6qp_defconfig |- |i.MX 6QuadPlus - 2G || Cortex-A9 || myimx6ek336-6qp-2g_defconfig |- |i.MX6 Quad- 1G || Cortex-A9 || myimx6ek336-6q_defconfig |- |i.MX6 Quad- 2G || Cortex-A9 || myimx6ek336-6q-2g_defconfig |- |rowspan=6|MY-IMX6-EK140 |i.MX 6UltraLite-256M || Cortex-A7 || myimx6ek140-6g_defconfig |- |i.MX 6UltraLite-512M || Cortex-A7 || myimx6ek140-6g-512m_defconfig |- |i.MX 6UltraLite Full - 256M|| Cortex-A7 || myimx6ek140p-6g_defconfig |- |i.MX 6UltraLite Full - 512M || Cortex-A7 || myimx6ek140p-6g-512m_defconfig |- |i.MX 6UlltraLite Full - 256M|| Cortex-A7 || myimx6ek140p-6y_defconfig |- |i.MX 6UlltraLite Full - 512M|| Cortex-A7 || myimx6ek140p-6y-512m_defconfig |} *MYIMX6EK200-6Q-1G configuration example:<br> $ make myimx6ek200-6q_defconfig <br> [[File:myimx6linux3.14_build_5.2.4.1.png]]<br> === Execute compilation === $ make <br> 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.<br> [[File:myimx6linux3.14_build_5.2.5.1.png]]<br> * Complete compilation<br> Tips: u-boot compiling process may take one or two minutes.<br> [[File:myimx6linux3.14_build_5.2.5.2.png]]<br> == '''Target file''' == * Compile file<br> You can get the compiled file u-boot .imx with ls command after compilation.<br> $ ls <br> [[File:myimx6linux3.14_build_5.3.0.1.png]]<br> * Target file<br> The corresponding target file name for u-boot configuration of MY-IMX6 series evaluation board is shown in the table below:<br> {| class="wikitable" |- !u-boot Configuration<br> || Target file |- |myimx6ek200-6qp_defconfig || uboot-myimx6ek200-6qp.imx |- |myimx6ek200-6qp-2g_defconfig || uboot-myimx6ek200-6qp-2g.imx |- |myimx6ek200-6q_defconfig || uboot-myimx6ek200-6q.imx |- |myimx6ek200-6q-2g_defconfig || uboot-myimx6ek200-6q-2g.imx |- |myimx6ek200-6u_defconfig || uboot-myimx6ek200-6u.imx |- |myimx6ek200-6s_defconfig || uboot-myimx6ek200-6s.imx |- |myimx6ek200-6s-1g_defconfig || uboot-myimx6ek200-6s-1g.imx |- |colspan=2| |- |myimx6ek314-6qp_defconfig || uboot-myimx6ek314-6qp.imx |- |myimx6ek314-6qp-2g_defconfig || uboot-myimx6ek314-6qp-2g.imx |- |myimx6ek314-6q_defconfig || uboot-myimx6ek314-6q.imx |- |myimx6ek314-6q-2g_defconfig || uboot-myimx6ek314-6q-2g.imx |- |myimx6ek314-6u_defconfig || uboot-myimx6ek314-6u.imx |- |colspan=2| |- |myimx6ek336-6qp_defconfig || uboot-myimx6ek336-6qp.imx |- |myimx6ek336-6qp-2g_defconfig || uboot-myimx6ek336-6qp-2g.imx |- |myimx6ek336-6q_defconfig || uboot-myimx6ek336-6q.imx |- |myimx6ek336-6q-2g_defconfig || uboot-myimx6ek336-6q-2g.imx |- |colspan=2| |- |myimx6ek140-6g_defconfig || uboot-myimx6ek140-6g.imx |- |myimx6ek140-6g-512m_defconfig || uboot-myimx6ek140-6g-512m.imx |- |myimx6ek140p-6g_defconfig || uboot-myimx6ek140p-6g.imx |- |myimx6ek140p-6g-512m_defconfig || uboot-myimx6ek140p-6g-512m.imx |- |myimx6ek140p-6y_defconfig || uboot-myimx6ek140p-6y.imx |- |myimx6ek140p-6y-512m_defconfig || uboot-myimx6ek140p-6y-512m.imx |} We need to copy the compilied file u-boot.imx as our target file name.:<br> Copy the generated file u-boot.imx from the compilation of myimx6ek200-6q_defconfig as target file.):<br> $ cp u-boot.imx ~/my-imx6/04_image/image-linux-4115/uboot-myimx6ek200-6q.imx<br> [[File:myimx6linux3.14_build_5.3.0.2.png]]<br> = '''Compile kernel''' = ---- == '''Prepare compilation''' == === Copy source code package to development host === Copy “linux source code”downloaded to “~/my-imx6/02_source”of Linux development host.<br> Complete this step by yourself in a proper way.<br> === Decompress linux source code package === $ cd ~/my-imx6/02_source/<br> $ tar xf linux-4.1.15__svn189.tar.xz<br> [[File:myimx6linux3.14_build_6.1.2.1.png]]<br> == '''Kernel compilation configuration''' == === Validate compilfer configuration file === $ source ~/my-imx6/03_tools/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf-env<br> [[File:myimx6linux3.14_build_6.2.1.1.png]]<br> === Remove kernel temporary file === * Enter linux source code directory <br> $ cd ~/my-imx6/02_source/linux-4.1.15<br> [[File:myimx6linux3.14_build_6.2.2.1.png]]<br> * Remove temporary file <br> $ make distclean <br> [[File:myimx6linux3.14_build_6.2.2.2.png]]<br> === Kernel configuration === *Kernel configuration file <br> {| class="wikitable" |- !Evaluation board model || Configuration file |- |MY-IMX6-EK200 || rowspan=3|myimx6a9_defconfig |- |MY-IMX6-EK314 |- |MY-IMX6-EK336 |- |MY-IMX6-EK140 || myimx6a7_defconfig |} $ make myimx6a9_defconfig <br> If what compified is kernel of MY-IMX6-EK140,please use $ make myimx6a7_defconfig.<br> Take myimx6a9_defconfig as an example.<br> [[File:myimx6linux3.14_build_6.2.3.1.png]]<br> == '''Compile kernel''' == * Execute compilation<br> $ make zImage <br> [[File:Myimx6linux3.14_build_6.3.0.1.png]]<br> *Complete compilation<br> [[File:Myimx6linux3.14_build_6.3.0.2.png]]<br> * Target file<br> arch/arm/boot/zImage is the kernel file Compiled,you can check file information with ls command.<br> $ ls arch/arm/boot/zImage -la <br> [[File:Myimx6linux3.14_build_6.3.0.3.png]]<br> Note: The kernel file name which is going to be programed and started is “zImage-myimx6” or “zImage-myimx6a7”, So we should copy zImage as zImage-myimx6a9 or zImage-myimx6a7<br> $ cp arch/arm/boot/zImage ~/my-imx6/04_image/image-linux-4115/zImage-myimx6a9 (A9)<br> or<br> $ cp arch/arm/boot/zImage ~/my-imx6/04_image/image-linux-4115/zImage-myimx6a7 (A7) <br> [[File:Myimx6linux3.14_build_6.3.0.4.png]]<br> == '''Compile device tree''' == The correspondence between the type of evaluation board and device tree is shown below:<br> {| class="wikitable" |- ! Development main model || CPU type-memory capacity || Corresponding device tree file |- |rowspan=7|MY-IMX6-EK200 | i.MX 6QuadPlus - 1G || myimx6ek200-6qp.dtb |- | i.MX 6QuadPlus - 2G || myimx6ek200-6qp-2g.dtb |- | i.MX6 Quad - 1G || myimx6ek200-6q.dtb |- | i.MX6 Quad - 2G || myimx6ek200-6q-2g.dtb |- | i.MX6 DualLite - 1G || myimx6ek200-6u.dtb |- | i.MX 6Solo - 512M || myimx6ek200-6s.dtb |- | i.MX 6Solo - 1G || myimx6ek200-6s-1g.dtb |- |rowspan=5|MY-IMX6-EK314 | i.MX 6QuadPlus - 1G || myimx6ek314-6qp.dtb |- | i.MX 6QuadPlus - 2G || myimx6ek314-6qp-2g.dtb |- | i.MX6 Quad - 1G || myimx6ek314-6q.dtb |- | i.MX6 Quad - 2G || myimx6ek314-6q-2g.dtb |- | i.MX6 DualLite - 1G || myimx6ek314-6u.dtb |- |rowspan=4|MY-IMX6-EK336 | i.MX 6QuadPlus - 1G || myimx6ek336-6qp.dtb |- | i.MX 6QuadPlus - 2G || myimx6ek336-6qp-2g.dtb |- | i.MX6 Quad - 1G || myimx6ek336-6q.dtb |- | i.MX6 Quad - 2G || myimx6ek336-6q-2g.dtb |- |rowspan=10|MY-IMX6-EK140 | i.MX 6UltraLite-256M || myimx6ek140-6g.dtb |- | i.MX 6UltraLite-512M || myimx6ek140-6g-512m.dtb |- | i.MX 6UltraLite Full - 256M (2eth) || myimx6ek140p-6g.dtb |- | i.MX 6UltraLite Full - 256M (8uart)|| myimx6ek140p-6g-8uart.dtb |- | i.MX 6UltraLite Full - 512M (2eth) || myimx6ek140p-6g-512m.dtb |- | i.MX 6UltraLite Full - 512M (8uart) || myimx6ek140p-6g-512m-8uart.dtb |- | i.MX 6UlltraLite Full - 256M (2eth) ||myimx6ek140p-6y.dtb |- | i.MX 6UlltraLite Full - 256M (8uart)) || myimx6ek140p-6y-8uart.dtb |- | i.MX 6UlltraLite Full - 512M (2eth) || myimx6ek140p-6y-512m.dtb |- | i.MX 6UlltraLite Full - 512M (8uart) || myimx6ek140p-6y-512m-8uart.dtb |} *Take MY-IMX6-EK200-6Q-1G as example<br> $ make myimx6ek200-6q.dtb<br> [[File:Myimx6linux3.14_build_6.4.0.1.png]]<br> * Target file<br> You can browse the target device tree file information from compilation with ls command:<br> $ ls arch/arm/boot/dts/myimx6ek*.dtb <br> [[File:Myimx6linux3.14_build_6.4.0.2.png]]<br> * Copy device tree file to image directory<br> $ cp arch/arm/boot/dts/myimx6ek*.dtb ~/my-imx6/04_image/image-linux-4115/ <br> [[File:Myimx6linux3.14_build_6.4.0.3.png]]<br> == '''Compile module''' == * Compile module command<br> $ make modules<br> [[File:Myimx6linux3.14_build_6.5.0.1.png]]<br> * Install module to the specified directory <br> $ make modules_install INSTALL_MOD_PATH=./modules<br> [[File:Myimx6linux3.14_build_6.5.0.2.png]]<br> * Package the module file <br> $ cd modules<br> $ tar cjf ../modules.tar.bz2 *<br> [[File:Myimx6linux3.14_build_6.5.0.3.png]]<br> * Copy module package to image directory<br> {| class="wikitable" |- !Development board model || Target module package |- |MY-IMX6-EK200 || rowspan=3|kernel-modules-myimx6a9.tar.bz2 |- |MY-IMX6-EK314 |- |MY-IMX6-EK336 |- |MY-IMX6-EK140 || kernel-modules-myimx6a7.tar.bz2 |} $ cp ../modules.tar.bz2 ~/my-imx6/04_image/image-linux-4115/kernel-modules-myimx6a9.tar.bz2<br> Note:when you compile the Kernel If the configuration file you use is myimx6a9_defconfig, here you should :Copy modules.tar.bz2 as kernel-modules-myimx6a9.tar.bz2.If the configuration file is myimx6a7_defconfig,you should Copy modules.tar.bz2 as kernel-modules-myimx6a7.tar.bz2.<br> = '''Application compilation''' = ---- == '''Linux application compilation''' == === Write an application === * Create application source code directory and Linux-4.1.15 executable program directory<br> $ mkdir ~/my-demo/source_code -p<br> [[File:Myimx6linux3.14_build_8.1.1.1.png]]<br> $ mkdir ~/my-demo/bin-l4115 -p<br> [[File:Myimx6linux3.14_build_8.1.1.2.png]]<br> * Write source code<br> $ cd ~/my-demo/source_code<br> $ vi hello.c<br> Write following code and save<br> #include <stdio.h> <br> <br> int main(int argc, char **argv) <br> { <br> printf("Hello, MYZR!\n"); <br> <br> return; <br> } <br> * View code<br> [[File:Myimx6linux3.14_build_8.1.1.3.png]]<br> $ cat hello.c<br> === Compile application === * Configure environment variables<br> $ source ~/my-imx6/03_tools/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf-env<br> [[File:Myimx6linux3.14_build_8.1.2.1.png]]<br> * Compile<br> $ ${CROSS_COMPILE}gcc hello.c -o hello.out<br> [[File:Myimx6linux3.14_build_8.1.2.2.png]]<br> Note:The above command contains “$”,which is “${CROSS_COMPILE}gcc”. It is the environment variable generated when referring to our source.<br> * Target file <br> $ file hello.out<br> [[File:Myimx6linux3.14_build_8.1.2.3.png]]<br> You can see the property of target file hello.out.<br> === Save target executable file === $ mv hello.out ~/my-demo/bin-l31452/<br> [[File:Myimx6linux3.14_build_8.1.3.1.png]]<br> == '''Package application''' == === Instruction === Programming tool supports to program “my-demo.tar.xz” file package to evaluation board.So We package applications We need as “my-demo.tar.xz”.while where “my-demo.tar.xz” will be programmed ,refer to [[MY-IMX6 MfgTool User Guide|《MY-IMX6 MfgTool User Guide》]].<br> === Package application === 1)Package<br> Here We package the whole my-demo directory.<br> $ cd ~<br> $ tar cjf my-demo.tar.bz2 my-demo<br> [[File:Myimx6linux3.14_build_8.3.2.1.png]]<br> 2)Copy application package as target programming file.<br> $ cp my-demo.tar.bz2 ~/my-imx6/04_image/image-linux-31452/<br> [[File:Myimx6linux3.14_build_8.3.2.2.png]]<br> = '''Target programming file''' = ---- So far,we get a set of programming file except file system from“~/my-imx6/04_image/image-linux-31452/”。including“uboot*.imx”、“myimx6*.dtb”、“zImage-myimx6”、“kernel-modules.tar.bz2”、“my-demo.tar.bz2”.<br> Now we can program the image we compiled by ourselves referring to [[MY-IMX6 MfgTool User Guide|《MY-IMX6 MfgTool User Guide》]].<br> </div>
返回至
MY-IMX6 Linux-4.1.15 Build Manual
。
导航菜单
个人工具
登录
命名空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
[-_-]
NXP平台:
MYZR-IMX6-EK200
MYZR-IMX6-EK200(EN)
MYZR-IMX6-EK314
MYZR-IMX6-EK314(EN)
MYZR-IMX6-EK336
MYZR-IMX6-EK336(EN)
MYZR-IMX6-EK140
MYZR-IMX6-EK140(EN)
MYZR-IMX6-EK140P
MYZR-IMX6-EK140P(EN)
MYZR-IMX8M-EK300
MYZR-IMX8M-EK300(EN)
MYZR-IMX8M-EVK
MYZR-IMX8Mmini-EK240
MYZR-IMX8Mmini-EK240(EN)
MYZR-IMX28-EK142
MYZR-IMX28-EK142(EN)
MYZR-LS1012A-EK200
MYZR-LS1012A-EK200(EN)
Rockchip平台:
MYZR-RK3288-EK314
MYZR-RK3288-EK314(EN)
MYZR-RK3399-EK314
MYZR-RK3399-EK314(EN)
Allwinner平台:
MYZR-R16-EK166
MYZR-R16-EK166(EN)
Microchip平台:
MYZR-SAMA5-EK200
MYZR-SAMA5-EK200(EN)
网关产品:
GW200
GW300
GW310/GW311
ST平台:
MYZR-STM32-EK152
所有页面
工具
链入页面
相关更改
特殊页面
页面信息