“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...”) |
|||
第37行: | 第37行: | ||
!linux 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 |
|- | |- | ||
第144行: | 第144行: | ||
!Corresponding configuration of u-boot | !Corresponding configuration of u-boot | ||
|- | |- | ||
− | | | + | |MYZR-IMX28-EVK ||MX283/7, 128M ||mx28_evk_config |
|} | |} | ||
− | *Example for configuration of | + | *Example for configuration of MYZR-IMX28-EVK :<br> |
$ make mx28_evk_config <br> | $ make mx28_evk_config <br> | ||
[[File:IMX28_2635_build_5.2.4.1.png]]<br> | [[File:IMX28_2635_build_5.2.4.1.png]]<br> | ||
第169行: | 第169行: | ||
[[File:IMX28_2635_build_5.3.0.1.png]]<br> | [[File:IMX28_2635_build_5.3.0.1.png]]<br> | ||
*Target file</span><br> | *Target file</span><br> | ||
− | The corresponding name of target file for u-boot configuration of | + | 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" | {| class="wikitable" | ||
!u-boot configuration | !u-boot configuration |
2020年10月22日 (四) 16:26的版本
目录
- 1 Document instruction
- 2 Prepare source code and relevant files
- 3 Prepare development environment
- 4 Install and configure cross compiler tool chain
- 5 U-Boot compilation
- 6 Compile kernel
- 7 Compile application
- 8 File system
- 9 Burning way
- 10 Login way
- 11 Test
Document instruction
System environment instruction
- CUP architeture of host used for compilation:64bit
- CUP architeture of host used for compilation:64bit
- Linux release verson:Ubuntu
- Ubuntu version type: saver veresion
- Ubuntu version no.:12.04.5
- Ubuntu system type:x86-64
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)The line in the document which begins with “$”,which is followed by the Linux command.
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)
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 )
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")
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.
6)Please follow the document strictly to compile for the first time.Otherwise ,there may be unexpected error
Screenshots instruction
To make the view look neat and tidy , the command prompt in the screenshot should use myzr$ uniformly.
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:~$”.>
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:
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 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
Linux cross compilation 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
2)Tool directory
$ mkdir -p ~/my-imx28/03_tools
3)Image directory
$ mkdir -p ~/my-imx28/04_image
4)Application directory
$ mkdir -p ~/my-imx28/01_application
Prepare development environment
Update source list of host
$ sudo apt-get update
It looks like below after the update
Install management tool of aptitude package and ia32-libs
Tips: if Linux of compilation host is 32bit,then you can skip this step</span>
Install management tool of aptitude package
$ sudo apt-get -y install aptitude
Tips: the above image is the screenshots after re-execution of installation command when intallation of aptitude was completed
Install ia32-libs with aptitude
$ sudo aptitude -y install ia32-libs
Tips: the above image is the screenshots after re-execution of installation command when intallation of aptitude and ia32-libs was completed
Install mkimage tool
$ sudo apt-get -y install uboot-mkimage
Tips: the following image is the screenshots after re-execution of installation command when intallation of mkimage was completed
Install ncurses-dev
Make menuconfig is dependant to it
$ sudo aptitude -y install ncurses-dev
Tips: the above image is the screenshots after re-execution of installation command when intallation of ncurses-dev was completed
Install and configure cross compiler tool chain
Install cross compilation tool chain
1)Enter cross compilation tool chain diretory
$ cd ~/my-imx28/03_tools/
2)Copy Linux cross compilation tool to directory
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
3)Decompress Linux cross compilation tool
$ tar jxf gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2
4)Copy congigured file of cross compilation tool
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
5)Check installation
$ source gcc-4.4.4-glibc-2.11.1-multilib-env
$ ${CROSS_COMPILE}gcc –v
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
This step should be done in your own way
Decompress u-boot source code
$ cd ~/my-imx28/02_source/
$ tar jxf u-boot-2009.08.tar.bz2
$ tar jxf imx-bootlets-src-10.12.01.tar.bz2
Compile
Validate configured file of compilation
$ source ~/my-imx28/03_tools/gcc-4.4.4-glibc-2.11.1-multilib-env
Enter u-boot source code directory
$ cd ~/my-imx28/02_source/u-boot-2009.08
Remove u-boot temporary file
Configure u-boot
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 :
Execute compilation
$ make
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.
- Compile imx28_ivt_uboot.sb
Tips: imx28_ivt_uboot.sb is the image programmed
$ cp u-boot ../imx-bootlets-src-10.12.01
$ cd ../imx-bootlets-src-10.12.01/
$ sudo cp elftosb /usr/bin/
$ ./build
Target file
- Compile file
You can get the compiled file imx28_ivt_uboot.sb with ls command after compilation.
$ ls
- Target file</span>
The corresponding name of target file for u-boot configuration of MYZR-IMX28 series evaluation board is shown in the table below:
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
This step should be done in your own way
Decompress Linux source code package
$ cd ~/my-imx28/02_source/
$ tar jxf linux-2.6.35.3.tar.bz2
Configuration of kernel compilation
Validate configured file of compilation
$ source ~/my-imx28/03_tools/gcc-4.4.4-glibc-2.11.1-multilib-env
Remove kernel temporary file
- Enter Linux source code directory
$ cd ~/my-imx28/02_source/linux-2.6.35.3
- Remove temporary file
Kernel configuration
Compile kernel
- Execute compilation
- Complete compilation
- Target file
arch/arm/boot/uImage is the kernel file compiled,you can check the file information with ls command.
$ ls arch/arm/boot/uImage -la
Compile module
- Command of module compilation
- Install module to specified directory
$ make modules_install INSTALL_MOD_PATH=./modules
- Package module file
$ cd modules
$ tar cjf ../modules.tar.bz2 *
Compile application
Compilation of Linux application
Write application
- Enter working directory
$ cd ~/my-imx28/01_application/
- Write source code
$ vim hello.c
- write and save the following code
- include <stdio.h>
int main(int argc, char **argv)
{
printf("Hello, MYZR!\n");
return;
}
- View code
Compile application
- Configure environment variables
$ source ~/my-imx28/03_tools/gcc-4.4.4-glibc-2.11.1-multilib-env
- Compile
$ ${CROSS_COMPILE}gcc hello.c -o hello.out
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
You can see the property of target file hello.out
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/”)
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
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”
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:
- Click"Options" in the menu,select “MY-IMX28-2.6.35 NAND with uboot”in the option “Profiles”,then click"Enter",finally click"start"
- When programming is succeeded,click"stop",to finish.
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.
Program via network
Establish TFTP (ubuntu system)
(1) Setup tftp server files (download and isntall tftp)
$ sudo apt-get install tftpd tftp openbsd-inetd
(2) make a tftp directory (establish tftp diretory 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 (modify tftp directory of congigured 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 (reboot tftp)
$ sudo /etc/init.d/openbsd-inetd restart
Establish NFS (nfs is not needed for network programming))
(1) Install NFS server package (download and isntall nfs)
$ sudo apt-get install nfs-kernel-server
(2) Create NFS directory:/home/myzr/nfsroot (establish nfs directory)
$ mkdir /home/myzr/nfsroot
(3) Configure mounted directory and authority (modify nfs directory of configured 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 (reboot nfs)
$ sudo /etc/init.d/portmap restart
$ sudo /etc/init.d/nfs-kernel-server restart
Download of tftp
(1) Copy“uImage” and “rootfs.ubifs”to“/home/myzr/tftp”directory
(2) Set environment variables(directly connect the board and computer)
$ setenv ipaddr 192.168.3.104 (The board IP)
$ setenv serverip 192.168.3.110 (computer IP)
(3) Programme
$ run upkernel (programme uImage)
$ run upsystem (programme file system)
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.
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:
(2)After entering, click"OK" to complete login
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
(2)Add driving and set IP, as below:
(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:
After entering, click"OK" to complete login
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)
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)
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:
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
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:
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“.
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.
Open device file of /dev/watchdog in the test programme,start Watchdog,feed dog once a second,system won't reboot.
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.