“MYZR-IMX28系列评估板 Linux-2.6.35 编译手册”的版本间的差异

来自明远智睿的wiki
跳转至: 导航搜索
 
(未显示同一用户的4个中间版本)
第1行: 第1行:
 +
<div>
  
= '''文档说明(document instruction)''' =
+
= '''文档说明''' =
 
----
 
----
== '''系统环境说明(system environment instruction)''' ==
+
== '''系统环境说明''' ==
 
*编译主机CPU架构:64位 <br>
 
*编译主机CPU架构:64位 <br>
<span style="background:#CCCCCC">CUP architeture of host used for compilation:64bit</span><br>
 
 
*编译主机系统:Linux <br>
 
*编译主机系统:Linux <br>
<span style="background:#CCCCCC">CUP architeture of host used for compilation:64bit</span><br>
 
 
*Linux发行版:Ubuntu <br>
 
*Linux发行版:Ubuntu <br>
<span style="background:#CCCCCC">Linux release verson:Ubuntu</span><br>
 
 
*Ubuntu版本类型:服务器版 <br>
 
*Ubuntu版本类型:服务器版 <br>
<span style="background:#CCCCCC">Ubuntu version type: saver veresion</span><br>
 
 
*Ubuntu版本号:12.04.5 <br>
 
*Ubuntu版本号:12.04.5 <br>
<span style="background:#CCCCCC">Ubuntu version no.:12.04.5</span><br>
 
 
*Ubuntu系统类型:x86-64 <br>
 
*Ubuntu系统类型:x86-64 <br>
<span style="background:#CCCCCC">Ubuntu system type:x86-64</span><br>
 
 
  <span style="color:red">注意:开发主机请使用ubuntu 12.04.5 x86-64(桌面版或服务器版均可),使用其他发行版的Linux或Ubuntu的其它版本可能会遇到的不必要的问题。 <br>
 
  <span style="color:red">注意:开发主机请使用ubuntu 12.04.5 x86-64(桌面版或服务器版均可),使用其他发行版的Linux或Ubuntu的其它版本可能会遇到的不必要的问题。 <br>
<span style="background:#CCCCCC">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>
 
  
== '''操作说明 (operation instruction)''' ==
+
== '''操作说明''' ==
 
1)文档中以“$”开头的行,其后是Linux命令。 <br>
 
1)文档中以“$”开头的行,其后是Linux命令。 <br>
<span style="background:#CCCCCC">The line in the document which begins with “$”,which is followed by the Linux command.</span><br>
 
 
2)文档中所有的Linux命令建议手动输入到Linux主机执行(直接复制、粘贴到Linux主机上执行,可能会执行失败)。 <br>
 
2)文档中所有的Linux命令建议手动输入到Linux主机执行(直接复制、粘贴到Linux主机上执行,可能会执行失败)。 <br>
<span style="background:#CCCCCC">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)</span><br>
 
 
3)文档中的Linux执行命令,如果空格后的下一个字符是“-”的(如:sudo apt-get –y install之类的),请手动输入到Linux主机执行(直接复制、粘贴到Linux主机上执行,通常会执行失败)。 <br>
 
3)文档中的Linux执行命令,如果空格后的下一个字符是“-”的(如:sudo apt-get –y install之类的),请手动输入到Linux主机执行(直接复制、粘贴到Linux主机上执行,通常会执行失败)。 <br>
<span style="background:#CCCCCC">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 )</span><br>
 
 
4)文档中所有一行没写完的Linux命令请手动输入到Linux主机执行,(因为复制、粘贴命令不能包含类似“换行符”之类的特殊字符)。 <br>
 
4)文档中所有一行没写完的Linux命令请手动输入到Linux主机执行,(因为复制、粘贴命令不能包含类似“换行符”之类的特殊字符)。 <br>
<span style="background:#CCCCCC">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")</span><br>
 
 
5)按文档输入并执行Linux命令时注意观察命令的执行结果与文档图片中的是否一致,以确认命令是否输入有误及是否执行失败。 <br>
 
5)按文档输入并执行Linux命令时注意观察命令的执行结果与文档图片中的是否一致,以确认命令是否输入有误及是否执行失败。 <br>
<span style="background:#CCCCCC">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.</span><br>
 
 
6)第一遍编译请严格按照文档进行,否则可能出现莫名其妙的错误。<br>
 
6)第一遍编译请严格按照文档进行,否则可能出现莫名其妙的错误。<br>
<span style="background:#CCCCCC">Please follow the document strictly to compile for the first time.Otherwise ,there may be unexpected error</span><br>
 
  
  
== '''截图说明(screenshots instruction)''' ==
+
== '''截图说明''' ==
 
为使视图看起来简洁整齐,截图中的命令提示符统一使用myzr$。<br>
 
为使视图看起来简洁整齐,截图中的命令提示符统一使用myzr$。<br>
<span style="background:#CCCCCC">To make the view look neat and tidy , the command prompt in the screenshot should use myzr$ uniformly</span><br>
 
  
== '''图片中的Linux命令(Linux command in the image)''' ==
+
== '''图片中的Linux命令''' ==
 
在文档的图片中观察“linyn@u12045-serv:~$”开头的行可以直观的看到输入的linux命令。<br>
 
在文档的图片中观察“linyn@u12045-serv:~$”开头的行可以直观的看到输入的linux命令。<br>
<span style="background:#CCCCCC">In the image of the document, you can see the input Linux command visually from the lines that start with “linyn@u12045-serv:~$”。</span><br>
 
  
= '''准备源码及相关文件(prepare source code and relevant files)''' =
+
= '''准备源码及相关文件''' =
 
----
 
----
== '''源码文件(source code)''' ==
+
== '''源码文件''' ==
 
评估板对应的Linux版本及对应的源码文件见下表:<br>
 
评估板对应的Linux版本及对应的源码文件见下表:<br>
<span style="background:#CCCCCC">The corresponding Linux version of the evaluation board and the corresponding source code files are shown in the table below:</span><br>
 
 
{| class="wikitable"
 
{| class="wikitable"
!评估板型号<br>(evaluation board model)
+
!评估板型号
!支持的系统版本<br>(system version supported)
+
!支持的系统版本
!u-boot源码文件<br>(source code)
+
!u-boot源码文件
!linux源码文件<br>(source code)
+
!linux源码文件
 
|-
 
|-
|MY-IMX28-EVK ||Linux-2.6.35 ||u-boot-2009.08.tar.bz2<br>imx-bootlets-src-10.12.01.tar.bz2||linux-2.6.35.3.tar.bz2
+
|MYZR-IMX28-EVK ||Linux-2.6.35 ||u-boot-2009.08.tar.bz2<br>imx-bootlets-src-10.12.01.tar.bz2||linux-2.6.35.3.tar.bz2
 
|-
 
|-
  
 
|}
 
|}
  
== '''交叉编译工具文件(cross compilation tool file)''' ==
+
== '''交叉编译工具文件''' ==
 
Linux程序交叉编译工具:gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2<br>
 
Linux程序交叉编译工具:gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2<br>
<span style="background:#CCCCCC">Linux program cross compilation tool:gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2</span><br>
 
 
Linux交叉编译工具配置文件:gcc-4.4.4-glibc-2.11.1-multilib-env<br>
 
Linux交叉编译工具配置文件:gcc-4.4.4-glibc-2.11.1-multilib-env<br>
<span style="background:#CCCCCC">Linux cross compilation tool configuration file:gcc-4.4.4-glibc-2.11.1-multilib-env</span><br>
 
  
== '''创建工作目录(creat working directory)''' ==
+
== '''创建工作目录''' ==
 
1)源码目录<br>
 
1)源码目录<br>
<span style="background:#CCCCCC">source code directory</span><br>
 
 
$ mkdir -p ~/my-imx28/02_source<br>
 
$ mkdir -p ~/my-imx28/02_source<br>
 
[[文件:IMX28_2635_build_2.3.0.1.png]]<br>
 
[[文件:IMX28_2635_build_2.3.0.1.png]]<br>
  
 
2)工具目录<br>
 
2)工具目录<br>
<span style="background:#CCCCCC">tool directory</span><br>
 
 
$ mkdir -p ~/my-imx28/03_tools<br>
 
$ mkdir -p ~/my-imx28/03_tools<br>
 
[[文件:IMX28_2635_build_2.3.0.2.png]]<br>
 
[[文件:IMX28_2635_build_2.3.0.2.png]]<br>
  
 
3)镜像目录<br>
 
3)镜像目录<br>
<span style="background:#CCCCCC">image directory</span><br>
 
 
$ mkdir -p ~/my-imx28/04_image<br>
 
$ mkdir -p ~/my-imx28/04_image<br>
 
[[文件:IMX28_2635_build_2.3.0.3.png]]<br>
 
[[文件:IMX28_2635_build_2.3.0.3.png]]<br>
  
 
4)应用程序目录<br>
 
4)应用程序目录<br>
<span style="background:#CCCCCC">application directory</span><br>
 
 
$ mkdir -p ~/my-imx28/01_application<br>
 
$ mkdir -p ~/my-imx28/01_application<br>
 
[[文件:IMX28_2635_build_2.3.0.4.png]]<br>
 
[[文件:IMX28_2635_build_2.3.0.4.png]]<br>
  
= '''准备开发环境(prepare development environment)''' =
+
= '''准备开发环境''' =
 
----
 
----
== '''更新主机的源列表(update source list of host)''' ==
+
== '''更新主机的源列表''' ==
 
$ sudo apt-get update <br>
 
$ sudo apt-get update <br>
 
[[文件:IMX28_2635_build_3.1.0.1.png]]<br>
 
[[文件:IMX28_2635_build_3.1.0.1.png]]<br>
 
更新完成后如下图所示:<br>
 
更新完成后如下图所示:<br>
<span style="background:#CCCCCC">it looks like below after the update</span><br>
 
 
[[文件:IMX28_2635_build_3.1.0.2.png]]<br>
 
[[文件:IMX28_2635_build_3.1.0.2.png]]<br>
  
== '''安装aptitude包管理工具和ia32-libs(install management tool of aptitude package and ia32-libs)''' ==
+
== '''安装aptitude包管理工具和ia32-libs''' ==
 
提示:如果编译主机的Linux是32位的,可以跳过此步骤。<br>
 
提示:如果编译主机的Linux是32位的,可以跳过此步骤。<br>
<span style="background:#CCCCCC">tips: if Linux of compilation host is 32bit,then you can skip this step</span><br>
 
  
=== 安装aptitude包管理工具(install management tool of aptitude package)===
+
=== 安装aptitude包管理工具===
 
$ sudo apt-get -y install aptitude <br>
 
$ sudo apt-get -y install aptitude <br>
 
[[文件:IMX28_2635_build_3.2.1.1.png]]<br>
 
[[文件:IMX28_2635_build_3.2.1.1.png]]<br>
 
提示:上图为安装过aptitude后,再次执行安装命令的截图。<br>
 
提示:上图为安装过aptitude后,再次执行安装命令的截图。<br>
<span style="background:#CCCCCC">tips: the above image is the screenshots after re-execution of installation command when intallation of aptitude was completed</span><br>
 
  
=== 使用aptitude安装ia32-libs(install ia32-libs with aptitude)===
+
=== 使用aptitude安装ia32-libs===
 
$ sudo aptitude -y install ia32-libs <br>
 
$ sudo aptitude -y install ia32-libs <br>
 
[[文件:IMX28_2635_build_3.2.2.1.png]]<br>
 
[[文件:IMX28_2635_build_3.2.2.1.png]]<br>
 
提示:上图为安装过aptitude和ia32-libs后,再次执行安装命令的截图。<br>
 
提示:上图为安装过aptitude和ia32-libs后,再次执行安装命令的截图。<br>
<span style="background:#CCCCCC">tips: the above image is the screenshots after re-execution of installation command when intallation of aptitude and ia32-libs was completed</span><br>
 
  
== '''安装mkimage工具(install mkimage tool)''' ==
+
== '''安装mkimage工具''' ==
 
$ sudo apt-get -y install uboot-mkimage <br>
 
$ sudo apt-get -y install uboot-mkimage <br>
 
提示:下图为安装过mkimage工具后,再次执行安装命令的截图。<br>
 
提示:下图为安装过mkimage工具后,再次执行安装命令的截图。<br>
<span style="background:#CCCCCC">tips: the following image is the screenshots after re-execution of installation command when intallation of mkimage was completed</span><br>
 
 
[[文件:IMX28_2635_build_3.3.0.1.png]]<br>
 
[[文件:IMX28_2635_build_3.3.0.1.png]]<br>
  
== '''安装ncurses-dev(install ncurses-dev)''' ==
+
== '''安装ncurses-dev''' ==
 
make menuconfig对其具有依赖性质<br>
 
make menuconfig对其具有依赖性质<br>
<span style="background:#CCCCCC">make menuconfig is dependant to it</span><br>
 
 
$ sudo aptitude -y install ncurses-dev <br>
 
$ sudo aptitude -y install ncurses-dev <br>
 
[[文件:IMX28_2635_build_3.4.0.1.png]]<br>
 
[[文件:IMX28_2635_build_3.4.0.1.png]]<br>
 
提示:上图为安装过ncurses-dev工具后,再次执行安装命令的截图。<br>
 
提示:上图为安装过ncurses-dev工具后,再次执行安装命令的截图。<br>
<span style="background:#CCCCCC">tips: the above image is the screenshots after re-execution of installation command when intallation of ncurses-dev was completed</span><br>
 
  
= '''安装配置交叉编译工具链(install and configure cross compiler tool chain)''' =
+
= '''安装配置交叉编译工具链''' =
 
----
 
----
== '''安装Linux交叉编译工具链(install cross compilation tool chain)''' ==
+
== '''安装Linux交叉编译工具链''' ==
 
1)进入交叉编译工具链目录<br>
 
1)进入交叉编译工具链目录<br>
<span style="background:#CCCCCC">enter cross compilation tool chain diretory</span><br>
 
 
$ cd ~/my-imx28/03_tools/<br>
 
$ cd ~/my-imx28/03_tools/<br>
 
2)复制Linux交叉编译工具到目录<br>
 
2)复制Linux交叉编译工具到目录<br>
<span style="background:#CCCCCC">copy Linux cross compilation tool to directory</span><br>
 
 
将gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2复制到“~/my-imx28/03_tools”,这一步自己采取相应的方式完成。<br>
 
将gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2复制到“~/my-imx28/03_tools”,这一步自己采取相应的方式完成。<br>
<span style="background:#CCCCCC">copy gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2 to“~/my-imx28/03_tools”,this step should be done in your own way</span><br>
 
 
3)解压Linux交叉编译工具<br>
 
3)解压Linux交叉编译工具<br>
<span style="background:#CCCCCC">decompress Linux cross compilation tool</span><br>
 
 
$ tar jxf gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2<br>
 
$ tar jxf gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2<br>
 
[[文件:IMX28_2635_build_4.1.0.1.png]]<br>
 
[[文件:IMX28_2635_build_4.1.0.1.png]]<br>
 
4)复制交叉编译工具配置文件<br>
 
4)复制交叉编译工具配置文件<br>
<span style="background:#CCCCCC">copy congigured file of cross compilation tool</span><br>
 
 
将gcc-4.4.4-glibc-2.11.1-multilib-env复制到“~/my-imx28/03_tools”,这一步自己采取相应的方式完成。<br>
 
将gcc-4.4.4-glibc-2.11.1-multilib-env复制到“~/my-imx28/03_tools”,这一步自己采取相应的方式完成。<br>
<span style="background:#CCCCCC">copy gcc-4.4.4-glibc-2.11.1-multilib-env to“~/my-imx28/03_tools”,this step should be done in your own way</span><br>
 
 
5)检查安装<br>
 
5)检查安装<br>
<span style="background:#CCCCCC">check installation</span><br>
 
 
$ source gcc-4.4.4-glibc-2.11.1-multilib-env<br>
 
$ source gcc-4.4.4-glibc-2.11.1-multilib-env<br>
 
$ ${CROSS_COMPILE}gcc –v<br>
 
$ ${CROSS_COMPILE}gcc –v<br>
 
[[文件:IMX28_2635_build_4.1.0.2.png]]<br>
 
[[文件:IMX28_2635_build_4.1.0.2.png]]<br>
  
= '''U-Boot编译(U-Boot compilation)''' =
+
= '''U-Boot编译''' =
 
----
 
----
== '''准备编译(prepare compilation)''' ==
+
== '''准备编译''' ==
=== 复制源码包到开发主机中(copy source code package to development host)===
+
=== 复制源码包到开发主机中===
 
将下载的“u-boot源码”复制到Linux开发主机的“~/my-imx28/02_source”。<br>
 
将下载的“u-boot源码”复制到Linux开发主机的“~/my-imx28/02_source”。<br>
<span style="background:#CCCCCC">copy“u-boot source code”downloaded to “~/my-imx28/02_source”of Linux development host</span><br>
 
 
这一步自己采取相应的方式完成。<br>
 
这一步自己采取相应的方式完成。<br>
<span style="background:#CCCCCC">this step should be done in your own way</span><br>
 
  
=== 解压u-boot源码包(decompress u-boot source code)===
+
=== 解压u-boot源码包===
 
$ cd ~/my-imx28/02_source/<br>
 
$ cd ~/my-imx28/02_source/<br>
 
$ tar jxf u-boot-2009.08.tar.bz2<br>
 
$ tar jxf u-boot-2009.08.tar.bz2<br>
第162行: 第125行:
 
[[文件:IMX28_2635_build_5.1.2.1.png]]<br>
 
[[文件:IMX28_2635_build_5.1.2.1.png]]<br>
  
== '''编译(compile)''' ==
+
== '''编译''' ==
=== 使编译配置文件生效(validate configured file of compilation)===
+
=== 使编译配置文件生效===
 
$ source ~/my-imx28/03_tools/gcc-4.4.4-glibc-2.11.1-multilib-env<br>
 
$ source ~/my-imx28/03_tools/gcc-4.4.4-glibc-2.11.1-multilib-env<br>
 
[[文件:IMX28_2635_build_5.2.1.1.png]]<br>
 
[[文件:IMX28_2635_build_5.2.1.1.png]]<br>
  
=== 进入u-boot源码目录(enter u-boot source code directory)===
+
=== 进入u-boot源码目录===
 
$ cd ~/my-imx28/02_source/u-boot-2009.08<br>
 
$ cd ~/my-imx28/02_source/u-boot-2009.08<br>
 
[[文件:IMX28_2635_build_5.2.2.1.png]]<br>
 
[[文件:IMX28_2635_build_5.2.2.1.png]]<br>
  
=== 清除u-boot临时文件(remove u-boot temporary file)===
+
=== 清除u-boot临时文件===
 
$ make distclean <br>
 
$ make distclean <br>
 
[[文件:IMX28_2635_build_5.2.3.1.png]]<br>
 
[[文件:IMX28_2635_build_5.2.3.1.png]]<br>
  
=== 配置u-boot(configure)===
+
=== 配置u-boot===
 
{| class="wikitable"
 
{| class="wikitable"
!评估板主型号<br>(evaluation board main model)
+
!评估板主型号
!CPU类型-内存容量<br>(CPU type--momery capacity) 
+
!CPU类型-内存容量
!对应的u-boot配置<br>(corresponding configuration of u-boot)
+
!对应的u-boot配置
 
|-
 
|-
|MY-IMX28-EVK ||MX283/7, 128M ||mx28_evk_config
+
|MYZR-IMX28-EVK ||MX283/7, 128M ||mx28_evk_config
 
|}
 
|}
  
*MY-IMX28-EVK配置示例:<br>
+
*MYZR-IMX28-EVK配置示例:<br>
<span style="background:#CCCCCC">example for configuration of MY-IMX28-EVK</span><br>
 
 
$ make mx28_evk_config <br>
 
$ make mx28_evk_config <br>
 
[[文件:IMX28_2635_build_5.2.4.1.png]]<br>
 
[[文件:IMX28_2635_build_5.2.4.1.png]]<br>
  
=== 执行编译(execute compilation)===
+
=== 执行编译===
 
$ make <br>
 
$ make <br>
 
提示:这里为了提高编译速度,在make后面加了“-j4”。这里编译的Linux主机是双核4线程的,所以“-j”后面用了4,也就是采用4线程编译。“-j”后面的数字可以根据系统资源分配,但是不应该超过编译主机最大支持的线程数。<br>
 
提示:这里为了提高编译速度,在make后面加了“-j4”。这里编译的Linux主机是双核4线程的,所以“-j”后面用了4,也就是采用4线程编译。“-j”后面的数字可以根据系统资源分配,但是不应该超过编译主机最大支持的线程数。<br>
<span style="background:#CCCCCC">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.</span><br>
 
 
[[文件:IMX28_2635_build_5.2.5.1.png]]<br>
 
[[文件:IMX28_2635_build_5.2.5.1.png]]<br>
 
*编译imx28_ivt_uboot.sb<br>
 
*编译imx28_ivt_uboot.sb<br>
<span style="background:#CCCCCC">compile imx28_ivt_uboot.sb</span><br>
 
 
提示:imx28_ivt_uboot.sb是烧写的镜像。<br>
 
提示:imx28_ivt_uboot.sb是烧写的镜像。<br>
<span style="background:#CCCCCC">tips:  imx28_ivt_uboot.sb is the image programmed</span><br>
 
 
$ cp u-boot ../imx-bootlets-src-10.12.01<br>
 
$ cp u-boot ../imx-bootlets-src-10.12.01<br>
 
$ cd ../imx-bootlets-src-10.12.01/<br>
 
$ cd ../imx-bootlets-src-10.12.01/<br>
第204行: 第163行:
 
[[文件:IMX28_2635_build_5.2.5.2.png]]<br>
 
[[文件:IMX28_2635_build_5.2.5.2.png]]<br>
  
== '''目标文件(target file)''' ==
+
== '''目标文件''' ==
 
*编译文件<br>
 
*编译文件<br>
<span style="background:#CCCCCC">compile file</span><br>
 
 
编译完成后通过ls命令即可看到编译得到的文件imx28_ivt_uboot.sb<br>
 
编译完成后通过ls命令即可看到编译得到的文件imx28_ivt_uboot.sb<br>
<span style="background:#CCCCCC">you can get the compiled file imx28_ivt_uboot.sb with ls command after compilation.</span><br>
 
 
$ ls <br>
 
$ ls <br>
 
[[文件:IMX28_2635_build_5.3.0.1.png]]<br>
 
[[文件:IMX28_2635_build_5.3.0.1.png]]<br>
 
*目标文件<br>
 
*目标文件<br>
<span style="background:#CCCCCC">target file</span><br>
+
MYZR-IMX28系列评估板的u-boot配置对应的目标文件名见下表:<br>
MY-IMX28系列评估板的u-boot配置对应的目标文件名见下表:<br>
 
<span style="background:#CCCCCC">The corresponding name of target file for u-boot configuration of MY-IMX28 series evaluation board is shown in the table below:</span><br>
 
 
{| class="wikitable"
 
{| class="wikitable"
!u-boot配置<br>(u-boot configuration)
+
!u-boot配置  
!目标文件<br>(target file)
+
!目标文件
 
|-
 
|-
 
|mx28_evk_config ||imx28_ivt_uboot.sb
 
|mx28_evk_config ||imx28_ivt_uboot.sb
 
|}
 
|}
  
= '''编译内核(compile kernel)''' =
+
= '''编译内核''' =
 
----
 
----
== '''准备编译(prepare compilation)''' ==
+
== '''准备编译''' ==
=== 复制源码包到开发主机中(copy source code package to the development host)===
+
=== 复制源码包到开发主机中===
 
将下载的“linux源码”复制到Linux开发主机的“~/my-imx28/02_source”。<br>
 
将下载的“linux源码”复制到Linux开发主机的“~/my-imx28/02_source”。<br>
<span style="background:#CCCCCC">copy“linux source code” to “~/my-imx28/02_source”of Linux development host</span><br>
 
 
这一步自己采取相应的方式完成。<br>
 
这一步自己采取相应的方式完成。<br>
<span style="background:#CCCCCC">this step should be done in your own way</span><br>
 
  
=== 解压linux源码包(decompress Linux source code package)===
+
=== 解压linux源码包===
 
$ cd ~/my-imx28/02_source/<br>
 
$ cd ~/my-imx28/02_source/<br>
 
$ tar jxf linux-2.6.35.3.tar.bz2<br>
 
$ tar jxf linux-2.6.35.3.tar.bz2<br>
 
[[文件:IMX28_2635_build_6.1.2.1.png]]<br>
 
[[文件:IMX28_2635_build_6.1.2.1.png]]<br>
  
== '''内核编译配置(configuration of kernel compilation)''' ==
+
== '''内核编译配置''' ==
=== 使编译配置文件生效(validate configured file of compilation)===
+
=== 使编译配置文件生效===
 
$ source ~/my-imx28/03_tools/gcc-4.4.4-glibc-2.11.1-multilib-env<br>
 
$ source ~/my-imx28/03_tools/gcc-4.4.4-glibc-2.11.1-multilib-env<br>
 
[[文件:IMX28_2635_build_6.2.1.1.png]]<br>
 
[[文件:IMX28_2635_build_6.2.1.1.png]]<br>
  
=== 清除内核临时文件(remove kernel temporary file)===
+
=== 清除内核临时文件===
 
*进入linux源码目录<br>
 
*进入linux源码目录<br>
<span style="background:#CCCCCC">enter Linux source code directory</span><br>
 
 
$ cd ~/my-imx28/02_source/linux-2.6.35.3<br>
 
$ cd ~/my-imx28/02_source/linux-2.6.35.3<br>
 
[[文件:IMX28_2635_build_6.2.2.1.png]]<br>
 
[[文件:IMX28_2635_build_6.2.2.1.png]]<br>
 
*清除临时文件<br>
 
*清除临时文件<br>
<span style="background:#CCCCCC">remove temporary file</span><br>
 
 
$ make distclean <br>
 
$ make distclean <br>
 
[[文件:IMX28_2635_build_6.2.2.2.png]]<br>
 
[[文件:IMX28_2635_build_6.2.2.2.png]]<br>
  
=== 内核配置(kernel configuration)===
+
=== 内核配置===
 
$ cp .mx28_config .config <br>
 
$ cp .mx28_config .config <br>
 
[[文件:IMX28_2635_build_6.2.3.1.png]]<br>
 
[[文件:IMX28_2635_build_6.2.3.1.png]]<br>
  
== '''编译内核(compile kernel)''' ==
+
== '''编译内核''' ==
 
*执行编译 <br>
 
*执行编译 <br>
<span style="background:#CCCCCC">execute compilation</span><br>
 
 
$ make zImage -j4 <br>
 
$ make zImage -j4 <br>
 
[[文件:IMX28_2635_build_6.3.0.1.png]]<br>
 
[[文件:IMX28_2635_build_6.3.0.1.png]]<br>
 
*编译完成<br>
 
*编译完成<br>
<span style="background:#CCCCCC">complete compilation</span><br>
 
 
[[文件:IMX28_2635_build_6.3.0.2.png]]<br>
 
[[文件:IMX28_2635_build_6.3.0.2.png]]<br>
 
*目标文件 <br>
 
*目标文件 <br>
<span style="background:#CCCCCC">target file</span><br>
 
 
arch/arm/boot/uImage即为编译得到的内核文件,使用ls命令可查看文件信息。<br>
 
arch/arm/boot/uImage即为编译得到的内核文件,使用ls命令可查看文件信息。<br>
<span style="background:#CCCCCC">arch/arm/boot/uImage is the kernel file compiled,you can check the file information with ls command</span><br>
 
 
$ ls arch/arm/boot/uImage -la <br>
 
$ ls arch/arm/boot/uImage -la <br>
 
[[文件:IMX28_2635_build_6.3.0.3.png]]<br>
 
[[文件:IMX28_2635_build_6.3.0.3.png]]<br>
  
== '''编译模块 (compile module)''' ==
+
== '''编译模块 ''' ==
 
*编译模块命令 <br>
 
*编译模块命令 <br>
<span style="background:#CCCCCC">command of module compilation</span><br>
 
 
$ make modules<br>
 
$ make modules<br>
 
[[文件:IMX28_2635_build_6.4.0.1.png]]<br>
 
[[文件:IMX28_2635_build_6.4.0.1.png]]<br>
 
*安装模块到指定目录<br>
 
*安装模块到指定目录<br>
<span style="background:#CCCCCC">install module to specified directory</span><br>
 
 
$ make modules_install INSTALL_MOD_PATH=./modules<br>
 
$ make modules_install INSTALL_MOD_PATH=./modules<br>
 
[[文件:IMX28_2635_build_6.4.0.2.png]]<br>
 
[[文件:IMX28_2635_build_6.4.0.2.png]]<br>
 
*打包模块文件<br>
 
*打包模块文件<br>
<span style="background:#CCCCCC">package module file</span><br>
 
 
$ cd modules<br>
 
$ cd modules<br>
 
$ tar cjf ../modules.tar.bz2 *<br>
 
$ tar cjf ../modules.tar.bz2 *<br>
 
[[文件:IMX28_2635_build_6.4.0.3.png]]<br>
 
[[文件:IMX28_2635_build_6.4.0.3.png]]<br>
  
= '''应用程序编译(compile application)''' =
+
= '''应用程序编译''' =
 
----
 
----
== '''Linux应用程序编译(compilation of Linux application)''' ==
+
== '''Linux应用程序编译''' ==
=== 编写应用程序 (write application)===
+
=== 编写应用程序 ===
 
*进入工作目录<br>
 
*进入工作目录<br>
<span style="background:#CCCCCC">enter working directory</span><br>
 
 
$ cd ~/my-imx28/01_application/<br>
 
$ cd ~/my-imx28/01_application/<br>
 
[[文件:IMX28_2635_build_7.1.1.1.png]]<br>
 
[[文件:IMX28_2635_build_7.1.1.1.png]]<br>
 
*编写源代码<br>
 
*编写源代码<br>
<span style="background:#CCCCCC">write source code</span><br>
 
 
$ vim hello.c <br>
 
$ vim hello.c <br>
 
写入以下代码并保存 <br>
 
写入以下代码并保存 <br>
<span style="background:#CCCCCC">write and save the following code</span><br>
 
 
#include <stdio.h> <br>
 
#include <stdio.h> <br>
 
int main(int argc, char **argv) <br>
 
int main(int argc, char **argv) <br>
第305行: 第246行:
 
} <br>
 
} <br>
 
*查看代码 <br>
 
*查看代码 <br>
<span style="background:#CCCCCC">view code</span><br>
 
 
$ cat hello.c <br>
 
$ cat hello.c <br>
 
[[文件:IMX28_2635_build_7.1.1.2.png]]<br>
 
[[文件:IMX28_2635_build_7.1.1.2.png]]<br>
  
=== 编译应用程序 (compile application)===
+
=== 编译应用程序 ===
 
*配置环境变量<br>
 
*配置环境变量<br>
<span style="background:#CCCCCC">configure environment variables</span><br>
 
 
$ source ~/my-imx28/03_tools/gcc-4.4.4-glibc-2.11.1-multilib-env<br>
 
$ source ~/my-imx28/03_tools/gcc-4.4.4-glibc-2.11.1-multilib-env<br>
 
[[文件:IMX28_2635_build_7.1.2.1.png]]<br>
 
[[文件:IMX28_2635_build_7.1.2.1.png]]<br>
 
*编译 <br>
 
*编译 <br>
<span style="background:#CCCCCC">compile</span><br>
 
 
$ ${CROSS_COMPILE}gcc hello.c -o hello.out <br>
 
$ ${CROSS_COMPILE}gcc hello.c -o hello.out <br>
 
[[文件:IMX28_2635_build_7.1.2.2.png]]<br>
 
[[文件:IMX28_2635_build_7.1.2.2.png]]<br>
 
注意:上面的命令有包含“$”号,即“${CROSS_COMPILE}gcc”,是引用我们source时产生的环境变量。 <br>
 
注意:上面的命令有包含“$”号,即“${CROSS_COMPILE}gcc”,是引用我们source时产生的环境变量。 <br>
<span style="background:#CCCCCC">Note:The above command contains “$”,which is “${CROSS_COMPILE}gcc”. It is the environment variable generated when referring to our source.</span><br>
 
 
*目标文件 <br>
 
*目标文件 <br>
<span style="background:#CCCCCC">target file</span><br>
 
 
$ file hello.out <br>
 
$ file hello.out <br>
 
[[文件:IMX28_2635_build_7.1.2.3.png]]<br>
 
[[文件:IMX28_2635_build_7.1.2.3.png]]<br>
 
可以看到目标文件 hello.out 的属性。<br>
 
可以看到目标文件 hello.out 的属性。<br>
<span style="background:#CCCCCC">you can see the property of target file hello.out</span><br>
 
  
= '''文件系统(file system)''' =
+
= '''文件系统''' =
 
----
 
----
== '''文件系统rootfs.tar.bz2(file system rootfs.tar.bz2)''' ==
+
== '''文件系统rootfs.tar.bz2''' ==
 
用以下的方式增加自己的应用:(把MY-IMX28_Born_Tool\Profiles\MX28 Linux Update\OS Firmware\files\image-linux-2635/rootfs.tar.bz2复制到“~/my-imx28/04_image/”目录下)。<br>
 
用以下的方式增加自己的应用:(把MY-IMX28_Born_Tool\Profiles\MX28 Linux Update\OS Firmware\files\image-linux-2635/rootfs.tar.bz2复制到“~/my-imx28/04_image/”目录下)。<br>
<span style="background:#CCCCCC">add your own application in following ways:( copy MY-IMX28_Born_Tool\Profiles\MX28 Linux Update\OS Firmware\files\image-linux-2635/rootfs.tar.bz2 to the directory of “~/my-imx28/04_image/”)</span><br>
 
 
[[文件:IMX28_2635_build_8.1.0.1.png]]<br>
 
[[文件:IMX28_2635_build_8.1.0.1.png]]<br>
  
== '''文件系统rootfs.ubifs(file system rootfs.ubifs)''' ==
+
== '''文件系统rootfs.ubifs''' ==
 
复制mkfs.ubifs,ubinize到电脑的“/usr/bin”目录下(如果电脑有这两个应用就不需要复制了);复制build_rootfs和ubinize.cfg到“~/my-imx28/04_image/”目录。<br>
 
复制mkfs.ubifs,ubinize到电脑的“/usr/bin”目录下(如果电脑有这两个应用就不需要复制了);复制build_rootfs和ubinize.cfg到“~/my-imx28/04_image/”目录。<br>
<span style="background:#CCCCCC">copy mkfs.ubifs,ubinize to“/usr/bin”directory of computer(copy is not needed if the computer has these two applications);copy build_rootfs和ubinize.cfg to“~/my-imx28/04_image/”directory</span><br>
 
 
[[文件:IMX28_2635_build_8.2.0.1.png]]<br>
 
[[文件:IMX28_2635_build_8.2.0.1.png]]<br>
  
= '''烧写方式(way of programming)''' =
+
= '''烧写方式''' =
 
----
 
----
 
至此,我们在“~/my-imx28/02_source/”得到了除文件系统以外的一套烧录文件。包括“imx28_ivt_uboot.sb”、“uImage”、“rootfs.tar.bz2”。<br>
 
至此,我们在“~/my-imx28/02_source/”得到了除文件系统以外的一套烧录文件。包括“imx28_ivt_uboot.sb”、“uImage”、“rootfs.tar.bz2”。<br>
<span style="background:#CCCCCC">so far,we get a set of programming files except file system from“~/my-imx28/02_source/”,including“imx28_ivt_uboot.sb”、“uImage”、“rootfs.tar.bz2”</span><br>
 
  
== '''使用MFGTOOL烧写(program with MFGTOOL)''' ==
+
== '''使用MFGTOOL烧写''' ==
 
把文件“imx28_ivt_uboot.sb”、“uImage”、“rootfs.tar.bz2复制到“MY-IMX28_Born_Tool\Profiles\MX28 Linux Update\OS Firmware\files\image-linux-2635”目录下。按住REC按键,插上MINI USB线和电源线,接着打开MfgTool.exe,点击“扫描设备”,检测到HID设备时,松开REC按键,如下所示:<br>
 
把文件“imx28_ivt_uboot.sb”、“uImage”、“rootfs.tar.bz2复制到“MY-IMX28_Born_Tool\Profiles\MX28 Linux Update\OS Firmware\files\image-linux-2635”目录下。按住REC按键,插上MINI USB线和电源线,接着打开MfgTool.exe,点击“扫描设备”,检测到HID设备时,松开REC按键,如下所示:<br>
<span style="background:#CCCCCC">copy “imx28_ivt_uboot.sb”、“uImage”、“rootfs.tar.bz2 to the directory of “MY-IMX28_Born_Tool\Profiles\MX28 Linux Update\OS Firmware\files\image-linux-2635”。hold REC key,plug in MINI USB line and power line,then open MfgTool.exe,click"scan device",release REC key when HID device is detected,as below:</span><br>
 
 
[[文件:IMX28_2635_build_9.1.0.1.png]]<br>
 
[[文件:IMX28_2635_build_9.1.0.1.png]]<br>
 
<br>
 
<br>
 
点击菜单的“Options”,然后在选项“Profiles”选择“MY-IMX28-2.6.35 NAND with uboot”,接着点击“确定”,最后点击“开始”。<br>
 
点击菜单的“Options”,然后在选项“Profiles”选择“MY-IMX28-2.6.35 NAND with uboot”,接着点击“确定”,最后点击“开始”。<br>
<span style="background:#CCCCCC">click"Options" in the menu,select “MY-IMX28-2.6.35 NAND with uboot”in the option “Profiles”,then click"Enter",finally click"start"</span><br>
 
 
[[文件:IMX28_2635_build_9.1.0.2.png]]<br>
 
[[文件:IMX28_2635_build_9.1.0.2.png]]<br>
 
烧写成功后,点击“停止”就OK了。<br>
 
烧写成功后,点击“停止”就OK了。<br>
第357行: 第287行:
 
<span style="background:#CCCCCC">note: if the file system you are using is rootfs-qt.tar.bz2,please choose “QT-MY-IMX28-2.6.35 NAND with uboot”as programming image</span><br>
 
<span style="background:#CCCCCC">note: if the file system you are using is rootfs-qt.tar.bz2,please choose “QT-MY-IMX28-2.6.35 NAND with uboot”as programming image</span><br>
  
== ''' 使用网络烧写(program via network)''' ==
+
== ''' 使用网络烧写''' ==
=== 搭建TFTP (ubuntu系统)(establish TFTP (ubuntu system))===
+
=== 搭建TFTP (ubuntu系统)===
 
(1) Setup tftp server files (下载并安装tftp)<br>
 
(1) Setup tftp server files (下载并安装tftp)<br>
<span style="background:#CCCCCC">Setup tftp server files (download and isntall tftp)</span><br>
 
 
  $ sudo apt-get install tftpd tftp openbsd-inetd<br>
 
  $ sudo apt-get install tftpd tftp openbsd-inetd<br>
 
(2) make a tftp directory (新建tftp目录和改变其属性)<br>
 
(2) make a tftp directory (新建tftp目录和改变其属性)<br>
<span style="background:#CCCCCC">make a tftp directory (establish tftp diretory and change its property</span><br>
 
 
Here we make /home/myzr/tftpt be a tftp directory.<br>
 
Here we make /home/myzr/tftpt be a tftp directory.<br>
 
  $ mkdir /home/myzr/tftp<br>
 
  $ mkdir /home/myzr/tftp<br>
 
  $ chmod 777 /home/myzr/tftp<br>
 
  $ chmod 777 /home/myzr/tftp<br>
 
(3) Open /etc/inetd.conf and edit it (修改配置文件的tftp目录)<br>
 
(3) Open /etc/inetd.conf and edit it (修改配置文件的tftp目录)<br>
<span style="background:#CCCCCC">Open /etc/inetd.conf and edit it (modify tftp directory of congigured file)</span><br>
 
 
  $ sudo gedit /etc/inetd.conf<br>
 
  $ sudo gedit /etc/inetd.conf<br>
 
Coment this line :<br>
 
Coment this line :<br>
第375行: 第302行:
 
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /home/myzr/tftp<br>
 
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /home/myzr/tftp<br>
 
(4)Restarting tftp service (重启tftp)<br>
 
(4)Restarting tftp service (重启tftp)<br>
<span style="background:#CCCCCC">Restarting tftp service (reboot tftp)</span><br>
 
 
  $ sudo /etc/init.d/openbsd-inetd restart<br>
 
  $ sudo /etc/init.d/openbsd-inetd restart<br>
  
=== 搭建NFS (网络烧写不需要用到nfs)( establish NFS (nfs is not needed for network programming))===
+
=== 搭建NFS (网络烧写不需要用到nfs)===
 
(1) Install NFS server package (下载并安装nfs)<br>
 
(1) Install NFS server package (下载并安装nfs)<br>
<span style="background:#CCCCCC">Install NFS server package (download and isntall nfs)</span><br>
 
 
  $ sudo apt-get install nfs-kernel-server<br>
 
  $ sudo apt-get install nfs-kernel-server<br>
 
(2) Create NFS directory:/home/myzr/nfsroot (新建nfs目录)<br>
 
(2) Create NFS directory:/home/myzr/nfsroot (新建nfs目录)<br>
<span style="background:#CCCCCC">Create NFS directory:/home/myzr/nfsroot (establish nfs directory)</span><br>
 
 
  $ mkdir /home/myzr/nfsroot<br>
 
  $ mkdir /home/myzr/nfsroot<br>
 
(3) Configure mounted directory and authority (修改配置文件的nfs目录)<br>
 
(3) Configure mounted directory and authority (修改配置文件的nfs目录)<br>
<span style="background:#CCCCCC">Configure mounted directory and authority (modify nfs directory of configured file)</span><br>
 
 
  $ sudo gedit /etc/exports<br>
 
  $ sudo gedit /etc/exports<br>
 
Add the following line at the end of the file:<br>
 
Add the following line at the end of the file:<br>
 
/home/myzr/nfsroot *(rw,sync,no_root_squash)<br>
 
/home/myzr/nfsroot *(rw,sync,no_root_squash)<br>
 
(4) Restart the NFS service (重启nfs)<br>
 
(4) Restart the NFS service (重启nfs)<br>
<span style="background:#CCCCCC">Restart the NFS service (reboot nfs)</span><br>
 
 
  $ sudo /etc/init.d/portmap restart<br>
 
  $ sudo /etc/init.d/portmap restart<br>
 
  $ sudo /etc/init.d/nfs-kernel-server restart<br>
 
  $ sudo /etc/init.d/nfs-kernel-server restart<br>
  
=== tftp下载(download of tftp)===
+
=== tftp下载===
 
(1) 把“uImage”和“rootfs.ubifs”复制到“/home/myzr/tftp”目录下。<br>
 
(1) 把“uImage”和“rootfs.ubifs”复制到“/home/myzr/tftp”目录下。<br>
<span style="background:#CCCCCC">copy“uImage” and “rootfs.ubifs”to“/home/myzr/tftp”directory</span><br>
 
 
(2) 设置环境变量(板子和电脑网线直连)<br>
 
(2) 设置环境变量(板子和电脑网线直连)<br>
<span style="background:#CCCCCC">set environment variables(directly connect the board and computer)</span><br>
 
 
  $ setenv ipaddr 192.168.3.104    (板子IP)<br>
 
  $ setenv ipaddr 192.168.3.104    (板子IP)<br>
<span style="background:#CCCCCC"></span><br>
 
 
  $ setenv serverip 192.168.3.110    (电脑IP)<br>
 
  $ setenv serverip 192.168.3.110    (电脑IP)<br>
<span style="background:#CCCCCC"></span><br>
 
 
(3) 烧写<br>
 
(3) 烧写<br>
<span style="background:#CCCCCC">programme</span><br>
 
 
  $ run upkernel (烧写uImage)<br>
 
  $ run upkernel (烧写uImage)<br>
<span style="background:#CCCCCC">$ run upkernel (programme uImage)</span><br>
 
 
<br>
 
<br>
 
  [[文件:IMX28_2635_build_9.2.3.1.png]]<br>
 
  [[文件:IMX28_2635_build_9.2.3.1.png]]<br>
 
<br>
 
<br>
 
  $ run upsystem (烧写文件系统)<br>
 
  $ run upsystem (烧写文件系统)<br>
<span style="background:#CCCCCC">$ run upsystem (programme file system)</span><br>
 
 
<br>
 
<br>
 
  [[文件:IMX28_2635_build_9.2.3.2.png]]<br>
 
  [[文件:IMX28_2635_build_9.2.3.2.png]]<br>
 
<br>
 
<br>
  
= '''登录方式(login way)''' =
+
= '''登录方式''' =
 
----
 
----
== '''串口登录(login via serial port)''' ==
+
== '''串口登录''' ==
 
插上USB转串口线和电源,开机后,差不多12秒后,在终端上敲回车键可以进入系统。<br>
 
插上USB转串口线和电源,开机后,差不多12秒后,在终端上敲回车键可以进入系统。<br>
<span style="background:#CCCCCC">plug in USB to serial port line and power supply,in about 12 seconds after machine starting,click Enter key to enter system</span><br>
 
 
<br>
 
<br>
 
  [[文件:IMX28_2635_build_10.1.0.1.png]]<br>
 
  [[文件:IMX28_2635_build_10.1.0.1.png]]<br>
 
<br>
 
<br>
  
== '''ssh登录(login via ssh)''' ==
+
== '''ssh登录''' ==
=== '''以太网登录(login via ethernet)''' ===
+
=== '''以太网登录''' ===
 
插上网线和电源,开机后,差不多10秒后,可以软件SecureCRT登录,板子默认以太网的IP为192.168.3.104,你可以设置电脑的IP为192.168.3.110,然后配置SecureCRT,输入用户名是root,密码myzr。如下图:<br>
 
插上网线和电源,开机后,差不多10秒后,可以软件SecureCRT登录,板子默认以太网的IP为192.168.3.104,你可以设置电脑的IP为192.168.3.110,然后配置SecureCRT,输入用户名是root,密码myzr。如下图:<br>
<span style="background:#CCCCCC">plug in lan line and power supply, in about 10 seconds after machine starting,login via software SecureCRT,defaulted IP of ethernet by board is 192.168.3.104,you can set IP of computer as 192.168.3.110,then configure SecureCRT,enter root as user name and myzr as password, as blow:</span><br>
 
 
[[文件:IMX28_2635_build_10.2.1.1.png]]<br>
 
[[文件:IMX28_2635_build_10.2.1.1.png]]<br>
 
输入完后,点击”OK“就登录完成。<br>
 
输入完后,点击”OK“就登录完成。<br>
<span style="background:#CCCCCC">after entering, click"OK" to complete login</span><br>
 
  
=== '''USB登录(USB可识别成网口)(login via USB(USB can be identified as network port))''' ===
+
=== '''USB登录(USB可识别成网口)''' ===
 
插上MINI USB线,开机后,差不多10秒后,可以软件SecureCRT登录。<br>
 
插上MINI USB线,开机后,差不多10秒后,可以软件SecureCRT登录。<br>
<span style="background:#CCCCCC">plug in MINI USB line,in about 10 seconds after machine starting,login through software SecureCRT</span><br>
 
 
加载驱动和设置IP,如下:<br>
 
加载驱动和设置IP,如下:<br>
<span style="background:#CCCCCC">add driving and set IP, as below:</span><br>
 
 
<br>
 
<br>
 
  [[文件:IMX28_2635_build_10.2.2.1.png]]<br>
 
  [[文件:IMX28_2635_build_10.2.2.1.png]]<br>
 
<br>
 
<br>
 
板子USB的IP为192.168.4.104,你可以设置电脑的IP为192.168.4.110,然后配置SecureCRT,输入用户名是root,密码myzr。如下图:<br>
 
板子USB的IP为192.168.4.104,你可以设置电脑的IP为192.168.4.110,然后配置SecureCRT,输入用户名是root,密码myzr。如下图:<br>
<span style="background:#CCCCCC">IP of USB of the board is 192.168.4.104,you can set IP of computer as 192.168.4.110,then configure SecureCRT,enter root as user name and myzr as password。as below:</span><br>
 
 
输入完后,点击”OK“就登录完成。<br>
 
输入完后,点击”OK“就登录完成。<br>
<span style="background:#CCCCCC">after entering, click"OK" to complete login</span><br>
 
  
= '''测试(test)''' =
+
= '''测试''' =
 
----
 
----
== '''USB测试(USB test)''' ==
+
== '''USB测试''' ==
 
直接插上U盘,挂载后可看到U盘的内容。(不是QT系统,会自动挂载)<br>
 
直接插上U盘,挂载后可看到U盘的内容。(不是QT系统,会自动挂载)<br>
<span style="background:#CCCCCC">directly insert U disk,you can see the content of U disk after mounting,(if it is not QT system,mounting will be automatic)</span><br>
 
 
<br>
 
<br>
 
  [[文件:IMX28_2635_build_11.1.0.1.png]]<br>
 
  [[文件:IMX28_2635_build_11.1.0.1.png]]<br>
 
<br>
 
<br>
  
== '''SD卡测试(SD card test)''' ==
+
== '''SD卡测试''' ==
 
直接插上SD卡,挂载后可看到SD卡的内容。(不是QT系统,会自动挂载)<br>
 
直接插上SD卡,挂载后可看到SD卡的内容。(不是QT系统,会自动挂载)<br>
<span style="background:#CCCCCC">directly insert SD card,you can see the content of U SD card after mounting,(if it is not QT system,mounting will be automatic)</span><br>
 
 
<br>
 
<br>
 
  [[文件:IMX28_2635_build_11.2.0.1.png]]<br>
 
  [[文件:IMX28_2635_build_11.2.0.1.png]]<br>
 
<br>
 
<br>
  
== '''以太网测试(ethernet test)''' ==
+
== '''以太网测试''' ==
 
插上网线,直接用ping命令测试eth0和eth1网口。默认eth0的IP为192.168.3.104,我设置eth1为192.168.3.105。如下:<br>
 
插上网线,直接用ping命令测试eth0和eth1网口。默认eth0的IP为192.168.3.104,我设置eth1为192.168.3.105。如下:<br>
<span style="background:#CCCCCC">insert lan line, test eth0 and eth1 with ping command directory,defaulted IP of eth0 is 192.168.3.104,let's set IP of eth1 as 192.168.3.105,as below:</span><br>
 
 
<br>
 
<br>
 
  [[文件:IMX28_2635_build_11.3.0.1.png]]<br>
 
  [[文件:IMX28_2635_build_11.3.0.1.png]]<br>
 
<br>
 
<br>
  
== '''uart串口测试( test of uart serial port)''' ==
+
== '''uart串口测试''' ==
串口uat0的设备ttySP0,串口uat3的设备ttySP3。测试时,请短接发管脚。<br>
+
串口uat0的设备ttySP0,串口uat3的设备ttySP3。测试时,请短接发管脚(J10的5和7号管脚)。<br>
<span style="background:#CCCCCC">device of serial port uat0 is ttySP0, device of serial port uat3 is ttySP3,please short connect pins in the test</span><br>
 
 
<br>
 
<br>
 
  [[文件:IMX28_2635_build_11.4.0.1.png]]<br>
 
  [[文件:IMX28_2635_build_11.4.0.1.png]]<br>
第480行: 第384行:
 
<br>
 
<br>
  
== '''gpio测试(gpio test)''' ==
+
== '''gpio测试''' ==
GPIO_2_26已经在驱动配置为GPIO功能了,下面以管脚GPIO_2_26为例,计算GPIO_2_26的管脚号为2*32+26=90,测试如下:<br>
+
GPIO_2_26已经在驱动配置为GPIO功能了,下面以管脚GPIO_2_26为例,计算GPIO_2_26的管脚号为2*32+26=90,测试如下:(GPIO_2_26对应管脚J16的3脚)<br>
<span style="background:#CCCCCC">GPIO_2_26 is already configured as GPIO function in driving,below is taking GPIO_2_26 as an example to figure out the pin no. of GPIO_2_26 is 2*32+26=90,test as below:</span><br>
 
 
<br>
 
<br>
 
  [[文件:IMX28_2635_build_11.5.0.1.png]]<br>
 
  [[文件:IMX28_2635_build_11.5.0.1.png]]<br>
 
<br>
 
<br>
  
== '''spi测试(spi test)''' ==
+
== '''spi测试''' ==
SPI接口为半双工模式,这里你只测发,通过示波器可观察到波形。方法一只发送0x55和0x75;方法二是发送字符串”myzr“。<br>
+
SPI接口为半双工模式,这里你只测发,通过示波器可观察到波形。方法一只发送0x55和0x75;方法二是发送字符串”myzr“(J14的6和8号管脚)。<br>
<span style="background:#CCCCCC">SPI interface is half duplex mode,here you only test sending,you can view the wave shape through oscilloscope,one way is to send 0x55 and 0x75,another way is to send charater string ”myzr“</span><br>
 
 
<br>
 
<br>
 
  [[文件:IMX28_2635_build_11.6.0.1.png]]<br>
 
  [[文件:IMX28_2635_build_11.6.0.1.png]]<br>
 
<br>
 
<br>
  
== '''watdog测试(watdog test)''' ==
+
== '''watdog测试''' ==
 
“看门狗”,全称Watchdog timer,是一个在软件出错的时候可以复位计算机系统的硬件定时器。通常一个用户空间守护进程会在正常的时间间隔内通过/dev/watchdog 特殊设备文件来通知内核的Watchdog驱动,用户空间一切正常。如果用户空间出现问题(如RAM 错误,内核BUG 等),则通知将会停止,然后硬件Watchdog 将在超时后复位系统。<br>
 
“看门狗”,全称Watchdog timer,是一个在软件出错的时候可以复位计算机系统的硬件定时器。通常一个用户空间守护进程会在正常的时间间隔内通过/dev/watchdog 特殊设备文件来通知内核的Watchdog驱动,用户空间一切正常。如果用户空间出现问题(如RAM 错误,内核BUG 等),则通知将会停止,然后硬件Watchdog 将在超时后复位系统。<br>
<span style="background:#CCCCCC">"watchdog",the full name is Watchdog timer,is a hardware timer which can reset system of computer when there is an error in software.ususally in a normal time interval during a guading process of a user space,booting of Watchdog will be noticed to kernel through sepcial device file of /dev/watchdog,then everything in the user space is normal.</span><br>
 
  
 
测试程序中打开/dev/watchdog 设备文件,启动了Watchdog,每过一秒钟喂狗一次,系统不会重启。<br>
 
测试程序中打开/dev/watchdog 设备文件,启动了Watchdog,每过一秒钟喂狗一次,系统不会重启。<br>
<span style="background:#CCCCCC">open device file of /dev/watchdog in the test programme,start Watchdog,feed dog once a second,system won't reboot</span><br>
 
 
<br>
 
<br>
 
  [[文件:IMX28_2635_build_11.7.0.1.png]]<br>
 
  [[文件:IMX28_2635_build_11.7.0.1.png]]<br>
 
<br>
 
<br>
 
测试程序中打开了/dev/watchdog 设备文件,启动Watchdog,程序进入循环状态,由于没有喂狗,30 秒后系统复位。<br>
 
测试程序中打开了/dev/watchdog 设备文件,启动Watchdog,程序进入循环状态,由于没有喂狗,30 秒后系统复位。<br>
<span style="background:#CCCCCC">open device file of /dev/watchdog in the test programme,programme come into the cyccling condition,since there is not dog feeding,system will be resetted after 30 seconds</span><br>
 
 
<br>
 
<br>
 
  [[文件:IMX28_2635_build_11.7.0.2.png]]<br>
 
  [[文件:IMX28_2635_build_11.7.0.2.png]]<br>
 
<br>
 
<br>
 +
</div>

2020年10月22日 (四) 16:18的最新版本

目录

文档说明


系统环境说明

  • 编译主机CPU架构:64位
  • 编译主机系统:Linux
  • Linux发行版:Ubuntu
  • Ubuntu版本类型:服务器版
  • Ubuntu版本号:12.04.5
  • Ubuntu系统类型:x86-64

  注意:开发主机请使用ubuntu 12.04.5 x86-64(桌面版或服务器版均可),使用其他发行版的Linux或Ubuntu的其它版本可能会遇到的不必要的问题。

操作说明

1)文档中以“$”开头的行,其后是Linux命令。
2)文档中所有的Linux命令建议手动输入到Linux主机执行(直接复制、粘贴到Linux主机上执行,可能会执行失败)。
3)文档中的Linux执行命令,如果空格后的下一个字符是“-”的(如:sudo apt-get –y install之类的),请手动输入到Linux主机执行(直接复制、粘贴到Linux主机上执行,通常会执行失败)。
4)文档中所有一行没写完的Linux命令请手动输入到Linux主机执行,(因为复制、粘贴命令不能包含类似“换行符”之类的特殊字符)。
5)按文档输入并执行Linux命令时注意观察命令的执行结果与文档图片中的是否一致,以确认命令是否输入有误及是否执行失败。
6)第一遍编译请严格按照文档进行,否则可能出现莫名其妙的错误。


截图说明

为使视图看起来简洁整齐,截图中的命令提示符统一使用myzr$。

图片中的Linux命令

在文档的图片中观察“linyn@u12045-serv:~$”开头的行可以直观的看到输入的linux命令。

准备源码及相关文件


源码文件

评估板对应的Linux版本及对应的源码文件见下表:

评估板型号 支持的系统版本 u-boot源码文件 linux源码文件
MYZR-IMX28-EVK Linux-2.6.35 u-boot-2009.08.tar.bz2
imx-bootlets-src-10.12.01.tar.bz2
linux-2.6.35.3.tar.bz2

交叉编译工具文件

Linux程序交叉编译工具:gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2
Linux交叉编译工具配置文件:gcc-4.4.4-glibc-2.11.1-multilib-env

创建工作目录

1)源码目录
$ mkdir -p ~/my-imx28/02_source
IMX28 2635 build 2.3.0.1.png

2)工具目录
$ mkdir -p ~/my-imx28/03_tools
IMX28 2635 build 2.3.0.2.png

3)镜像目录
$ mkdir -p ~/my-imx28/04_image
IMX28 2635 build 2.3.0.3.png

4)应用程序目录
$ mkdir -p ~/my-imx28/01_application
IMX28 2635 build 2.3.0.4.png

准备开发环境


更新主机的源列表

$ sudo apt-get update
IMX28 2635 build 3.1.0.1.png
更新完成后如下图所示:
IMX28 2635 build 3.1.0.2.png

安装aptitude包管理工具和ia32-libs

提示:如果编译主机的Linux是32位的,可以跳过此步骤。

安装aptitude包管理工具

$ sudo apt-get -y install aptitude
IMX28 2635 build 3.2.1.1.png
提示:上图为安装过aptitude后,再次执行安装命令的截图。

使用aptitude安装ia32-libs

$ sudo aptitude -y install ia32-libs
IMX28 2635 build 3.2.2.1.png
提示:上图为安装过aptitude和ia32-libs后,再次执行安装命令的截图。

安装mkimage工具

$ sudo apt-get -y install uboot-mkimage
提示:下图为安装过mkimage工具后,再次执行安装命令的截图。
IMX28 2635 build 3.3.0.1.png

安装ncurses-dev

make menuconfig对其具有依赖性质
$ sudo aptitude -y install ncurses-dev
IMX28 2635 build 3.4.0.1.png
提示:上图为安装过ncurses-dev工具后,再次执行安装命令的截图。

安装配置交叉编译工具链


安装Linux交叉编译工具链

1)进入交叉编译工具链目录
$ cd ~/my-imx28/03_tools/
2)复制Linux交叉编译工具到目录
将gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2复制到“~/my-imx28/03_tools”,这一步自己采取相应的方式完成。
3)解压Linux交叉编译工具
$ tar jxf gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2
IMX28 2635 build 4.1.0.1.png
4)复制交叉编译工具配置文件
将gcc-4.4.4-glibc-2.11.1-multilib-env复制到“~/my-imx28/03_tools”,这一步自己采取相应的方式完成。
5)检查安装
$ source gcc-4.4.4-glibc-2.11.1-multilib-env
$ ${CROSS_COMPILE}gcc –v
IMX28 2635 build 4.1.0.2.png

U-Boot编译


准备编译

复制源码包到开发主机中

将下载的“u-boot源码”复制到Linux开发主机的“~/my-imx28/02_source”。
这一步自己采取相应的方式完成。

解压u-boot源码包

$ cd ~/my-imx28/02_source/
$ tar jxf u-boot-2009.08.tar.bz2
$ tar jxf imx-bootlets-src-10.12.01.tar.bz2
IMX28 2635 build 5.1.2.1.png

编译

使编译配置文件生效

$ source ~/my-imx28/03_tools/gcc-4.4.4-glibc-2.11.1-multilib-env
IMX28 2635 build 5.2.1.1.png

进入u-boot源码目录

$ cd ~/my-imx28/02_source/u-boot-2009.08
IMX28 2635 build 5.2.2.1.png

清除u-boot临时文件

$ make distclean
IMX28 2635 build 5.2.3.1.png

配置u-boot

评估板主型号 CPU类型-内存容量 对应的u-boot配置
MYZR-IMX28-EVK MX283/7, 128M mx28_evk_config
  • MYZR-IMX28-EVK配置示例:

$ make mx28_evk_config
IMX28 2635 build 5.2.4.1.png

执行编译

$ make
提示:这里为了提高编译速度,在make后面加了“-j4”。这里编译的Linux主机是双核4线程的,所以“-j”后面用了4,也就是采用4线程编译。“-j”后面的数字可以根据系统资源分配,但是不应该超过编译主机最大支持的线程数。
IMX28 2635 build 5.2.5.1.png

  • 编译imx28_ivt_uboot.sb

提示:imx28_ivt_uboot.sb是烧写的镜像。
$ cp u-boot ../imx-bootlets-src-10.12.01
$ cd ../imx-bootlets-src-10.12.01/
$ sudo cp elftosb /usr/bin/
$ ./build
IMX28 2635 build 5.2.5.2.png

目标文件

  • 编译文件

编译完成后通过ls命令即可看到编译得到的文件imx28_ivt_uboot.sb
$ ls
IMX28 2635 build 5.3.0.1.png

  • 目标文件

MYZR-IMX28系列评估板的u-boot配置对应的目标文件名见下表:

u-boot配置 目标文件
mx28_evk_config imx28_ivt_uboot.sb

编译内核


准备编译

复制源码包到开发主机中

将下载的“linux源码”复制到Linux开发主机的“~/my-imx28/02_source”。
这一步自己采取相应的方式完成。

解压linux源码包

$ cd ~/my-imx28/02_source/
$ tar jxf linux-2.6.35.3.tar.bz2
IMX28 2635 build 6.1.2.1.png

内核编译配置

使编译配置文件生效

$ source ~/my-imx28/03_tools/gcc-4.4.4-glibc-2.11.1-multilib-env
IMX28 2635 build 6.2.1.1.png

清除内核临时文件

  • 进入linux源码目录

$ cd ~/my-imx28/02_source/linux-2.6.35.3
IMX28 2635 build 6.2.2.1.png

  • 清除临时文件

$ make distclean
IMX28 2635 build 6.2.2.2.png

内核配置

$ cp .mx28_config .config
IMX28 2635 build 6.2.3.1.png

编译内核

  • 执行编译

$ make zImage -j4
IMX28 2635 build 6.3.0.1.png

  • 编译完成

IMX28 2635 build 6.3.0.2.png

  • 目标文件

arch/arm/boot/uImage即为编译得到的内核文件,使用ls命令可查看文件信息。
$ ls arch/arm/boot/uImage -la
IMX28 2635 build 6.3.0.3.png

编译模块

  • 编译模块命令

$ make modules
IMX28 2635 build 6.4.0.1.png

  • 安装模块到指定目录

$ make modules_install INSTALL_MOD_PATH=./modules
IMX28 2635 build 6.4.0.2.png

  • 打包模块文件

$ cd modules
$ tar cjf ../modules.tar.bz2 *
IMX28 2635 build 6.4.0.3.png

应用程序编译


Linux应用程序编译

编写应用程序

  • 进入工作目录

$ cd ~/my-imx28/01_application/
IMX28 2635 build 7.1.1.1.png

  • 编写源代码

$ vim hello.c
写入以下代码并保存

  1. include <stdio.h>

int main(int argc, char **argv)
{
  printf("Hello, MYZR!\n");
  return;
}

  • 查看代码

$ cat hello.c
IMX28 2635 build 7.1.1.2.png

编译应用程序

  • 配置环境变量

$ source ~/my-imx28/03_tools/gcc-4.4.4-glibc-2.11.1-multilib-env
IMX28 2635 build 7.1.2.1.png

  • 编译

$ ${CROSS_COMPILE}gcc hello.c -o hello.out
IMX28 2635 build 7.1.2.2.png
注意:上面的命令有包含“$”号,即“${CROSS_COMPILE}gcc”,是引用我们source时产生的环境变量。

  • 目标文件

$ file hello.out
IMX28 2635 build 7.1.2.3.png
可以看到目标文件 hello.out 的属性。

文件系统


文件系统rootfs.tar.bz2

用以下的方式增加自己的应用:(把MY-IMX28_Born_Tool\Profiles\MX28 Linux Update\OS Firmware\files\image-linux-2635/rootfs.tar.bz2复制到“~/my-imx28/04_image/”目录下)。
IMX28 2635 build 8.1.0.1.png

文件系统rootfs.ubifs

复制mkfs.ubifs,ubinize到电脑的“/usr/bin”目录下(如果电脑有这两个应用就不需要复制了);复制build_rootfs和ubinize.cfg到“~/my-imx28/04_image/”目录。
IMX28 2635 build 8.2.0.1.png

烧写方式


至此,我们在“~/my-imx28/02_source/”得到了除文件系统以外的一套烧录文件。包括“imx28_ivt_uboot.sb”、“uImage”、“rootfs.tar.bz2”。

使用MFGTOOL烧写

把文件“imx28_ivt_uboot.sb”、“uImage”、“rootfs.tar.bz2复制到“MY-IMX28_Born_Tool\Profiles\MX28 Linux Update\OS Firmware\files\image-linux-2635”目录下。按住REC按键,插上MINI USB线和电源线,接着打开MfgTool.exe,点击“扫描设备”,检测到HID设备时,松开REC按键,如下所示:
IMX28 2635 build 9.1.0.1.png

点击菜单的“Options”,然后在选项“Profiles”选择“MY-IMX28-2.6.35 NAND with uboot”,接着点击“确定”,最后点击“开始”。
IMX28 2635 build 9.1.0.2.png
烧写成功后,点击“停止”就OK了。
when programming is succeeded,click"stop",to finish
注意:如果你用的文件系统是rootfs-qt.tar.bz2,请选择“QT-MY-IMX28-2.6.35 NAND with uboot”烧写镜像。
note: if the file system you are using is rootfs-qt.tar.bz2,please choose “QT-MY-IMX28-2.6.35 NAND with uboot”as programming image

使用网络烧写

搭建TFTP (ubuntu系统)

(1) Setup tftp server files (下载并安装tftp)
  $ sudo apt-get install tftpd tftp openbsd-inetd
(2) make a tftp directory (新建tftp目录和改变其属性)
Here we make /home/myzr/tftpt be a tftp directory.
  $ mkdir /home/myzr/tftp
  $ chmod 777 /home/myzr/tftp
(3) Open /etc/inetd.conf and edit it (修改配置文件的tftp目录)
  $ sudo gedit /etc/inetd.conf
Coment this line :

  1. tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp

Add new line:
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /home/myzr/tftp
(4)Restarting tftp service (重启tftp)
  $ sudo /etc/init.d/openbsd-inetd restart

搭建NFS (网络烧写不需要用到nfs)

(1) Install NFS server package (下载并安装nfs)
  $ sudo apt-get install nfs-kernel-server
(2) Create NFS directory:/home/myzr/nfsroot (新建nfs目录)
  $ mkdir /home/myzr/nfsroot
(3) Configure mounted directory and authority (修改配置文件的nfs目录)
  $ sudo gedit /etc/exports
Add the following line at the end of the file:
/home/myzr/nfsroot *(rw,sync,no_root_squash)
(4) Restart the NFS service (重启nfs)
  $ sudo /etc/init.d/portmap restart
  $ sudo /etc/init.d/nfs-kernel-server restart

tftp下载

(1) 把“uImage”和“rootfs.ubifs”复制到“/home/myzr/tftp”目录下。
(2) 设置环境变量(板子和电脑网线直连)
  $ setenv ipaddr 192.168.3.104 (板子IP)
  $ setenv serverip 192.168.3.110 (电脑IP)
(3) 烧写
  $ run upkernel (烧写uImage)

  IMX28 2635 build 9.2.3.1.png

  $ run upsystem (烧写文件系统)

  IMX28 2635 build 9.2.3.2.png

登录方式


串口登录

插上USB转串口线和电源,开机后,差不多12秒后,在终端上敲回车键可以进入系统。

  IMX28 2635 build 10.1.0.1.png

ssh登录

以太网登录

插上网线和电源,开机后,差不多10秒后,可以软件SecureCRT登录,板子默认以太网的IP为192.168.3.104,你可以设置电脑的IP为192.168.3.110,然后配置SecureCRT,输入用户名是root,密码myzr。如下图:
IMX28 2635 build 10.2.1.1.png
输入完后,点击”OK“就登录完成。

USB登录(USB可识别成网口)

插上MINI USB线,开机后,差不多10秒后,可以软件SecureCRT登录。
加载驱动和设置IP,如下:

  IMX28 2635 build 10.2.2.1.png

板子USB的IP为192.168.4.104,你可以设置电脑的IP为192.168.4.110,然后配置SecureCRT,输入用户名是root,密码myzr。如下图:
输入完后,点击”OK“就登录完成。

测试


USB测试

直接插上U盘,挂载后可看到U盘的内容。(不是QT系统,会自动挂载)

  IMX28 2635 build 11.1.0.1.png

SD卡测试

直接插上SD卡,挂载后可看到SD卡的内容。(不是QT系统,会自动挂载)

  IMX28 2635 build 11.2.0.1.png

以太网测试

插上网线,直接用ping命令测试eth0和eth1网口。默认eth0的IP为192.168.3.104,我设置eth1为192.168.3.105。如下:

  IMX28 2635 build 11.3.0.1.png

uart串口测试

串口uat0的设备ttySP0,串口uat3的设备ttySP3。测试时,请短接发管脚(J10的5和7号管脚)。

  IMX28 2635 build 11.4.0.1.png


  IMX28 2635 build 11.4.0.2.png

gpio测试

GPIO_2_26已经在驱动配置为GPIO功能了,下面以管脚GPIO_2_26为例,计算GPIO_2_26的管脚号为2*32+26=90,测试如下:(GPIO_2_26对应管脚J16的3脚)

  IMX28 2635 build 11.5.0.1.png

spi测试

SPI接口为半双工模式,这里你只测发,通过示波器可观察到波形。方法一只发送0x55和0x75;方法二是发送字符串”myzr“(J14的6和8号管脚)。

  IMX28 2635 build 11.6.0.1.png

watdog测试

“看门狗”,全称Watchdog timer,是一个在软件出错的时候可以复位计算机系统的硬件定时器。通常一个用户空间守护进程会在正常的时间间隔内通过/dev/watchdog 特殊设备文件来通知内核的Watchdog驱动,用户空间一切正常。如果用户空间出现问题(如RAM 错误,内核BUG 等),则通知将会停止,然后硬件Watchdog 将在超时后复位系统。

测试程序中打开/dev/watchdog 设备文件,启动了Watchdog,每过一秒钟喂狗一次,系统不会重启。

  IMX28 2635 build 11.7.0.1.png

测试程序中打开了/dev/watchdog 设备文件,启动Watchdog,程序进入循环状态,由于没有喂狗,30 秒后系统复位。

  IMX28 2635 build 11.7.0.2.png

</div>