MYZR-IMX28 Linux-3.14.54 编译手册

来自明远智睿的wiki
Admin讨论 | 贡献2017年6月26日 (一) 10:32的版本

跳转至: 导航搜索

目录

= 文档说明(document instruction) =

系统环境说明(system environment instruction)

  • 编译主机CPU架构:64位

CUP architeture of host used for compilation:64bit

  • 编译主机系统:Linux

system of compiler host:Linux

  • Linux发行版:Ubuntu

Linux release version:

  • Ubuntu版本类型:服务器版

Ubuntu version type:saver version

  • Ubuntu版本号:12.04.5

Ubuntu version no.:12.04.5

  • Ubuntu系统类型:x86-64

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

操作说明 (operation instruction)

1)文档中以“$”开头的行,其后是Linux命令。
The line in the document which begins with “$”,which is followed by the Linux command
2)文档中所有的Linux命令建议手动输入到Linux主机执行(直接复制、粘贴到Linux主机上执行,可能会执行失败)。
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
3)文档中的Linux执行命令,如果空格后的下一个字符是“-”的(如:sudo apt-get –y install之类的),请手动输入到Linux主机执行(直接复制、粘贴到Linux主机上执行,通常会执行失败)。
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 )
4)文档中所有一行没写完的Linux命令请手动输入到Linux主机执行,(因为复制、粘贴命令不能包含类似“换行符”之类的特殊字符)。
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")
5)按文档输入并执行Linux命令时注意观察命令的执行结果与文档图片中的是否一致,以确认命令是否输入有误及是否执行失败。
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
6)第一遍编译请严格按照文档进行,否则可能出现莫名其妙的错误。
Please follow the document strictly to compile for the first time.Otherwise ,there may be unexpected error

截图说明(screenshots instruction)

为使视图看起来简洁整齐,截图中的命令提示符统一使用myzr$。
To make the view look neat and tidy , the command prompt in the screenshot should use myzr$ uniformly

图片中的Linux命令(Linux command in the image)

在文档的图片中观察“linyn@u12045-serv:~$”开头的行可以直观的看到输入的
linux命令。
In the image of the document, you can see the input Linux command visually from the lines that start with “myzr$” linux command

= 准备源码及相关文件(prepare source code and relevant files) =

源码文件(source code)

评估板对应的Linux版本及对应的源码文件见下表:
The corresponding Linux version of the evaluation board and the corresponding source code files are shown in the table below:

评估板型号
(evaluation board model)
支持的系统版本
(system version supported)
u-boot源码文件
(u-boot source code)
linux源码文件
(linux source code)
<thead> </thead> <tbody> </tbody>
MY-IMX28-EVK Linux-3.14.54 u-boot-2015.04.tar.bz2 linux-3.14.54.tar.bz2

交叉编译工具文件(cross compiler tool file)

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

创建工作目录(creat working directory)

1)源码目录
source code directory
$ mkdir -p ~/my-imx28/02_source
IMX28 2635 build 2.3.0.1.png
2)工具目录
tool directory
$ mkdir -p ~/my-imx28/03_tools
IMX28 2635 build 2.3.0.2.png
3)镜像目录
image dirrectory
$ mkdir -p ~/my-imx28/04_image
IMX28 2635 build 2.3.0.3.png
4)应用程序目录
application directory
$ mkdir -p ~/my-imx28/01_application
IMX28 2635 build 2.3.0.4.png

= 准备开发环境(prepare development environment) =

更新主机的源列表(update source list of host)

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

安装aptitude包管理工具和ia32-libs(install management tool of aptitude package and ia32-libs)

提示:如果编译主机的Linux是32位的,可以跳过此步骤。
tips: if Linux of compilation host is 32bit,then you can skip this step

安装aptitude包管理工具(install management tool of aptitude package)

$ sudo apt-get -y install aptitude
IMX28 2635 build 3.2.1.1.png
提示:上图为安装过aptitude后,再次执行安装命令的截图。
tips: the above image is the screenshots after re-execution of installation command when intallation of aptitude was completed.

使用aptitude安装ia32-libs( install ia32-libs with aptitude)

$ sudo aptitude -y install ia32-libs
IMX28 2635 build 3.2.2.1.png
提示:上图为安装过aptitude和ia32-libs后,再次执行安装命令的截图。
tips: the above image is the screenshots after re-execution of installation command when intallation of aptitude and ia32-libs was completed

安装mkimage工具(install mkimage tool)

$ sudo apt-get -y install uboot-mkimage
提示:下图为安装过mkimage工具后,再次执行安装命令的截图。
tips: the following image is the screenshots after re-execution of installation command when intallation of mkimage was completed
IMX28 2635 build 3.3.0.1.png

安装ncurses-dev(install ncurses-dev)

make menuconfig对其具有依赖性质
make menuconfig is dependant to it
$ sudo aptitude -y install ncurses-dev
IMX28 2635 build 3.4.0.1.png
提示:上图为安装过ncurses-dev工具后,再次执行安装命令的截图。
tips: the above image is the screenshots after re-execution of installation command when intallation of aptitude and ia32-libs was completed

= 安装配置交叉编译工具链(install and configure cross compiler tool chain) =

安装Linux交叉编译工具链(install Linux cross compilation tool chain)

1)进入交叉编译工具链目录
enter cross compilation tool chain diretory
$ cd ~/my-imx28/03_tools/
2)复制Linux交叉编译工具到目录
copy Linux cross compilation tool to directory
将gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2复制到“~/my-imx28/03_tools”,这一步自己采取相应的方式完成。
copy gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2 to “~/my-imx28/03_tools”,this step need to be done in your own way。
3)解压Linux交叉编译工具
decompress Linux cross compilation tool
$ tar jxf gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2
IMX28 2635 build 4.1.0.1.png
4)复制交叉编译工具配置文件
copy cross compilation tool configuration file
将gcc-4.4.4-glibc-2.11.1-multilib-env复制到“~/my-imx28/03_tools”,这一步自己采取相应的方式完成。
copy gcc-4.4.4-glibc-2.11.1-multilib-env to“~/my-imx28/03_tools”,this step need to be done in your own way
5)检查安装
check installation
$ 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 compilation) =

准备编译(prepare compilation)

复制源码包到开发主机中(copy source code package to development host)

将下载的“u-boot源码”复制到Linux开发主机的“~/my-imx28/02_source”。
copy“u-boot source code”downloaded to “~/my-imx6/02_source”of Linux development host
这一步自己采取相应的方式完成。
this step need to be done in your own way

解压u-boot源码包(decompress u-boot source code package)

$ cd ~/my-imx28/02_source/
$ tar jxf u-boot-2015.04.tar.bz2
IMX28 31454 build 5.1.2.1.png

更新库libssl-dev(update library libssl-dev)

$ sudo apt-get install libssl-dev
IMX28 31454 build 5.1.3.1.png

编译(compile)

使编译配置文件生效(validate compilation configuration file)

$ 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源码目录(validate compiler configuration file)

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

清除u-boot临时文件(remove u-boot temporary files)

$ make distclean
IMX28 31454 build 5.2.3.1.png

配置u-boot(configure u-boot)

评估板主型号
(evaluation board main model)
CPU类型-内存容量
(CPU type-memory capacity)
对应的u-boot配置
(corresponaind configuration of u-boot)
MY-IMX28-EVK MX283/7, 128M mx28_evk_config
  • MY-IMX28-EVK配置示例:

example for MY-IMX28-EVK configuration
$ make mx28_evk_config
IMX28 31454 build 5.2.4.1.png

执行编译(execute compilation)

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

  • 编译完成

complete compilation
提示:u-boot编译过程大概需要一、两分钟时间。
Tips: u-boot compiling process may take one or two minutes
IMX28 31454 build 5.2.5.2.png

目标文件(target file)

  • 编译文件

compile file
编译完成后通过ls命令即可看到编译得到的文件 u-boot.sb
you can get the compiled file u-boot .sb with ls command after compilation
$ ls
IMX28 31454 build 5.3.0.1.png

  • 目标文件

target file
MY-IMX28系列评估板的u-boot配置对应的目标文件名见下表:
The corresponding target file name for u-boot configuration of MY-IMX28 series evaluation board is shown in the table below

u-boot配置
(u-boot configuration)
目标文件
(target file)
mx28_evk_config imx28_ivt_uboot.sb

= 编译内核(compile kernel) =

准备编译(prepare compilation)

复制源码包到开发主机中(copy source code package to development host)

将下载的“linux源码”复制到Linux开发主机的“~/my-imx28/02_source”。
copy“linux source code”downloaded to “~/my-imx28/02_source”of Linux development host
这一步自己采取相应的方式完成。
this step should be done in your own way

解压linux源码包(decompress linux source code package)

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

内核编译配置(configuration of kernel compilation)

使编译配置文件生效(validate configuration file of compilation)

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

清除内核临时文件(remove kernel temporary file)

  • 进入linux源码目录

enter linux source code directory
$ cd ~/my-imx28/02_source/linux-3.14.54
IMX28 31454 build 6.2.2.1.png

  • 清除临时文件

remove temporary file
$ make distclean
IMX28 31454 build 6.2.2.2.png

内核配置(kernel configuration)

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

编译内核(compile kernel)

  • 执行编译

execute compilation
$ make zImage -j4
IMX28 31454 build 6.3.0.1.png

  • 编译完成

complete compilation
IMX28 31454 build 6.3.0.2.png

  • 目标文件

target file
arch/arm/boot/uImage即为编译得到的内核文件,使用ls命令可查看文件信息。
arch/arm/boot/uImage is the kernel file compiled,you can check file information with ls command
$ ls arch/arm/boot/uImage -la
IMX28 2635 build 6.3.0.3.png

编译设备树 (compife device tree)

评估板型号规格与设备树文件对应关系见下表:
The correspondence between the type of evaluation board and device tree is shown below:

功能
(function)
源码位置
(source code position)
Linux 设备和文件夹
(Linux device and folder)
<thead> </thead> <tbody> </tbody>
评估板主型号
(development main model)
CPU类型-内存容量
(CPU type-memory capacity)
对应的设备树文件
(corresponding device tree file)
MY-IMX28-EVK MX283/7, 128M imx28-evk.dtb
-

以MY-IMX28-EVK为例
take MY-IMX28-EVK as an example
$ make imx28-evk.dtb
IMX28 31454 build 6.4.0.1.png

  • 目标文件

target file
使用ls命令可查看编译得到的目标设备树文件信息:
You can browse the target device tree file information from compilation with ls command:
$ ls arch/arm/boot/dts/
.dtb
IMX28 31454 build 6.4.0.2.png

编译模块 (compile module)

  • 编译模块命令

command for compiling module
$ make modules
IMX28 31454 build 6.5.0.1.png

  • 安装模块到指定目录

Install module to the specified directory
$ make modules_install INSTALL_MOD_PATH=./modules
IMX28 31454 build 6.5.0.2.png

  • 打包模块文件

package the module file
$ cd modules
$ tar cjf ../modules.tar.bz2 *
IMX28 31454 build 6.5.0.3.png

= 应用程序编译(application compilation) =

Linux应用程序编译(Linux application compilation)

编写应用程序(write an application)

  • 进入工作目录

enter working directory
$ cd ~/my-imx28/01_application/
IMX28 31454 build 7.1.1.1.png

  • 编写源代码

write souce code
$ vim hello.c
写入以下代码并保存
write following code and save

include <stdio.h>

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

  • 查看代码

view code
$ cat hello.c
IMX28 2635 build 7.1.1.2.png

编译应用程序(compife application)

  • 配置环境变量

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

  • 编译

compile
$ ${CROSS_COMPILE}gcc hello.c -o hello.out
IMX28 2635 build 7.1.2.2.png
注意:上面的命令有包含“$”号,即“${CROSS_COMPILE}gcc”,是引用我们source时产生的环境变量。
Note:The above command contains “$”,which is “${CROSS_COMPILE}gcc”. It is the environment variable generated when referring to our source.

  • 目标文件

target file
$ file hello.out
IMX28 2635 build 7.1.2.3.png
可以看到目标文件 hello.out 的属性。
you can see the property of target file hello.out

= 文件系统(file system) =

文件系统rootfs.tar.bz2(file system rootfs.tar.bz2)

  用以下的方式增加自己的应用:(把MY-IMX28_Born_Tool\Profiles\MX28 Linux Update\OS Firmware\files\image-linux-31454/rootfs.tar.bz2复制到“~/my-imx28/04_image/”目录下)。
add your own application by the following means: (copy MY-IMX28_Born_Tool\Profiles\MX28 Linux Update\OS Firmware\files\image-linux-31454/rootfs.tar.bz2 to directory of“~/my-imx28/04_image/”)
IMX28 2635 build 8.1.0.1.png

文件系统filesystem.ubifs(file system filesystem.ubifs)

  复制mkfs.ubifs,ubinize到电脑的“/usr/bin”目录下(如果电脑有这两个应用就不需要复制了);复制build_rootfs和ubinize.cfg到“~/my-imx28/04_image/”目录。
copy mkfs.ubifs,ubinize to directory of“/usr/bin”of computer(if computer has both these two applications,the copy is not needed);copy build_rootfs和ubinize.cfg to directory of “~/my-imx28/04_image/”
IMX28 31454 build 8.2.0.1.png

= 烧写方式(programing mode) =

  至此,我们在“~/my-imx28/02_source/”得到了除文件系统以外的一套烧录文件。包括“u-boot.sb”、“imx28-evk.dtb”、“zImage”、“rootfs.tar.bz2”。
so far,we get a set of programing file under directory of “~/my-imx28/02_source besides file system ,including “u-boot.sb”、“imx28-evk.dtb”、“zImage”、“rootfs.tar.bz2”

使用MFGTOOL烧写(program with MFGTOOL)

  把文件“u-boot.sb”、“imx28-evk.dtb”、“zImage”、“rootfs.tar.bz2复制到“MY-IMX28_Born_Tool\Profiles\MX28 Linux Update\OS Firmware\files\image-linux-31454”目录下。按住REC按键,插上MINI USB线和电源线,接着打开MfgTool.exe,点击“扫描设备”,检测到HID设备时,松开REC按键,如下所示:
copy “u-boot.sb”、“imx28-evk.dtb”、“zImage”、“rootfs.tar.bz2 to the directory of “MY-IMX28_Born_Tool\Profiles\MX28 Linux Update\OS Firmware\files\image-linux-31454”.hold REC key,plug in MINI USB line and power cable,then open MfgTool.exe,click"scan device",detect HID device,release REC key,like below:
IMX28 2635 build 9.1.0.1.png

  点击菜单的“Options”,然后在选项“Profiles”选择“MY-IMX28-3.14.54 NAND with uboot”,接着点击“确定”,最后点击“开始”。
click“Options”on menu,then select“MY-IMX28-3.14.54 NAND with uboot”on option of “Profiles”,then click“Enter”,finally click“start”
IMX28 31454 build 9.1.0.2.png
  烧写成功后,点击“停止”就OK了。
when programing is successful,click"stop",to be completed
注意:如果你用的文件系统是rootfs-qt.tar.bz2,请选择“QT-MY-IMX28-3.14.54 NAND with uboot”烧写镜像。
note: if file system in use is rootfs-qt.tar.bz2, please choose “QT-MY-IMX28-3.14.54 NAND with uboot”as programing image

使用网络烧写(program with network)

搭建TFTP (ubuntu系统)(build up TFTP (ubuntu system))

(1) Setup tftp server files (下载并安装tftp)
Setup tftp server files (download and install tftp)
  $ sudo apt-get install tftpd tftp openbsd-inetd
(2) make a tftp directory (新建tftp目录和改变其属性)
make a tftp directory (buid tftp directory and change its property)
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目录)
Open /etc/inetd.conf and edit it (change tftp directory of configured file)
  $ sudo gedit /etc/inetd.conf
Coment this line :

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)
Restarting tftp service (reboot tftp)
  $ sudo /etc/init.d/openbsd-inetd restart

搭建NFS (网络烧写不需要用到nfs)
(build NFS (network programing does't need nfs))

(1) Install NFS server package (下载并安装nfs)
Install NFS server package.(download and install nfs)
  $ sudo apt-get install nfs-kernel-server
(2) Create NFS directory:/home/myzr/nfsroot (新建nfs目录)
Create NFS directory:/home/myzr/nfsroot.(newly build nfs directory)
  $ mkdir /home/myzr/nfsroot
(3) Configure mounted directory and authority (修改配置文件的nfs目录)
Configure mounted directory and authority.(change nfs directory of configuration file)
  $ 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)
Restart the NFS service.(reboot nfs)
  $ sudo /etc/init.d/portmap restart
  $ sudo /etc/init.d/nfs-kernel-server restart

tftp下载(tftp download)

(1) 把“u-boot.sb”、“imx28-evk.dtb”、“zImage”、“filesystem.ubifs”复制到“/home/myzr/tftp”目录下。
copy “u-boot.sb”、“imx28-evk.dtb”、“zImage”、“filesystem.ubifs”to the directory of “/home/myzr/tftp”
(2) 设置环境变量(板子和电脑网线直连)
set environment variables(directly connect board with computer lan line)
$ setenv ipaddr 192.168.3.104 (板子IP)

$ setenv serverip 192.168.3.110 (电脑IP)

(3) 烧写
program
$ run update_nand_kernel (烧写zImage)
$ run update_nand_kernel.(program zImage)

  IMX28 31454 build 9.2.3.1.png

$ run update_nand_fdt (烧写fdt)
$ run update_nand_fdt.(program fdt)

  IMX28 31454 build 9.2.3.2.png

$ run update_nand_filesystem (烧写文件系统)
$ run update_nand_filesyste.(program file system)

  IMX28 31454 build 9.2.3.3.png

= 登录方式(login way) =

串口登录(serial port login)

插上USB转串口线和电源,开机后,差不多10秒后,在终端上敲回车键可以进入系统。
plug in USB to serial port line and power supply,enter key Enter to enter system in about 10 minutes after starting the device

  IMX28 31454 build 10.1.0.1.png

ssh登录(ssh login)

以太网登录(ethernet login)

插上网线和电源,开机后,差不多10秒后,可以软件SecureCRT登录,板子默认以太网的IP为192.168.3.104,你可以设置电脑的IP为192.168.3.110,然后配置SecureCRT,输入用户名是root,密码myzr。如下图:
plug in lan line and power supply,you can login via software SecureCRT in about 10 minutes after starting the device,the board default ehternet IP as 192.168.3.104,you can set computer IP as 192.168.3.110,then configure SecureCRT,enter root as user name and myzr as password,like below:
  IMX28 31454 build 10.2.1.1.png
输入完后,点击”OK“就登录完成。
after entering is over,click "ok",the login is completed

USB登录(USB可识别成网口)(USB login(USB can be identified as network port))

  插上MINI USB线,开机后,差不多10秒后,可以软件SecureCRT登录,板子默认USB的IP为192.168.4.104,你可以设置电脑的IP为192.168.4.110,然后配置SecureCRT,输入用户名是root,密码myzr。如下图:
plug in lan line and power supply,you can login via software SecureCRT in about 10 minutes after starting the device,the board default ehternet IP as 192.168.3.104,you can set computer IP as 192.168.3.110,then configure SecureCRT,enter root as user name and myzr as password,like below:
  IMX28 31454 build 10.2.2.1.png
输入完后,点击”OK“就登录完成。
after entering is over,click "ok",the login is completed

= 测试(test) =

USB测试(USB test)

直接插上U盘,挂载后可看到U盘的内容。(不是QT系统,会自动挂载)
directly insert U disk,you can see the content of U disk after mounting(if it is not QT system,there will be an automatic mounting)

  IMX28 31454 build 11.1.0.1.png

SD卡测试(SD card test)

直接插上SD卡,挂载后可看到SD卡的内容。(不是QT系统,会自动挂载)
directly SD card,you can see the content of SD card after mounting(if it is not QT system,there will be an automatic mounting)

  IMX28 31454 build 11.2.0.1.png

以太网测试(ethernet test)

插上网线,直接用ping命令测试eth0和eth1网口。默认eth0的IP为192.168.3.104,我设置eth1为192.168.3.105。如下:
plug in lan line,test eth0 and eth1 network port directly with ping command. defaulted IP of eth0 is 192.168.3.104,let's set eth1 as 192.168.3.105,as below:

     IMX28 31454 build 11.3.0.1.png

uart串口测试(uart serial port test)

串口uat0的设备ttyAPP0,串口uat3的设备ttyAPP3。测试时,请短接发管脚。
device ttyAPP0 of serial port uat0,device ttyAPP3 of serial port uat3,please short connect transceiver pin in test.

  IMX28 31454 build 11.4.0.1.png


  IMX28 31454 build 11.4.0.2.png

gpio测试(gpio test)

GPIO_2_26,GPIO_2_25和GPIO_2_27已经在驱动配置为GPIO功能了,下面以管脚GPIO_2_26为例,计算GPIO_2_26的管脚号为232+26=90,测试如下:
GPIO_2_26,GPIO_2_25 and GPIO_2_27 were set as function of GPIO in driver configuration,take pin of GPIO_2_26 as an example to figure out the no.of pin of GPIO_2_26 is 2</em>32+26=90,the test as below:
  IMX28 31454 build 11.5.0.1.png

spi测试(spi test)

SPI接口为半双工模式,这里你只测发,通过示波器可观察到波形。方法一只发送0x55和0x75;方法二是发送字符串”myzr“。
SPI interface is semiduplex mode,here you only test the sending, you can see wave shape through oscilloscope .way number 1 is to only send 0x55 and 0x75,way number2 is to send charater string"myzr"

  IMX28 31454 build 11.6.0.1.png

watdog测试(watchdog test)

  “看门狗”,全称Watchdog timer,是一个在软件出错的时候可以复位计算机系统的硬件定时器。通常一个用户空间守护进程会在正常的时间间隔内通过/dev/watchdog 特殊设备文件来通知内核的Watchdog驱动,用户空间一切正常。如果用户空间出现问题(如RAM 错误,内核BUG 等),则通知将会停止,然后硬件Watchdog 将在超时后复位系统。
"watch dog",the full name is wathcdog timer,which is hardware timer to reset computer sytem when there is an error in software. usually a user space protect procedure will notice watchdog driver in kernel through special device /dev/watchdog in normal time interval that everything in user space is normal. if there is an error in user space(such as RAM error,kernel BUG and ect),the notice will be stopped,then hardware Watchdog will reset system after timeout.
  测试程序中打开/dev/watchdog 设备文件,启动了Watchdog,每过一秒钟喂狗一次,系统不会重启。
/dev/watchdog device file will be opened in test program,and start Watchdog,feeding dog will happen once each second,system won't reboot.

  IMX28 31454 build 11.7.0.1.png

测试程序中打开了/dev/watchdog 设备文件,启动Watchdog,程序进入循环状态,由于没有喂狗,30 秒后系统复位。
/dev/watchdog device file will be opened in test program,and start Watchdog,program come into cycling state,since there is not dog feeding, and system will reset in 30 seconds

  IMX28 31454 build 11.7.0.2.png