完善资料让更多小伙伴认识你,还能领取20积分哦,立即完善>
本帖最后由 一只耳朵怪 于 2018-6-4 14:39 编辑
源码文件(source code) 评估板对应的Linux版本及对应的源码文件见下表: The corresponding Linux version of the evaluation board and the corresponding source code files are shown in the table below:
Linux program cross compilation 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 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 安装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 提示:上图为安装过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 提示:上图为安装过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 安装ncurses-dev(install ncurses-dev) make menuconfig对其具有依赖性质 make menuconfig is dependant to it $ sudo aptitude -y install ncurses-dev 提示:上图为安装过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) 安装Linux交叉编译工具链(install 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 should 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 4)复制交叉编译工具配置文件 copy congigured file of cross compilation tool 将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 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编译(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-imx28/02_source”of Linux development host 这一步自己采取相应的方式完成。 this step should be done in your own way 解压u-boot源码包(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 进入u-boot源码目录(enter u-boot source code directory) $ cd ~/my-imx28/02_source/u-boot-2009.08 清除u-boot临时文件(remove u-boot temporary file) $ make distclean 配置u-boot(configure)
$ make mx28_evk_config 执行编译(execute compilation) $ make 提示:这里为了提高编译速度,在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_ivt_uboot.***是烧写的镜像。 tips: imx28_ivt_uboot.*** is the image programmed $ cp u-boot ../imx-bootlets-src-10.12.01 $ cd ../imx-bootlets-src-10.12.01/ $ sudo cp elfto*** /usr/bin/ $ ./build 目标文件(target file)
编译完成后通过ls命令即可看到编译得到的文件imx28_ivt_uboot.*** you can get the compiled file imx28_ivt_uboot.*** with ls command after compilation. $ ls
MY-IMX28系列评估板的u-boot配置对应的目标文件名见下表: The corresponding name of target file for u-boot configuration of MY-IMX28 series evaluation board is shown in the table below:
准备编译(prepare compilation) 复制源码包到开发主机中(copy source code package to the development host) 将下载的“linux源码”复制到Linux开发主机的“~/my-imx28/02_source”。 copy“linux source code” 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-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)
$ cd ~/my-imx28/02_source/linux-2.6.35.3
$ make distclean 内核配置(kernel configuration) $ cp .mx28_config .config 编译内核(compile kernel)
$ make zImage -j4
arch/arm/boot/uImage即为编译得到的内核文件,使用ls命令可查看文件信息。 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)
$ make modules
$ make modules_install INSTALL_MOD_PATH=./modules
$ cd modules $ tar cjf ../modules.tar.bz2 * 应用程序编译(compile application) Linux应用程序编译(compilation of Linux application) 编写应用程序 (write application)
$ cd ~/my-imx28/01_application/
$ vim hello.c 写入以下代码并保存 write and save the following code
{ printf("Hello, MYZR!n"); return; }
$ cat hello.c 编译应用程序 (compile application)
$ source ~/my-imx28/03_tools/gcc-4.4.4-glibc-2.11.1-multilib-env
$ ${CROSS_COMPILE}gcc hello.c -o hello.out 注意:上面的命令有包含“$”号,即“${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.
$ file hello.out 可以看到目标文件 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_ToolProfilesMX28 Linux UpdateOS Firmwarefilesimage-linux-2635/rootfs.tar.bz2复制到“~/my-imx28/04_image/”目录下)。 add your own application in following ways:( copy MY-IMX28_Born_ToolProfilesMX28 Linux UpdateOS Firmwarefilesimage-linux-2635/rootfs.tar.bz2 to the directory of “~/my-imx28/04_image/”) 文件系统rootfs.ubifs(file system rootfs.ubifs) 复制mkfs.ubifs,ubinize到电脑的“/usr/bin”目录下(如果电脑有这两个应用就不需要复制了);复制build_rootfs和ubinize.cfg到“~/my-imx28/04_image/”目录。 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 烧写方式(way of programming) 至此,我们在“~/my-imx28/02_source/”得到了除文件系统以外的一套烧录文件。包括“imx28_ivt_uboot.***”、“uImage”、“rootfs.tar.bz2”。 so far,we get a set of programming files except file system from“~/my-imx28/02_source/”,including“imx28_ivt_uboot.***”、“uImage”、“rootfs.tar.bz2” 使用MFGTOOL烧写(program with MFGTOOL) 把文件“imx28_ivt_uboot.***”、“uImage”、“rootfs.tar.bz2复制到“MY-IMX28_Born_ToolProfilesMX28 Linux UpdateOS Firmwarefilesimage-linux-2635”目录下。按住REC按键,插上MINI USB线和电源线,接着打开MfgTool.exe,点击“扫描设备”,检测到HID设备时,松开REC按键,如下所示: copy “imx28_ivt_uboot.***”、“uImage”、“rootfs.tar.bz2 to the directory of “MY-IMX28_Born_ToolProfilesMX28 Linux UpdateOS Firmwarefilesimage-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: 点击菜单的“Options”,然后在选项“Profiles”选择“MY-IMX28-2.6.35 NAND with uboot”,接着点击“确定”,最后点击“开始”。 click"Options" in the menu,select “MY-IMX28-2.6.35 NAND with uboot”in the option “Profiles”,then click"Enter",finally click"start" 烧写成功后,点击“停止”就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 使用网络烧写(program via network) 搭建TFTP (ubuntu系统)(establish TFTP (ubuntu system)) (1) Setup tftp server files (下载并安装tftp) Setup tftp server files (download and isntall tftp) $ sudo apt-get install tftpd tftp openbsd-inetd (2) make a tftp directory (新建tftp目录和改变其属性) 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 (修改配置文件的tftp目录) 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/***in/tcpd /usr/***in/in.tftpd /home/myzr/tftp (4)Restarting tftp service (重启tftp) Restarting tftp service (reboot tftp) $ sudo /etc/init.d/openbsd-inetd restart 搭建NFS (网络烧写不需要用到nfs)( establish NFS (nfs is not needed for network programming)) (1) Install NFS server package (下载并安装nfs) Install NFS server package (download and isntall nfs) $ sudo apt-get install nfs-kernel-server (2) Create NFS directory:/home/myzr/nfsroot (新建nfs目录) Create NFS directory:/home/myzr/nfsroot (establish nfs directory) $ mkdir /home/myzr/nfsroot (3) Configure mounted directory and authority (修改配置文件的nfs目录) 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 (重启nfs) Restart the NFS service (reboot nfs) $ sudo /etc/init.d/portmap restart $ sudo /etc/init.d/nfs-kernel-server restart tftp下载(download of tftp) (1) 把“uImage”和“rootfs.ubifs”复制到“/home/myzr/tftp”目录下。 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 (板子IP) $ setenv serverip 192.168.3.110 (电脑IP) |
||||||||||||||||||
【米尔-国产瑞芯微RK3568开发板试用体验】评测一 系统配置
604 浏览0 评论
1162 浏览0 评论
1950 浏览1 评论
如何配置Linux操作系统设备树让我的开发板可以将板子上的GPIO接口用作 I2S输出??
2383 浏览1 评论
1644 浏览0 评论
小黑屋|手机版|Archiver|德赢Vwin官网(湘ICP备2023018690号)
GMT+8, 2024-8-27 20:33, Processed in 0.555121 second(s), Total 60, Slave 46 queries .
Powered by德赢Vwin官网 网
© 2015bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号