3042 views|4 replies

253

Posts

0

Resources
The OP
 

MYZR i.MX6-CB314 Compilation [Copy link]

Evaluation board model[/td][td]
u-boot source code file
[/td][td]
linux source code file
[/td][/tr] [tr][td]MY-IMX6-EK200[/td][td=1,4]u-boot-2015.04.tar.xz[/td][td=1,4]linux-3.14.52.tar.xz[/td][/tr] [tr][td]MY-IMX6-EK314[/td][/tr] [tr][td]MY-IMX6-EK336[/td][/tr] [tr][td]MY-IMX6-EK140[/td][/tr] [/table] Cross compiler tool file
Linux program cross compiler tool:gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz Linux program cross compiler tool:gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz
Linux cross compiler tool configuration file:gcc-linaro-arm-linux-gnueabihf-492-env Linux cross compiler tool configuration file:gcc-linaro-arm-linux-gnueabihf-492-env 37)]QT5 program cross-compilation tool: fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-vfp-neon-toolchain-3.14.52-1.1.0.sh QT5 program compiler tool: fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-vfp-neon-toolchain-3.14.52-1.1.0.sh
Create working directory(create working directory)
1) Source code directory source code directory $ mkdir ~/my-imx6/02_source –p
2) Tool directory tool directory $ mkdir ~/my-imx6/03_tools –p
3) Image directory image directory $ mkdir ~/my-imx6/04_image –p $ mkdir ~/my-imx6/04_image/image-linux-31452 –p
4) Application directory application diretory $ mkdir ~/my-demo
Install cross compiler tool chain (install cross compiler tool chain)
Install Linux cross compiler tool chain (install Linux cross compiler tool chain)[ 1) Enter the cross compiler tool chain directoryenter cross compiler tool chain directory $ cd ~/my-imx6/03_tools/
2) Copy Linux cross compiler tool to directory Copy gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz to "~/my-imx6/03_tools ", this step is completed in the corresponding way. 3) Unzip the Linux cross Compilation tool copy gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz to "~/my-imx6/03_tools", complete this step by yourself in a proper way. $ tar xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz
4) Copy cross compiler tool configuration file Copy gcc-linaro-arm-linux-gnueabihf-492-env to "~/my-imx6/03_tools". This step is completed by yourself. "~/my-imx6/03_tools", complete this step by yourself in a proper way.
5) Check the installation check installation $ source gcc-linaro-arm-linux-gnueabihf-492-env $ ${CROSS_COMPILE}gcc –v
Install QT5 cross compiler tool (install QT5 cross compiler tool)
[color= rgb(37, 37, 37)]1) Enter the cross compiler tool chain directoryenter cross compiler tool chain directory $ cd ~/my-imx6/03_tools/
2) Execute the installation command execute installation command $ sh fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-vfp-neon-toolchain-3.14.52-1.1.0.sh
[ align=left]3)Choose installation pathchoose installation path After executing the installation command, there will be a following prompt message: Enter target directory for SDK (default: /opt/fsl-imx-x11/3.14.52-1.1.0): then press“Enter”key,let's keep defauted installation path。
4)Confirm installation pathconfirm installation path, the following information will be prompted: afterwards,there will be a following prompt message: You are about to install the SDK to "/opt/fsl-imx-x11/3.14.52-1.1.0". Proceed[Y/n]? then enter“Y”and press“Enter”key for confirmation. 5)Wait untill installation is completed Tips: The installation process will take a few minutes. tips: installation will take a few minutes. 6) Check installation Check the version information of cross compiler tool chain to verify the normality of installation $ source /opt/fsl-imx-x11/3.14.52-1.1.0/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi $ qmake -v After execution of command, there will be following message:
U-Boot compilation(U-Boot compilation)
Prepare compilation(prepare compilation)Copy source code package to development host(copy source code package to development host)
Copy the downloaded “u-boot source code” to “~/my-imx6/02_source” of Linux development host. copy“u-boot source code”downloaded to “~/my-imx6/02_source”of Linux development host. complete this step by yourself in a proper way.
Decompress u-boot source code package
$ cd ~/my-imx6/02_source/ $ tar xf u-boot-2015.04.tar.xz
Compile(compilation)Validate the compilation configuration file(validate compiler configuration file)
$ source ~/my-imx6/03_tools/gcc-linaro-arm-linux-gnueabihf-492-env

进入u-boot源码目录(enter u-boot source code directory)
$ cd ~/my-imx6/02_source/u-boot-2015.04


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


配置u-boot(configure u-boot)

  • 评估板及对应的 u-boot 编译配置:
configuration of development and its corresponding compiler:
评估板主型号
(development board main model)
CPU类型-内存容量
(CPU type-memory capacity )
处理器架构
(architeture of processor)
对应的u-boot配置
(corresponding u-boot configuration)
MY-IMX6-EK200i.MX 6QuadPlus - 1GCortex-A9myimx6ek200-6qp_config
i.MX 6QuadPlus - 2GCortex-A9myimx6ek200-6qp-2g_config
i.MX6 Quad - 1GCortex-A9myimx6ek200-6q_config
i.MX6 Quad - 2GCortex-A9myimx6ek200-6q-2g_config
i.MX6 DualLite - 1GCortex-A9myimx6ek200-6u_config
i.MX 6Solo - 512MCortex-A9myimx6ek200-6s_config
i.MX 6Solo - 1GCortex-A9myimx6ek200-6s-1g_config
MY-IMX6-EK314i.MX 6QuadPlus - 1GCortex-A9myimx6ek200-6qp_config
i.MX 6QuadPlus - 2GCortex-A9myimx6ek200-6qp-2g_config
i.MX6 Quad- 1GCortex-A9myimx6ek314-6q_config
i.MX6 Quad- 2GCortex-A9myimx6ek314-6q-2g_config
i.MX6 DualLite - 1GCortex-A9myimx6ek314-6u_config
MY-IMX6-EK336i.MX 6QuadPlus - 1GCortex-A9myimx6ek336-6qp_config
i.MX 6QuadPlus - 2GCortex-A9myimx6ek336-6qp-2g_config
i.MX6 Quad- 1GCortex-A9myimx6ek336-6q_config
i.MX6 Quad- 2GCortex-A9myimx6ek336-6q-2g_config
MY-IMX6-EK140i.MX 6UltraLite-256MCortex-A7myimx6ek140-6g_config
i.MX 6UltraLite-512MCortex-A7myimx6ek140-6g-512m_config
i.MX 6UltraLite Full - 256MCortex-A7myimx6ek140p-6g_defconfig
i.MX 6UltraLite Full - 512MCortex-A7myimx6ek140p-6g-512m_defconfig
  • MYIMX6EK200-6Q-1G configuration example: [ /list]
    MYIMX6EK200-6Q-1G configuration example: $ make myimx6ek200-6q_config [img= 642,158]http://wiki.myzr.com.cn/images/9/95/Myimx6linux3.14_build_5.2.4.1.png[/img] [ /color]
    Execute compilation
    $ Make Tip: In order to increase the compilation speed, "-j4" is added after make. The Linux host compiled here is a dual-core 4-threaded one, so "-j" is followed by 4, which means 4 threads are used for compilation. The number after "-j" can be allocated according to system resources, but should not exceed the maximum number of threads supported by the compilation host. 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.
    • Compilation completed
    complete compilation Tip: The u-boot compilation process takes about Tips: u-boot compiling process may take one or two minutes.
    Target file(target file)
    • Compiled file
    [align =left]compile file After the compilation is complete, you can use the ls command to see the compiled file u-boot.imx. get the compiled file u-boot .imx with ls command after compilation. $ ls
    • Target file
    [color=rgb (37, 37, 37)]target file The corresponding target file name of the u-boot configuration of the MY-IMX6 series evaluation board is shown in the following table: name for u-boot configuration of MY-IMX6 series evaluation board is shown in the table below:
    u-boot配置
    (u-boot configuration)
    目标文件
    (target file)
    myimx6ek200-6qp_configuboot-myimx6ek200-6qp.imx
    myimx6ek200-6qp-2g_configuboot-myimx6ek200-6qp-2g.imx
    myimx6ek200-6q_configuboot-myimx6ek200-6q.imx
    myimx6ek200-6q-2g_configuboot-myimx6ek200-6q-2g.imx
    myimx6ek200-6u_configuboot-myimx6ek200-6u.imx
    myimx6ek200-6s_configuboot-myimx6ek200-6s.imx
    myimx6ek200-6s-1g_configuboot-myimx6ek200-6s-1g.imx
    myimx6ek314-6qp_configuboot-myimx6ek314-6qp.imx
    myimx6ek314-6qp-2g_configuboot-myimx6ek314-6qp-2g.imx
    myimx6ek314-6q_configuboot-myimx6ek314-6q.imx
    myimx6ek314-6q-2g_configuboot-myimx6ek314-6q-2g.imx
    myimx6ek314-6u_configuboot-myimx6ek314-6u.imx
    myimx6ek336-6qp_configuboot-myimx6ek336-6qp.imx
    myimx6ek336-6qp-2g_configuboot-myimx6ek336-6qp-2g.imx
    myimx6ek336-6q_configuboot-myimx6ek336-6q.imx
    myimx6ek336-6q-2g_configuboot-myimx6ek336-6q-2g.imx
    myimx6ek140-6g_configuboot-myimx6ek140-6g.imx
    myimx6ek140-6g-512m_configuboot-myimx6ek140-6g-512m.imx
    myimx6ek140p-6g_defconfiguboot-myimx6ek140p-6g.imx
    myimx6ek140p-6g-512m_defconfiguboot-myimx6ek140p-6g-512m.imx
    我们需要将编译得到的u-boot.imx复制为我们的目标文件名。
    We need to copy the compilied file u-boot.imx as our target file name.:
    这里以MY-IMX6-EK200-6Q为例(把配置myimx6ek200-6q_config编译生成的u-boot.imx复制为目标文件):
    Copy the generated file u-boot.imx from the compilation of myimx6ek200-6q_config as target file.):
    $ cp u-boot.imx ~/my-imx6/04_image/image-linux-31452/uboot-myimx6ek200-6q.imx

    编译内核(compile kernel)
    准备编译(prepare compilation)复制源码包到开发主机中(copy source code package to development host)
    将下载的“linux源码”复制到Linux开发主机的“~/my-imx6/02_source”。
    copy “linux source code”downloaded to “~/my-imx6/02_source”of Linux development host。
    这一步自己采取相应的方式完成。
    complete this step by yourself in a proper way。

    解压linux源码包(decompress linux source code package)
    $ cd ~/my-imx6/02_source/ $ tar xf linux-3.14.52.tar.xz
    Kernel compilation configurationValidate compilation configuration file file)
    $ source ~/my-imx6/03_tools/gcc-linaro-arm-linux-gnueabihf-492-env
    Clear kernel temporary files (remove kernel temporary file)
    • Enter linux source code directory
    enter linux source code directory $ cd ~/my-imx6/02_source/linux-3.14.52
    • Remove temporary files
    remove temporary file $ make distclean
    kernel configuration
    • kernel configuration file
      evaluation board model
      configuration file
      MY-IMX6-EK200myimx6_defconfig
      MY-IMX6-EK314
      MY-IMX6-EK336
      MY-IMX6-EK140myimx6ul_defconfig
      $ make myimx6_defconfig if what compified is kernel of MY-IMX6-EK140,please use $ make myimx6ul_defconfig Here take myimx6_defconfig as an example.
      Compile kernel
      • Execute compilation
      execute compilation $ make zImage
      • Compilation completed
      • Target file
      target file arch/arm/boot/zImage is the kernel file compifed, you can check file information with ls command. $ ls arch/arm/boot/zImage -la
      Note: The kernel file we burned and started is named "zImage-myimx6", so we need to copy zImage to zImage-myimx6. Note: The kernel file name which is going to be programed and started is “zImage-myimx6”, So we should Copy zImage as zImage-myimx6 $ cp arch/arm/boot/zImage ~/my-imx6/04_image/image-linux -31452/zImage-myimx6
      Compile device tree(compife device tree)
      [size=14px ]The correspondence between the type of evaluation board and device tree is shown below:
      [table=98 %,rgb(249, 249, 249)] [tr][td]
      Evaluation board main model (development main model)
      [/td][td]
      CPU type - Memory capacity (CPU type-memory capacity)
      [/td][td]
      Corresponding device tree file
      [/td][/tr] [tr ][td=1,7]MY-IMX6-EK200[/td][td]i.MX 6QuadPlus - 1G[/td][td]myimx6ek200-6qp.dtb[/td][/tr] [tr][td]i.MX 6QuadPlus - 2G[/td][td]myimx6ek200-6qp-2g.dtb[ /td][/tr] [tr][td]i.MX6 Quad - 1G[/td][td]myimx6ek200-6q.dtb[/td][/tr] [tr][td]i.MX6 Quad - 2G[/td][td]myimx6ek200-6q-2g.dtb[/td ][/tr] [tr][td]i.MX6 DualLite - 1G[/td][td]myimx6ek200-6u.dtb[/td][/tr] [tr][td]i.MX 6Solo - 512M[/td][td]myimx6ek200-6s.dtb[/td][/tr] [tr][td]i.MX 6Solo - 1G[/td][td ]myimx6ek200-6s-1g.dtb[/td][/tr] [tr][td=1,5]MY-IMX6-EK314[/td][td]i.MX 6QuadPlus - 1G[/td][td]myimx6ek314-6qp.dtb[/td][/tr] [tr ][td]i.MX 6QuadPlus - 2G[/td][td]myimx6ek314-6qp-2g.dtb[/td][/tr] [tr][td]i.MX6 Quad - 1G[/td][td]myimx6ek314-6q.dtb[/td][/tr] [tr][td]i.MX6 Quad - 2G[/td][td]myimx6ek314-6q-2g.dtb[/td ][/tr] [tr][td]i.MX6 DualLite - 1G[/td][td]myimx6ek314-6u.dtb[/td][/tr] [tr][td=1,4]MY-IMX6-EK336[/td][td]i.MX 6QuadPlus - 1G[/td][td]myimx6ek336-6qp.dtb[/td][/tr]
      [tr][td]i.MX 6QuadPlus - 2G[/td][td]myimx6ek336-6qp-2g.dtb[/td][/tr]
      [tr][td]i.MX6 Quad - 1G[/td][td]myimx6ek336-6q.dtb[/td][/tr]
      [tr][td]i.MX6 Quad - 2G[/td][td]myimx6ek336-6q-2g.dtb[/td][/tr]
      [tr][td=1,6]MY-IMX6-EK140[/td][td]i.MX 6UltraLite-256M[/td][td]myimx6ek140-6g.dtb[/td][/tr]
      [tr][td]i.MX 6UltraLite-512M[/td][td]myimx6ek140-6g-512m.dtb[/td][/tr]
      [tr][td]i.MX 6UltraLite Full - 256M (2eth)[/td][td]myimx6ek140p-6g.dtb[/td][/tr]
      [tr][td]i.MX 6UltraLite Full - 256M (8uart)[/td][td]myimx6ek140p-6g-8uart.dtb[/td][/tr]
      [tr][td]i.MX 6UltraLite Full - 512M (2eth)[/td][td]myimx6ek140p-6g-512m.dtb[/td][/tr]
      [tr][td]i.MX 6UltraLite Full - 512M (8uart)[/td][td]myimx6ek140p-6g-512m-8uart.dtb[/td][/tr]
      [/table]

      • 以MY-IMX6-EK200-6Q-1G为例
      take MY-IMX6-EK200-6Q-1G as example
      $ make myimx6ek200-6q.dtb


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

      复制设备树文件到镜像目录
      Copy device tree file to image directory
      $ cp arch/arm/boot/dts/myimx6ek*.dtb ~/my-imx6/04_image/image-linux-31452/

      编译模块 (compife module)

      • 编译模块命令
      compile module command
      $ make modules


      • 安装模块到指定目录
      Install module to the specified directory
      $ make modules_install INSTALL_MOD_PATH=./modules
      • Packaging module files
      [color= rgb(37, 37, 37)]package the module file $ cd modules $ tar cjf ../modules.tar.bz2 *
      • Copy the module package to the mirror directory
      [ Copy module package to image directory
      [tr ]
      Evaluation board model (development board model)
      Target module package (target module package)
      [ /tr] MY-IMX6-EK200kernel-modules-myimx6.tar.bz2 MY- IMX6-EK314 MY-IMX6-EK336 MY-IMX6-EK140 kernel-modules-myimx6g.tar.bz2 $ cp ../modules.tar.bz2 ~/my -imx6/04_image/image-linux-31452/kernel-modules-myimx6.tar.bz2 Note: If the configuration file used when compiling the kernel is myimx6_defconfig, here you need to copy modules.tar.bz2 to kernel-modules-myimx6 .tar.bz2; if the configuration file used when compiling the kernel is myimx6ul_defconfig, here you need to copy modules.tar.bz2 Copy it as kernel-modules-myimx6g.tar.bz2 Note: when you compile the Kernel If the configuration file you use is myimx6_defconfig, here you should Copy modules.tar.bz2 as kernel-modules-myimx6.tar.bz2. The file is myimx6ul_defconfig,you should Copy modules.tar.bz2 as kernel-modules-myimx6g.tar.bz2. Application compilation (application compilation)
      Linux application compilationWrite an application[/b ]
      • Create the source code directory of the application and the executable program directory of Linux-3.14.52
      Create application source code directory and Linux-3.14.52 executable program directory $ mkdir ~/my-demo/source_code -p
      $ mkdir ~/my-demo/bin-l31452 -p
      • Write source code
      write source code $ cd ~/my-demo/source_code $ vi hello.c
      Write the following code and Save write following code and save #include37)]package the module file
      $ cd modules
      $ tar cjf ../modules.tar.bz2 *


      • 复制模块包到镜像目录
      Copy module package to image directory
      评估板型号
      (development board model)
      目标模块包
      (target module package)

      MY-IMX6-EK200kernel-modules-myimx6.tar.bz2
      MY-IMX6-EK314
      MY-IMX6-EK336
      MY-IMX6-EK140kernel-modules-myimx6g.tar.bz2
      $ cp ../modules.tar.bz2 ~/my-imx6/04_image/image-linux-31452/kernel-modules-myimx6.tar.bz2
      注意:如果是编译内核时配置文件使用的是 myimx6_defconfig,在这里要把 modules.tar.bz2 复制为 kernel-modules-myimx6.tar.bz2;如果是编译内核时配置文件使用的是 myimx6ul_defconfig,在这里要把 modules.tar.bz2 复制为 kernel-modules-myimx6g.tar.bz2
      Note:when you compile the Kernel If the configuration file you use is myimx6_defconfig, here you should Copy modules.tar.bz2 as kernel-modules-myimx6.tar.bz2.If the configuration file is myimx6ul_defconfig,you should Copy modules.tar.bz2 as kernel-modules-myimx6g.tar.bz2.

      应用程序编译(application compilation)
      Linux应用程序编译(Linux application compilation)编写应用程序(write an application)

      • 创建应用程序的源码目录和Linux-3.14.52的可执行程序目录
      Create application source code directory and Linux-3.14.52 executable program directory
      $ mkdir ~/my-demo/source_code -p

      $ mkdir ~/my-demo/bin-l31452 -p


      • 编写源代码
      write source code
      $ cd ~/my-demo/source_code
      $ vi hello.c
      写入以下代码并保存
      write following code and save
      #include37)]package the module file
      $ cd modules
      $ tar cjf ../modules.tar.bz2 *


      • 复制模块包到镜像目录
      Copy module package to image directory
      评估板型号
      (development board model)
      目标模块包
      (target module package)
      MY-IMX6-EK200kernel-modules-myimx6.tar.bz2
      MY-IMX6-EK314
      MY-IMX6-EK336
      MY-IMX6-EK140kernel-modules-myimx6g.tar.bz2
      $ cp ../modules.tar.bz2 ~/my-imx6/04_image/image-linux-31452/kernel-modules-myimx6.tar.bz2
      注意:如果是编译内核时配置文件使用的是 myimx6_defconfig,在这里要把 modules.tar.bz2 复制为 kernel-modules-myimx6.tar.bz2;如果是编译内核时配置文件使用的是 myimx6ul_defconfig,在这里要把 modules.tar.bz2 复制为 kernel-modules-myimx6g.tar.bz2
      Note:when you compile the Kernel If the configuration file you use is myimx6_defconfig, here you should Copy modules.tar.bz2 as kernel-modules-myimx6.tar.bz2.If the configuration file is myimx6ul_defconfig,you should Copy modules.tar.bz2 as kernel-modules-myimx6g.tar.bz2.

      应用程序编译(application compilation)
      Linux应用程序编译(Linux application compilation)编写应用程序(write an application)

      • 创建应用程序的源码目录和Linux-3.14.52的可执行程序目录
      Create application source code directory and Linux-3.14.52 executable program directory
      $ mkdir ~/my-demo/source_code -p

      $ mkdir ~/my-demo/bin-l31452 -p


      • 编写源代码
      write source code
      $ cd ~/my-demo/source_code
      $ vi hello.c
      写入以下代码并保存
      write following code and save
      #includecom.cn/images/6/68/Myimx6linux3.14_build_6.5.0.3.png[/img][/url]
      • Copy module package to image directory
      Copy module package to image directory
      Evaluation board model(development board model)
      Target module package(target module package)
      MY-IMX6-EK200kernel-modules-myimx6.tar.bz2
      MY-IMX6-EK314
      MY-IMX6-EK336
      MY-IMX6-EK140kernel-modules-myimx6g.tar.bz2
      $ cp ../modules.tar.bz2 ~/my-imx6/04_image/image-linux-31452/kernel-modules-myimx6.tar.bz2 Note:when you compile the Kernel If the configuration file you use is myimx6_defconfig, here you should Copy modules.tar.bz2 as kernel-modules-myimx6.tar.bz2.If the configuration file is myimx6ul_defconfig,you should Copy modules.tar.bz2 as kernel-modules-myimx6g.tar.bz2.
      Create application source code directory and Linux-3.14.52 executable program directory $ mkdir ~/my-demo/source_code -p
      $ mkdir ~/my-demo/bin-l31452 -p
      • Write source code
      write source code $ cd ~/my-demo/source_code $ vi hello.c
      write following code and save #includecom.cn/images/6/68/Myimx6linux3.14_build_6.5.0.3.png[/img][/url]
      • Copy module package to image directory
      Copy module package to image directory
      Evaluation board model(development board model)
      Target module package(target module package)
      MY-IMX6-EK200kernel-modules-myimx6.tar.bz2
      MY-IMX6-EK314
      MY-IMX6-EK336
      MY-IMX6-EK140kernel-modules-myimx6g.tar.bz2
      $ cp ../modules.tar.bz2 ~/my-imx6/04_image/image-linux-31452/kernel-modules-myimx6.tar.bz2 Note:when you compile the Kernel If the configuration file you use is myimx6_defconfig, here you should Copy modules.tar.bz2 as kernel-modules-myimx6.tar.bz2.If the configuration file is myimx6ul_defconfig,you should Copy modules.tar.bz2 as kernel-modules-myimx6g.tar.bz2.
      Create application source code directory and Linux-3.14.52 executable program directory $ mkdir ~/my-demo/source_code -p
      $ mkdir ~/my-demo/bin-l31452 -p
      • Write source code
      write source code $ cd ~/my-demo/source_code $ vi hello.c
      write following code and save #include249)]
      Evaluation board model(development board model)
      Target module package(target module package)
      MY-IMX6-EK200kernel-modules-myimx6.tar.bz2 MY-IMX6-EK314 MY-IMX6-EK336 MY-IMX6-EK140kernel-modules-myimx6g.tar.bz2
      $ cp ../modules.tar.bz2 ~/my-imx6/04_image/image-linux-31452/kernel-modules-myimx6.tar.bz2 Note:when you compile the Kernel If the configuration file you use is myimx6_defconfig, here you should Copy modules.tar.bz2 as kernel-modules-myimx6.tar.bz2.If the configuration file is myimx6ul_defconfig,you should Copy modules.tar.bz2 as kernel-modules-myimx6g.tar.bz2 1. Create application source code directory and Linux-3.14.52 executable program directory $ mkdir ~/my-demo/source_code -p
      $ mkdir ~/my-demo/bin-l31452 -p
      • Write source code
      write source code $ cd ~/my-demo/source_code $ vi hello.c
      write following code and save #include249)] [tr][td]
      Evaluation board model(development board model)
      [/td][td]
      Target module package(target module package)
      [/td][/tr] [tr][td]MY-IMX6-EK200[/td][td=1,3]kernel-modules-myimx6.tar.bz2[/td][/tr] [tr][td]MY-IMX6-EK314[/td][/tr] [tr][td]MY-IMX6-EK336[/td][/tr] [tr][td]MY-IMX6-EK140[/td][td]kernel-modules-myimx6g.tar.bz2[/td][/tr] [/table]
      $ cp ../modules.tar.bz2 ~/my-imx6/04_image/image-linux-31452/kernel-modules-myimx6.tar.bz2 Note:when you compile the Kernel If the configuration file you use is myimx6_defconfig, here you should Copy modules.tar.bz2 as kernel-modules-myimx6.tar.bz2.If the configuration file is myimx6ul_defconfig,you should Copy modules.tar.bz2 as kernel-modules-myimx6g.tar.bz2 1. Create application source code directory and Linux-3.14.52 executable program directory $ mkdir ~/my-demo/source_code -p
      $ mkdir ~/my-demo/bin-l31452 -p
      • Write source code
      write source code $ cd ~/my-demo/source_code $ vi hello.c
      write following code and save #include52安装modules.tar.bz2。
      Application compilation
      Linux application compilationWrite an application
      • Create application source code directory and Linux-3.14.52 executable program directory $ mkdir ~/my-demo/source_code -p
      $ mkdir ~/my-demo/bin-l31452 -p
      • Write source code
      write source code $ cd ~/my-demo/source_code $ vi hello.c
      write following code and save #include52安装modules.tar.bz2。
      Application compilation
      Linux application compilationWrite an application
      • Create application source code directory and Linux-3.14.52 executable program directory $ mkdir ~/my-demo/source_code -p
      $ mkdir ~/my-demo/bin-l31452 -p
      • Write source code
      write source code $ cd ~/my-demo/source_code $ vi hello.c
      write following code and save #include

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

        return;
      }

      • 查看代码
      view code

      $ cat hello.c
      编译应用程序(compife application)

      • 配置环境变量
      Configure environment variables
      $ source ~/my-imx6/03_tools/gcc-linaro-arm-linux-gnueabihf-492-env


      • 编译
      compife
      $ ${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.。

      • 目标文件
      target file
      $ file hello.out

      可以看到目标文件 hello.out 的属性。
      you can see the property of target file hello.out。

      保存目标可执行文件(save target executable file)
      $ mv hello.out ~/my-demo/bin-l31452/


      QT应用程序编译 (QT application compife)准备QT5程序代码(prepare QT5 program code)
      提示:这里我们使用“Qt5_NMap_CarouselDemo_1.0.tgz”进行演示。
      Tips:Here We demonstrate with “Qt5_NMap_CarouselDemo_1.0.tgz".
      1)将代码包复制到Linux开发主机
      copy code package to Linux development host
      将代码包“Qt5_NMap_CarouselDemo_1.0.tgz”复制到“~/my-demo/source_code”。
      copy code package“Qt5_NMap_CarouselDemo_1.0.tgz" to "~/my-demo/source_code". This step is completed by yourself. complete this step by yourself in a proper way.
      2) Decompress code package decompress code package $ cd ~/my-demo/source_code $ tar zxf Qt5_NMap_CarouselDemo_1.0.tgz
      Compile QT5 application(compile QT5 application)
      Tips: We compile with commands. 1)Enter the code directoryenter code directory Tips: first we decompress code package "Qt5_NMap_CarouselDemo_1.0.tgz"to"~/my-demo/source_code". $ cd ~/my-demo/source_code/Qt5_NMap_CarouselDemo_1.0/
      2) Check QMake check QMake $ qmake –v If the current terminal outputs "QMake version 3.0" after executing the command, it means that the cross-compilation tool is configured normally. , 37)]3)Generate Makefile create Makefile $ qmake [color=rgb(11, 0, you can see an extra Makefile with ls after execution of qmake you can see an extra Makefile with ls after execution of qmake
      4)Compile compile $ make
      5) Target file target file
      • Executable file
      target file $ file Qt5_NMap_CarouselDemo
      • Resource file
      source file Running QT5 needs the corresponding qml file and content Running QT5 needs the corresponding qml file and content
      Save target executable file
      Because running QT5 program requires qml file and content file, here We copy the entire directory to the target directory for simplicity. $ cp ../Qt5_NMap_CarouselDemo_1.0 ~/my-demo/bin-l31452/ -a
      Application packaging(package application)Instructions(instruction)
      The burning tool supports burning the file package “my-demo.tar.xz” to the evaluation board. 1) Package package Here we package the whole my-demo directory. $ cd ~ $ tar cjf my-demo.tar.bz2 my-demo Copy application package as target programming file $ cp my-demo.tar.bz2 ~/my-imx6/04_image/image-linux-31452/
      target programming file
      So far,we get a set of programming file except file system from“~/my-imx6/04_image/image-linux-31452/”. including“uboot*.imx”,myimx6*.dtb”,zImage-myimx6”,kernel-modules.tar.bz2”,my-demo.tar.bz2”,So far,we get a set of programming file except file system from“~/my-imx6/04_image/image-linux-31452/”. including“uboot*.imx”,myimx6*.dtb”,zImage-myimx6”,kernel-modules.tar.bz2”,my-demo.tar.bz2”,Now we can program the image we compiled by ourselves referring to programming manual.
      Run application on the evaluation board
      After burning the system, power on the evaluation board again, log in to the system and execute the following commands. : After the burning, supply power for evaluation board,login system and execute commands below.
      • /home/root/my-demo/bin-l31452/hello.out
      • export DISPLAY=:0
      • /home/root/my-demo/bin-l31452/Qt5_NMap_CarouselDemo_1.0/Qt5_NMap_CarouselDemo
      Appendix: file system compilation
      Notes and instructions: 1) The download amount during the original compilation process will exceed 4G. (Hint: You can use some of the files we downloaded to reduce the download amount and save time, which will be mentioned in 7.4). The download of the original compilation exceed 4G. (tips: you can use files we have downloaded in order to reduce downloads and save time, which is going to be mentioned in 7.4). 2) The network connection of the compilation host should preferably use a network that can access www.fackbook.com, otherwise it may be restricted by the domestic firewall and unable to download the software packages required for compilation. 3)The initial compilation may take 2 hours to unlimited time.It depends on the network state and the configuration of the host.(After a rough statistics, It took about 100 minutes to compile QT5 system on the 16-core CPU 16 G memory host except download time。) Customers are requested to decide whether to compile the file system by themselves or use the file system provided by us according to the actual situation. If the file system we provide meets the requirements, it is recommended not to compile by yourself, because the compilation process may cause many errors. Customer may decide whether to compile the file system or use the file system We provide based on the actual situation. If the file system we provide meets the requirements, you had better not to compile by yourself. Since It may be a lot of errors during compilation.
      Prepare for compilationInstall software package
      Instruction, Yocto compilation relies on some software package. So you need to Install them on the host. $ sudo apt-get install gawk wget git-core diffstat unzip texinfo \ gcc-multilib build-essential chrpath socat
      $ sudo apt-get install libsdl1.2-dev xterm sed cvs subversion \
      coreutils texi2html docbook-utils python-pysqlite2 help2man make gcc \
      g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev mercurial \
      autoconf automake groff curl lzop asciidoc

      $ sudo apt-get install uboot-mkimage


      准备源码(prepare source code)
      1)下载源码
      download source code
      在网盘中下载 yocto__imx-3.14.52-1.1.0_ga.tar.xz
      from network disk download yocto__imx-3.14.52-1.1.0_ga.tar.xz
      2)创建工作目录
      create working directory
      $ mkdir ~/yocto

      3)将源码包复制到工作目录
      Copy source code package to working directory
      复制“yocto__imx-3.14.52-1.1.0_ga.tar.xz”到“~/my-imx6/02_source”。
      copy“yocto__imx-3.14.52-1.1.0_ga.tar.xz”to“~/my-imx6/02_source”。
      这一步骤自己采取相应的方式进行
      complete this step by yourself in a proper way
      4) 解压源码包
      decompress source code package
      $ cd ~/yocto/
      $ tar xf yocto__imx-3.14.52-1.1.0_ga.tar.xz


      准备编译需要的软件包(Prepare software package required for compilation)
      提示1:如果自己网络状况好且能访问境外网站,可以跳过这一节内容。
      tips1:If you have a good network and can access a foreign website ,you can skip this section.
      提示2:如果是使用我们下载好的一些包,请继续往下。
      tips2:If you use the package we have downloaded, please go on to the next step.
      提示3:限于网络上传速度的影响及软件包的更新,我们下载的软件包目录中可能不包括

      编译需要的全部软件包,但是编译中缺少的软件包编译程序会在编译过程中自行下载。
      tips3:As a result of the upload speed and the update of software package , the software package directory we downloaded may not include all the required software packages for compilation.But the compiler package that is missing from compilation will be downloaded on its own during compilation process.1) Download software packagedownload software package Download downloads folder on the network disk(Path: MYZR-通用资源/yocto/downloads. Currently, the folder size is 6~8G). 2) Copy software package to BSP directory copy software package to BSP directory move downloads to “~/yocto/imx-3.14.52-1.1.0_ga” directory complete this step by yourself in a proper way.
      Compilation(compilation)Update BSP(update BSP)
      $ cd ~/yocto/imx-3.14.52-1.1.0_ga/
      $ ./bin/repo sync
      Compilation configuration (compilation configuration)
      $ DISTRO=fsl-imx-x11 MACHINE=imx6qsabresd source fsl-setup-release.sh -b build-x11 After executing the command,the terminal will receive the output message, keep pressing "space" ,enter "y" in the final dialog
      Example: Do you accept the EULA you just read? (y/n) y example: Do you accept the EULA you just read? (y/n) y
      Compile QT5 file system
      1) Execute compilation commandexecute compilation command $ bitbake fsl-image-qt5
      2)Target filetarget file $ ls ./tmp/deploy/images/imx6qsabresd/fsl-image-qt5-imx6qsabresd.tar.bz2
      3) Copy target filecopy target file The QT5 system file we burned is named "distro-fsl-image-qt5.tar.bz2", so you need to copy the compiled file system to "distro-fsl-image-qt5.tar.bz2". The QT5 file system name we programmed is “distro-fsl-image-qt5.tar.bz2”, So we need to copy the compiled file as “distro-fsl-image-qt5.tar.bz2”. $ cp ./tmp/deploy/images/imx6qsabresd/fsl-image-qt5-imx6qsabresd.tar.bz2 ~/my-imx6/04_image/image-linux-31452/distro-fsl-image-qt5.tar.bz2
      Compile Linux file system
      1)Execute compile commandexecute compile command $ bitbake fsl-image-machine-test
      2)Target filetarget file $ ls ./tmp/deploy/images/imx6qsabresd/fsl-image-machine-test-imx6qsabresd.tar.bz2
      3) Copy target filecopy target file The QT5 system file we burned is named "distro-fsl-image.tar.bz2", so you need to copy the compiled file system to "distro-fsl-image.tar.bz2". The QT5 file system name We programmed is “distro-fsl-image.tar.bz2”, So we need to copy the compiled file as “distro-fsl-image.tar.bz2” $ cp ./tmp/deploy/images/imx6qsabresd/fsl-image-machine-test-imx6qsabresd.tar.bz2 ~/my-imx6/04_image/image-linux-31452/distro-fsl-image.tar.bz2
      Compile the cross-compiler tool for QT5
      If you do not need a customized QT5 cross-compiler tool, skip this section. If you do not need to customize QT5 cross-compiler tool ,skip this section.
      1) Execute compilation commandexecute compilation command $ bitbake meta-toolchain-qt5
      2) Target filetarget file You can find the target file we compiled in the “./tmp/deploy/sdk/” directory.
      3) Save target file 4)Install QT5 cross-compiler toolInstall QT5 cross-compiler tool if you need to use QT5 cross-compiler tool compiled by yourself, you have to remove QT5 cross-compiler tool which has been already Installed. Install it referring to the "Install QT5 cross-compile tool" of "Install and Configure cross-compile tool chain."
This post is from ARM Technology

Latest reply

Thumbs up!!!  Details Published on 2018-4-28 09:47
 

1903

Posts

0

Resources
2
 
Shared very carefully
This post is from ARM Technology
 
 
 

253

Posts

0

Resources
3
 
I hope that all customers who use IMX6 products will have smooth sailing!
This post is from ARM Technology
 
 
 

95

Posts

0

Resources
4
 
Thumbs up!!!
This post is from ARM Technology
 
 
 

253

Posts

0

Resources
5
 
We look forward to more users paying attention to our products
This post is from ARM Technology
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list