欢迎来到三一文库! | 帮助中心 三一文库31doc.com 一个上传文档投稿赚钱的网站
三一文库
全部分类
  • 研究报告>
  • 工作总结>
  • 合同范本>
  • 心得体会>
  • 工作报告>
  • 党团相关>
  • 幼儿/小学教育>
  • 高等教育>
  • 经济/贸易/财会>
  • 建筑/环境>
  • 金融/证券>
  • 医学/心理学>
  • ImageVerifierCode 换一换
    首页 三一文库 > 资源分类 > DOC文档下载  

    IMX6 L3035编译手册.doc

    • 资源ID:3252971       资源大小:47.50KB        全文页数:11页
    • 资源格式: DOC        下载积分:4
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录   微博登录  
    二维码
    微信扫一扫登录
    下载资源需要4
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    IMX6 L3035编译手册.doc

    IMX6 L3035编译手册明远智睿MY-IMX6L3035编译手册2018年03月15日10:03myzr123准备源码包(preparesourcecodepacakge)3.0.35版本代码(3.0.35versioncode)u-boot源码(u-bootsourcecode)文件名:u-boot-2009.08-svn*.tar.xznameoffile:u-boot-2009.08-svn*.tar.xzkernel源码(kernelsourcecode)文件名:linux-3.0.35-svn*.tar.xznameoffile:linux-3.0.35-svn*.tar.xz交叉编译工具(crosscompifertool)文件名:gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.bz2nameoffile:gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.bz2配置编译环境(configurationofcompiferenvironment)准备源码(preparesourcecode)准备源码包(preparesourcecodepackage)1)创建工作目录createworkingdirectory创建/my-imx6作为工作目录create/my-imx6asworkingdirectory$mkdir/my-imx6创建/my-imx6/02_source/imx_3.0.35_4.1.0作为源码目录create/my-imx6/02_source/imx_3.0.35_4.1.0assourcecodedirectory$mkdir/my-imx6/02_source/imx_3.0.35_4.1.0-p创建/my-imx6/03_tools作为工具目录create/my-imx6/03_toolsastooldirectory$mkdir/my-imx6/03_tools-p2)复制源码包到开发主机中copysourcecodepackagetothedevelopmenthost这一步骤自己采取相应的方式进行。doitinthisstepinyourownway。提示:这里将网盘中“02_源码”复制到Linux开发主机的“/my-imx6/02_source/imx_3.0.35_4.1.0”,将网盘中“03_工具/toolchain”复制到Linux开发主机的“/my-imx6/03_tools”。tip:thisstepistocopy“02_sourcecode”fromnetworkdiskto“/my-imx6/02_source/imx_3.0.35_4.1.0”indevelopmenthost,andcopy“03_tool/toolchain”to“/my-imx6/03_tools”。indevelopmenthost解压源码包(decompresssourcecodepackage)1)解压u-boot源码和内核源码decompressu-bootsourcecodeandkernelsourcecode$cd/my-imx6/02_source/imx_3.0.35_4.1.0$tarxfu-boot-2009.08-svn*.tar.xz$tarxflinux-3.0.35-svn*.tar.xz2)解压交叉编译工具decompresscrosscompilertool$cd/my-imx6/03_tools/$tarjxfgcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.bz2开发环境配置(developmentenvironmentconfiguration)安装需要的包(installpackageneeded)1)更新源列表listofupdatedsource$sudoapt-getupdate更新完成后如下图所示:afterupdate,itwilllooklikebelow:2)安装aptitude包管理工具和ia32-libsinstallaptitudepackagemanagementtoolandia32-libs提示:如果编译主机的Linux是32位的,可以跳过此步骤。tips:ifLinuxofcompilerhostis32bit,youcanskipthisstep。安装aptitude包管理工具installaptitudepackagemanagementtool$sudoapt-getyinstallaptitude使用aptitude安装ia32-libsinstallia32-libswithaptitude$sudoaptitudeyinstallia32-libs提示:下图为安装过aptitude和ia32-libs后,再次执行安装命令的截图。tips:followingisthescreenshotswithre-executionofinstallationcommandafterinstallationofaptitudeandia32-libsisfinished。3)安装mkimage工具installmkimagetool$sudoapt-get-yinstalluboot-mkimage提示:下图为安装过mkimage工具后,再次执行安装命令的截图。tips:followingisthescreenshotswithre-executionofinstallationcommandafterinstallationofmkimagetoolisfinished。4)安装ncurses-devinstallncurses-dev说明:makemenuconfig对其具有依赖性质。instruction:makemenuconfigisdependentonit。$sudoaptitude-yinstallncurses-dev提示:下图为安装过ncurses-dev工具后,再次执行安装命令的截图。tips:followingisthescreenshotswithre-executionofinstallationcommandafterinstallationofncurses-devtoolisfinished。配置MY-IMX6编译的环境变量(configureenvironmentvariablesofMY-IMX6compilation)1)将平台信息写入到一个新的配置文件writeplatforminformationtoanewconfiguredfile$echo“exportARCH=arm”/my-imx6/03_tools/myimx6_3035_build_env2)将交叉编译工具链路径写入到配置文件writecompilertoolchainpathtoconfiguredfile进入交叉编译工具目录entercrosscompilertooldirectory$cd/my-imx6/03_tools/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/将路径写入到配置文件writepathtoconfiguredfile$sed-i“$aIMX6_GCC462_PATH=$PWD”/my-imx6/03_tools/myimx6_3035_build_env将交叉编译工具写入到配置文件writecrosscompilertooltoconfiguredfile$sed-i“$aexportCROSS_COMPILE=$IMX6_GCC462_PATH/arm-none-linux-gnueabi-”/my-imx6/03_tools/myimx6_3035_build_env3)查看配置文件viewconfiguredfile$cat/my-imx6/03_tools/myimx6_3035_build_env注意:如果在某一步操作错误,则需要删除/my-imx6/03_tools/myimx6_3035_build_env文件,并重新按照本小节操作。note:ifanerroroccursinanystep,needtodelect/my-imx6/03_tools/myimx6_3035_build_env,andoperateagainallstepsofthissegment。编译u-boot(compileu-boot)进入u-boot源码目录(enteru-bootsourcecodedirectory)$cd/my-imx6/02_source/imx_3.0.35_4.1.0/u-boot-2009.08/使配置文件生效(validateconfiguredfile)执行source命令executesourcecommand$source/my-imx6/03_tools/myimx6_3035_build_env查看编译配置viewcompilerconfiguration$echo$ARCH$echo$CROSS_COMPILE提示:可看到ARCH和CROSS_COMPILE被设置tips:youcanseethatARCH和CROSS_COMPILEisconfigured验证交叉编译工具配置verifycrosscompilertoolconfiguration$CROSS_COMPILEgccv提示:执行命令后可以看到终端显示出交叉编译工具的版本信息。如下图:tips:youcanseeversioninformationofcrosscompilertoolshownonterminalafterexecutionofcommand.asbelow:清除u-boot配置(removeu-bootconfiguration)$makedistcleanu-boot配置(u-bootconfiguration)评估板及对应的u-boot编译配置:evaluationboardanditscorrespondingu-bootcompilerconfiguration:评估板主型号(evaluationboardmainmodel)CPU类型-内存容量(CPUtype-memorycapacity)对应的u-boot配置(correspondingu-bootconfiguration)MY-IMX6-EK2006Q(四核)-1G(6Q(quad.core)-1G)myimx6ek200_6q_config6Q(四核)-2G(6Q(quadcore)-2G)myimx6ek200_6q_2g_config6U(双核简化)-1G(6U(dualcoretile)-1G)myimx6ek200_6u_config6S(单核)-512M(6S(singlecore)-512M)myimx6ek200_6s_configMY-IMX6-EK3146Q(四核)-1G(6Q(quad.core)-1G)myimx6ek314_6q_config6Q(四核)-2G(6Q(quad.core)-2G)myimx6ek314_6q_2g_config6U(双核简化)-1G(6U(dualcoretile)-1G)myimx6ek314_6u_config6S(单核)-512M(6S(singlecore)-512M)myimx6ek314_6s_configMYIMX6EK200-6Qxx-1G配置示例:MYIMX6EK200-6Qxx-1Gconfigurationexample:$makemyimx6ek200_6q_config编译(compilation)执行编译executecompilation$make提示:这里为了提高编译速度,在make后面加了“-j4”。这里编译的Linux主机是双核4线程的,所以“-j”后面用了4,也就是采用4线程编译。“-j”后面的数字可以根据系统资源分配,但是不应该超过编译主机最大支持的线程数。Tips:Tospeedupthecompilation,add“-j4”aftermake.TheLinuxhostusedtocompileisdual-core,4threads.So“-j”isfollowedby4,whichtakes4threadstocompile.Thenumberbehind“-j”isallocatedbasedonsystemresources,butItshouldnotexceedthemaximumthreadsthehostsupport。编译完成completecompilation提示:u-boot编译过程大概需要几分钟时间。tips:u-bootcompilationprocesswilltakeafewminustesorso。目标文件(targetfile)编译完成后通过ls命令即可看到编译得到的目标文件u-boot.binyoucangetthecompiledfileu-boot.binwithlscommandaftercompilation$ls编译内核(compilekernel)进入内核源码目录(enterkernelsourcedirectory)$cd/my-imx6/02_source/imx_3.0.35_4.1.0/linux-3.0.35/使配置文件生效(validateconfiguredfile)执行source命令executesourcecommand$source/my-imx6/03_tools/myimx6_3035_build_env查看编译配置viewcompilerconfiguration$echo$ARCH$echo$CROSS_COMPILE提示:可看到ARCH和CROSS_COMPILE被设置tips:youcanseethatARCH和CROSS_COMPILEisconfigured验证交叉编译工具配置verifycrosscompilertoolconfiguration$CROSS_COMPILEgccv提示:执行命令后可以看到终端显示出交叉编译工具的版本信息。如下图:tips:youcanseeversioninformationofcrosscompilertoolshownonterminalafterexecutionofcommand.asbelow:准备配置内核(prepareforkernelconfiguration)清除内核配置removekernelconfiguration$makedistclean生成.config文件generated.configfile说明:MY-IMX6-EK200系列评估板及MY-IMX6-EK314系列评估板使用的配置文件是myimx6_defconfiginstructions:configurationfilesusedforMY-IMX6-EK200seiresofevaluationboardandMY-IMX6-EK314seriesofevaluationboardismyimx6_defconfig$makemyimx6_defconfig编译内核(compilekernel)编译uImagecompileuImage$makeuImage说明:截图中使用了4线程编译。instruction:4threadscompilationisusedinthescreenshots。编译完成completecompilation目标文件targetfilearch/arm/boot/uImage即为编译得到的目标文件,使用ls命令可查看文件信息。arch/arm/boot/uImageisthetargetfilethroughcompilation,youcanviewthefileinformationwithlscommand。$lsarch/arm/boot/uImagela编译模块(compilemodule)编译compile$make说明:截图中使用了4线程编译。instruction:4threadscompilationisusedinthescreenshots。编译完成completecompilation目标文件targetfile编译完成后各模块的.ko文件位于代码所在的目录,通过find命令可以找出编译完成的模块,参考命令如下:.kofileofeachmoduleisinthedirectorywherecodeislocatedaftercompilation,youcanfindthemodulecompiledwithfindcommandaftercompilation,referingcommandasbelow:$find-name*.koLinux应用程序编译(Linuxapplicationcompilation)编写应用程序(writeapplication)1)创建应用程序目录createapplicationdirectory$mkdir/my-imx6/02_source/application/-p$cd/my-imx6/02_source/application/2)编写应用程序(这里以hello.c为例)创建hello.c文件写入以下代码并保存:includeintmain(intargc,char*argv)printf(“Hello,MYZR!n”);return;3)查看代码$cathello.c使编译配置文件生效(validatecompilerconfiguredfile)执行source命令$source/my-imx6/03_tools/myimx6_3035_build_env查看编译配置$echo$ARCH$echo$CROSS_COMPILE提示:可看到ARCH和CROSS_COMPILE被设置验证交叉编译工具配置$CROSS_COMPILEgccv提示:执行命令后可以看到终端显示出交叉编译工具的版本信息。如下图:编译应用程序(compileapplication)2)编译$CROSS_COMPILEgcchello.c-ohello.out注意:上面的命令有包含“$”号,即“$CROSS_COMPILEgcc”,是引用我们source时产生的环境变量。3)查看目标文件类型$filehello.out可以看到目标文件hello.out的属性。文件系统(filesystem)文件系统说明(filesysteminstruction)文件系统包位于网盘对应的镜像文件夹中。支持的文件系统类型及下载方式可参照MY-IMX6烧录指导。解压文件系统到编译主机(decompressfilesystemtocompilerhost)1)创建文件系统的目录并进入$mkdir/my-imx6/04_rootfs/-p$cd/my-imx6/04_rootfs/2)将文件系统复制到/my-imx6/04_rootfs/目录这一步骤自己采取相应的方式进行3)解压文件系统到指定目录$mkdirrootfs$sudotarjxfrootfs-linux.tar.bz2-Crootfs添加应用到文件系统(addapplicationtofilesystem)$cp/my-imx6/02_source/application/hello.outrootfs/app_test/5)重新打包文件系统$rm-rfrootfs-linux.tar.bz2$cdrootfs/$sudotarcjf。/rootfs-linux.tar.bz2*添加模块到文件系统(addmoduletofilesystem)准备需要模块的.ko文件,其它请参照“添加应用到文件系统”。

    注意事项

    本文(IMX6 L3035编译手册.doc)为本站会员(白大夫)主动上传,三一文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    经营许可证编号:宁ICP备18001539号-1

    三一文库
    收起
    展开