查看“MYZR-IMX28 Linux-3.14.52 Build Manual”的源代码
←
MYZR-IMX28 Linux-3.14.52 Build Manual
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
<div> = '''Document instruction''' = ---- == '''System environment instruction''' == *CUP architeture of host used for compilation:64bit<br> *System of compiler host:Linux<br> *Linux release version:<br> *Ubuntu version type:saver version<br> *Ubuntu version no.:12.04.5<br> *Ubuntu system type:x86-64<br> <span style="color:red">Note: The development host should use ubuntu 12.04.5 x86-64(desktop and server version are available),Using other distribution of Linux and other versions of Ubuntu may encounter unnecessary problems.</span><br> == '''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 “myzr$” linux command.<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-3.14.54 ||u-boot-2015.04.tar.bz2||linux-3.14.54.tar.bz2 |- |} == '''Cross compiler tool file''' == Linux program cross compiler tool:gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2<br> Linux cross compiler 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 dirrectory<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<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 aptitude and ia32-libs was completed.<br> = '''Install and configure cross compiler tool chain''' = ---- == '''Install Linux 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 need to 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 cross compilation tool configuration file<br> 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<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-imx6/02_source”of Linux development host<br> This step need to be done in your own way<br> === Decompress u-boot source code package === $ cd ~/my-imx28/02_source/<br> $ tar jxf u-boot-2015.04.tar.bz2<br> [[File:IMX28_31454_build_5.1.2.1.png]]<br> === Update library libssl-dev === $ sudo apt-get install libssl-dev<br> [[File:IMX28_31454_build_5.1.3.1.png]]<br> == '''Compile''' == === Validate compilation configuration file === $ 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> === Validate compiler configuration file === $ cd ~/my-imx28/02_source/u-boot-2015.04<br> [[File:IMX28_31454_build_5.2.2.1.png]]<br> === Remove u-boot temporary files === $ make distclean <br> [[File:IMX28_31454_build_5.2.3.1.png]]<br> === Configure u-boot === {| class="wikitable" !Evaluation board main model !CPU type-memory capacity !Corresponaind configuration of u-boot |- |MYZR-IMX28-EVK ||MX283/7, 128M ||mx28_evk_config |} *Example for MYZR-IMX28-EVK configuration:<br> $ make mx28_evk_config <br> [[File:IMX28_31454_build_5.2.4.1.png]]<br> === Execute compilation === $ make u-boot.sb <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_31454_build_5.2.5.1.png]]<br> *Complete compilation<br> Tips: u-boot compiling process may take one or two minutes<br> [[File:IMX28_31454_build_5.2.5.2.png]]<br> == '''Target file''' == *Compile file<br> You can get the compiled file u-boot .sb with ls command after compilation<br> $ ls <br> [[File:IMX28_31454_build_5.3.0.1.png]]<br> *Target file<br> The corresponding target file name for u-boot configuration of MY-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 development host === Copy“linux source code”downloaded 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-3.14.54.tar.bz2<br> [[File:IMX28_31454_build_6.1.2.1.png]]<br> == '''Configuration of kernel compilation''' == === Validate configuration 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-3.14.54<br> [[File:IMX28_31454_build_6.2.2.1.png]]<br> *Remove temporary file<br> $ make distclean <br> [[File:IMX28_31454_build_6.2.2.2.png]]<br> === Kernel configuration === $ cp .mx28_config .config <br> [[File:IMX28_31454_build_6.2.3.1.png]]<br> == '''Compile kernel''' == *Execute compilation<br> $ make zImage -j4 <br> [[File:IMX28_31454_build_6.3.0.1.png]]<br> *Complete compilation<br> [[File:IMX28_31454_build_6.3.0.2.png]]<br> *Target file<br> arch/arm/boot/uImage is the kernel file compiled,you can check file information with ls command.<br> $ ls arch/arm/boot/uImage -la <br> [[File:IMX28_2635_build_6.3.0.3.png]]<br> == '''Compife device tree''' == The correspondence between the type of evaluation board and device tree is shown below:<br> {| class="wikitable" |- !Function !Source code position !Linux device and folder |- |Development main model ||CPU type-memory capacity ||Corresponding device tree file |- |MY-IMX28-EVK ||MX283/7, 128M ||imx28-evk.dtb |- |} *Take MY-IMX28-EVK as an example:<br> $ make imx28-evk.dtb<br> [[File:IMX28_31454_build_6.4.0.1.png]]<br> *Target file<br> You can browse the target device tree file information from compilation with ls command:<br> $ ls arch/arm/boot/dts/*.dtb <br> [[File:IMX28_31454_build_6.4.0.2.png]]<br> == '''Compile module''' == *Command for compiling module<br> $ make modules<br> [[File:IMX28_31454_build_6.5.0.1.png]]<br> *Install module to the specified directory<br> $ make modules_install INSTALL_MOD_PATH=./modules<br> [[File:IMX28_31454_build_6.5.0.2.png]]<br> *Package the module file<br> $ cd modules<br> $ tar cjf ../modules.tar.bz2 *<br> [[File:IMX28_31454_build_6.5.0.3.png]]<br> = '''Application compilation''' = ---- == '''Linux application compilation''' == === Write an application === *Enter working directory<br> $ cd ~/my-imx28/01_application/<br> [[File:IMX28_31454_build_7.1.1.1.png]]<br> *Write souce code<br> $ vim hello.c <br> Write following code and save<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> === Compife 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 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/”)<br> [[File:IMX28_2635_build_8.1.0.1.png]]<br> == '''File system filesystem.ubifs''' == 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/”<br> [[File:IMX28_31454_build_8.2.0.1.png]]<br> = '''Programing mode''' = ---- 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”<br> == '''Program with MFGTOOL''' == 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:<br> [[File:IMX28_2635_build_9.1.0.1.png]]<br> <br> Click“Options”on menu,then select“MY-IMX28-3.14.54 NAND with uboot”on option of “Profiles”,then click“Enter”,finally click“start”<br> [[File:IMX28_31454_build_9.1.0.2.png]]<br> When programing is successful,click"stop",to be completed<br> <span style="background:red">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.</span><br> == ''' Program with network''' == === Build up TFTP (ubuntu system) === (1) Setup tftp server files (download and install tftp)<br> $ sudo apt-get install tftpd tftp openbsd-inetd<br> (2) make a tftp directory (buid tftp directory 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 (change tftp directory of configured 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> === Build NFS (network programing does't need nfs) === (1) Install NFS server package (Download and install nfs)<br> $ sudo apt-get install nfs-kernel-server<br> (2) Create NFS directory:/home/myzr/nfsroot (newly build nfs directory)<br> $ mkdir /home/myzr/nfsroot<br> (3) Configure mounted directory and authority (change nfs directory of configuration 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> === tftp Download === (1) Copy “u-boot.sb”、“imx28-evk.dtb”、“zImage”、“filesystem.ubifs”to the directory of “/home/myzr/tftp”<br> (2) Set environment variables(directly connect board with computer lan line)<br> $ setenv ipaddr 192.168.3.104 (The board IP)<br> $ setenv serverip 192.168.3.110 (Computer IP)<br> (3) Program<br> $ run update_nand_kernel.(program zImage)<br> <br> [[File:IMX28_31454_build_9.2.3.1.png]]<br> <br> $ run update_nand_fdt. (program fdt)<br> <br> [[File:IMX28_31454_build_9.2.3.2.png]]<br> <br> $ run update_nand_filesyste.(program file system)<br> <br> [[File:IMX28_31454_build_9.2.3.3.png]]<br> <br> = '''Login way''' = ---- == '''Serial port login''' == Plug in USB to serial port line and power supply,enter key Enter to enter system in about 10 minutes after starting the device<br> <br> [[File:IMX28_31454_build_10.1.0.1.png]]<br> <br> == '''ssh Login''' == === '''Ethernet login''' === 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:<br> [[File:IMX28_31454_build_10.2.1.1.png]]<br> After entering is over,click "ok",the login is completed<br> === '''USB login(USB can be identified as network port)''' === 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:<br> [[File:IMX28_31454_build_10.2.2.1.png]]<br> After entering is over,click "ok",the login is completed<br> = '''Test''' = ---- == '''USB test''' == 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)<br> <br> [[File:IMX28_31454_build_11.1.0.1.png]]<br> <br> == '''SD card test''' == 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)<br> <br> [[File:IMX28_31454_build_11.2.0.1.png]]<br> <br> == '''Ethernet test''' == 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:<br> <br> [[File:IMX28_31454_build_11.3.0.1.png]]<br> <br> == '''Uart serial port test''' == Device ttyAPP0 of serial port uat0,device ttyAPP3 of serial port uat3,please short connect transceiver pin in test.<br> <br> [[File:IMX28_31454_build_11.4.0.1.png]]<br> <br> <br> [[File:IMX28_31454_build_11.4.0.2.png]]<br> <br> == '''gpio Test''' == 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*32+26=90,the test as below:<br> [[File:IMX28_31454_build_11.5.0.1.png]]<br> <br> == '''SPI Test''' == 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"<br> <br> [[File:IMX28_31454_build_11.6.0.1.png]]<br> <br> == '''watchdog test''' == "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.<br> /dev/watchdog device file will be opened in test program,and start Watchdog,feeding dog will happen once each second,system won't reboot.<br> <br> [[File:IMX28_31454_build_11.7.0.1.png]]<br> <br> /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<br> <br> [[File:IMX28_31454_build_11.7.0.2.png]]<br> <br> </div>
返回至
MYZR-IMX28 Linux-3.14.52 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
所有页面
工具
链入页面
相关更改
特殊页面
页面信息