查看“MYZR-IMX28 Linux-2.6.35 Build Manual”的源代码
←
MYZR-IMX28 Linux-2.6.35 Build Manual
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
<div> = '''Document instruction''' = ---- == '''System environment instruction''' == *CUP architeture of host used for compilation:64bit <br> *CUP architeture of host used for compilation:64bit <br> *Linux release verson:Ubuntu <br> *Ubuntu version type: saver veresion <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> == '''Operation 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 “linyn@u12045-serv:~$”.><br> = '''Prepare source code and relevant files''' = ---- == '''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 !System version supported !u-boot source code !linux source code |- |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 program cross compilation tool:gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2 <br> Linux cross compilation tool configuration file:gcc-4.4.4-glibc-2.11.1-multilib-env <br> == '''Creat working directory''' == 1)Source code directory <br> $ mkdir -p ~/my-imx28/02_source<br> [[File:IMX28_2635_build_2.3.0.1.png]]<br> 2)Tool directory <br> $ mkdir -p ~/my-imx28/03_tools<br> [[File:IMX28_2635_build_2.3.0.2.png]]<br> 3)Image directory <br> $ mkdir -p ~/my-imx28/04_image<br> [[File:IMX28_2635_build_2.3.0.3.png]]<br> 4)Application directory <br> $ mkdir -p ~/my-imx28/01_application<br> [[File:IMX28_2635_build_2.3.0.4.png]]<br> = '''Prepare development environment''' = ---- == '''Update source list of host''' == $ sudo apt-get update <br> [[File:IMX28_2635_build_3.1.0.1.png]]<br> It looks like below after the update <br> [[File:IMX28_2635_build_3.1.0.2.png]]<br> == '''Install management tool of aptitude package and ia32-libs''' == Tips: if Linux of compilation host is 32bit,then you can skip this step</span><br> === Install management tool of aptitude package === $ sudo apt-get -y install aptitude <br> [[File:IMX28_2635_build_3.2.1.1.png]]<br> Tips: the above image is the screenshots after re-execution of installation command when intallation of aptitude was completed <br> === Install ia32-libs with aptitude === $ sudo aptitude -y install ia32-libs <br> [[File:IMX28_2635_build_3.2.2.1.png]]<br> Tips: the above image is the screenshots after re-execution of installation command when intallation of aptitude and ia32-libs was completed <br> == '''Install mkimage tool''' == $ sudo apt-get -y install uboot-mkimage <br> Tips: the following image is the screenshots after re-execution of installation command when intallation of mkimage was completed <br> [[File:IMX28_2635_build_3.3.0.1.png]]<br> == '''Install ncurses-dev''' == Make menuconfig is dependant to it <br> $ sudo aptitude -y install ncurses-dev <br> [[File:IMX28_2635_build_3.4.0.1.png]]<br> Tips: the above image is the screenshots after re-execution of installation command when intallation of ncurses-dev was completed <br> = '''Install and configure cross compiler tool chain''' = ---- == '''Install cross compilation tool chain''' == 1)Enter cross compilation tool chain diretory <br> $ cd ~/my-imx28/03_tools/<br> 2)Copy Linux cross compilation tool to directory <br> 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 <br> 3)Decompress Linux cross compilation tool <br> $ tar jxf gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2<br> [[File:IMX28_2635_build_4.1.0.1.png]]<br> 4)Copy congigured file of cross compilation tool <br> 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<br> 5)Check installation <br> $ source gcc-4.4.4-glibc-2.11.1-multilib-env<br> $ ${CROSS_COMPILE}gcc –v<br> [[File:IMX28_2635_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-imx28/02_source”of Linux development host <br> This step should be done in your own way <br> === Decompress u-boot source code === $ cd ~/my-imx28/02_source/<br> $ tar jxf u-boot-2009.08.tar.bz2<br> $ tar jxf imx-bootlets-src-10.12.01.tar.bz2<br> [[File: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> [[File:IMX28_2635_build_5.2.1.1.png]]<br> === Enter u-boot source code directory=== $ cd ~/my-imx28/02_source/u-boot-2009.08<br> [[File:IMX28_2635_build_5.2.2.1.png]]<br> === Remove u-boot temporary file === $ make distclean <br> [[File:IMX28_2635_build_5.2.3.1.png]]<br> === Configure u-boot=== {| class="wikitable" !Evaluation board main model !CPU type--momery capacity !Corresponding configuration of u-boot |- |MYZR-IMX28-EVK ||MX283/7, 128M ||mx28_evk_config |} *Example for configuration of MYZR-IMX28-EVK :<br> $ make mx28_evk_config <br> [[File:IMX28_2635_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:IMX28_2635_build_5.2.5.1.png]]<br> *Compile imx28_ivt_uboot.sb <br> Tips: imx28_ivt_uboot.sb is the image programmed <br> $ cp u-boot ../imx-bootlets-src-10.12.01<br> $ cd ../imx-bootlets-src-10.12.01/<br> $ sudo cp elftosb /usr/bin/<br> $ ./build<br> [[File:IMX28_2635_build_5.2.5.2.png]]<br> == '''Target file''' == *Compile file <br> You can get the compiled file imx28_ivt_uboot.sb with ls command after compilation.<br> $ ls <br> [[File:IMX28_2635_build_5.3.0.1.png]]<br> *Target file</span><br> The corresponding name of target file for u-boot configuration of MYZR-IMX28 series evaluation board is shown in the table below:<br> {| class="wikitable" !u-boot configuration !Target file |- |mx28_evk_config ||imx28_ivt_uboot.sb |} = '''Compile kernel''' = ---- == '''Prepare compilation''' == === Copy source code package to the development host=== Copy“linux source code” to “~/my-imx28/02_source”of Linux development host <br> This step should be done in your own way <br> === Decompress Linux source code package === $ cd ~/my-imx28/02_source/<br> $ tar jxf linux-2.6.35.3.tar.bz2<br> [[File: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> [[File:IMX28_2635_build_6.2.1.1.png]]<br> === Remove kernel temporary file=== *Enter Linux source code directory <br> $ cd ~/my-imx28/02_source/linux-2.6.35.3<br> [[File:IMX28_2635_build_6.2.2.1.png]]<br> *Remove temporary file <br> $ make distclean <br> [[File:IMX28_2635_build_6.2.2.2.png]]<br> === Kernel configuration === $ cp .mx28_config .config <br> [[File:IMX28_2635_build_6.2.3.1.png]]<br> == '''Compile kernel''' == *Execute compilation <br> $ make zImage -j4 <br> [[File:IMX28_2635_build_6.3.0.1.png]]<br> *Complete compilation <br> [[File:IMX28_2635_build_6.3.0.2.png]]<br> *Target file <br> arch/arm/boot/uImage is the kernel file compiled,you can check the file information with ls command.<br> $ ls arch/arm/boot/uImage -la <br> [[File:IMX28_2635_build_6.3.0.3.png]]<br> == '''Compile module''' == *Command of module compilation<br> $ make modules<br> [[File:IMX28_2635_build_6.4.0.1.png]]<br> *Install module to specified directory<br> $ make modules_install INSTALL_MOD_PATH=./modules<br> [[File:IMX28_2635_build_6.4.0.2.png]]<br> *Package module file<br> $ cd modules<br> $ tar cjf ../modules.tar.bz2 *<br> [[File:IMX28_2635_build_6.4.0.3.png]]<br> = '''Compile application''' = ---- == '''Compilation of Linux application''' == === Write application=== *Enter working directory<br> $ cd ~/my-imx28/01_application/<br> [[File:IMX28_2635_build_7.1.1.1.png]]<br> *Write source code<br> $ vim hello.c <br> *write and save the following code<br> #include <stdio.h> <br> int main(int argc, char **argv) <br> { <br> printf("Hello, MYZR!\n"); <br> return; <br> } <br> *View code<br> $ cat hello.c <br> [[File:IMX28_2635_build_7.1.1.2.png]]<br> === Compile application=== *Configure environment variables<br> $ source ~/my-imx28/03_tools/gcc-4.4.4-glibc-2.11.1-multilib-env<br> [[File:IMX28_2635_build_7.1.2.1.png]]<br> *Compile<br> $ ${CROSS_COMPILE}gcc hello.c -o hello.out <br> [[File:IMX28_2635_build_7.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:IMX28_2635_build_7.1.2.3.png]]<br> You can see the property of target file hello.out<br> = '''File system''' = ---- == '''File system rootfs.tar.bz2''' == 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/”)<br> [[File:IMX28_2635_build_8.1.0.1.png]]<br> == '''File system rootfs.ubifs''' == 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<br> [[File:IMX28_2635_build_8.2.0.1.png]]<br> = '''Burning way''' = ---- 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”<br> == '''Program with MFGTOOL''' == *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:<br> [[File:IMX28_2635_build_9.1.0.1.png]]<br> <br> *Click"Options" in the menu,select “MY-IMX28-2.6.35 NAND with uboot”in the option “Profiles”,then click"Enter",finally click"start"<br> [[File:IMX28_2635_build_9.1.0.2.png]]<br> *When programming is succeeded,click"stop",to finish.<br> <span style="background:red">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''' == === Establish TFTP (ubuntu system)=== (1) Setup tftp server files (download and isntall tftp)<br> $ sudo apt-get install tftpd tftp openbsd-inetd<br> (2) make a tftp directory (establish tftp diretory and change its property)<br> Here we make /home/myzr/tftpt be a tftp directory.<br> $ mkdir /home/myzr/tftp<br> $ chmod 777 /home/myzr/tftp<br> (3) Open /etc/inetd.conf and edit it (modify tftp directory of congigured file)<br> $ sudo gedit /etc/inetd.conf<br> Coment this line :<br> #tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp<br> Add new line:<br> tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /home/myzr/tftp<br> (4)Restarting tftp service (reboot tftp)<br> $ sudo /etc/init.d/openbsd-inetd restart<br> === Establish NFS (nfs is not needed for network programming))=== (1) Install NFS server package (download and isntall nfs)<br> $ sudo apt-get install nfs-kernel-server<br> (2) Create NFS directory:/home/myzr/nfsroot (establish nfs directory)<br> $ mkdir /home/myzr/nfsroot<br> (3) Configure mounted directory and authority (modify nfs directory of configured file)<br> $ sudo gedit /etc/exports<br> Add the following line at the end of the file:<br> /home/myzr/nfsroot *(rw,sync,no_root_squash)<br> (4) Restart the NFS service (reboot nfs)<br> $ sudo /etc/init.d/portmap restart<br> $ sudo /etc/init.d/nfs-kernel-server restart<br> === Download of tftp === (1) Copy“uImage” and “rootfs.ubifs”to“/home/myzr/tftp”directory <br> (2) Set environment variables(directly connect the board and computer) <br> $ setenv ipaddr 192.168.3.104 (The board IP)<br> $ setenv serverip 192.168.3.110 (computer IP)<br> (3) Programme <br> $ run upkernel (programme uImage)<br> <br> [[File:IMX28_2635_build_9.2.3.1.png]]<br> <br> $ run upsystem (programme file system)<br> <br> [[File:IMX28_2635_build_9.2.3.2.png]]<br> <br> = '''Login way''' = ---- == '''Login via serial port''' == Plug in USB to serial port line and power supply,in about 12 seconds after machine starting,click Enter key to enter system.<br> <br> [[File:IMX28_2635_build_10.1.0.1.png]]<br> <br> == '''Login via ssh''' == === '''Login via ethernet''' === (1)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:<br> [[File:IMX28_2635_build_10.2.1.1.png]]<br> (2)After entering, click"OK" to complete login <br> === '''Login via USB(USB can be identified as network port)''' === (1)Plug in MINI USB line,in about 10 seconds after machine starting,login through software SecureCRT <br> (2)Add driving and set IP, as below: <br> <br> [[File:IMX28_2635_build_10.2.2.1.png]]<br> <br> (3)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:<br> After entering, click"OK" to complete login <br> = '''Test''' = ---- == '''USB test''' == Directly insert U disk,you can see the content of U disk after mounting,(if it is not QT system,mounting will be automatic)<br> <br> [[File:IMX28_2635_build_11.1.0.1.png]]<br> <br> == '''SD card test''' == 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)<br> <br> [[File:IMX28_2635_build_11.2.0.1.png]]<br> <br> == '''Ethernet test''' == 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:<br> <br> [[File:IMX28_2635_build_11.3.0.1.png]]<br> <br> == '''Test of uart serial port''' == Device of serial port uat0 is ttySP0, device of serial port uat3 is ttySP3,please short connect pins in the test <br> <br> [[File:IMX28_2635_build_11.4.0.1.png]]<br> <br> <br> [[File:IMX28_2635_build_11.4.0.2.png]]<br> <br> == '''gpio Test''' == 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:<br> <br> [[File:IMX28_2635_build_11.5.0.1.png]]<br> <br> == '''spi Test''' == 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“.<br> <br> [[File:IMX28_2635_build_11.6.0.1.png]]<br> <br> == '''watdog Test''' == "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.<br> Open device file of /dev/watchdog in the test programme,start Watchdog,feed dog once a second,system won't reboot.<br> <br> [[File:IMX28_2635_build_11.7.0.1.png]]<br> <br> 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.<br> <br> [[File:IMX28_2635_build_11.7.0.2.png]]<br> <br> </div>
返回至
MYZR-IMX28 Linux-2.6.35 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
所有页面
工具
链入页面
相关更改
特殊页面
页面信息