1863 views|0 replies

253

Posts

0

Resources
The OP
 

MYZR IMX6-CB200 Manual [Copy link]

: 3.0.35 version code(3.0.35 version code)u-boot source code(u-boot source code)
File name: u-boot-2009.08--svn*.tar.xz name of file:u-boot-2009.08--svn*.tar.xz
kernel source code(kernel source code)
File name: linux-3.0.35--svn*.tar.xz name of file:linux-3.0.35--svn*.tar.xz
Cross compifer tool
File name: gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.bz2 name of file:gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.bz2
Configuration of compifer environment
Prepare source codePrepare source code package
1) Create a working directorycreate working directory Create ~/my-imx6 as working directorycreate ~/my-imx6 as working directory
$ mkdir ~/my-imx6
Create ~/my-imx6/02_source/imx_3.0.35_4.1.0 as the source code directory create ~/my-imx6/02_source/imx_3.0.35_4.1.0 as source code directory
$ mkdir ~/my-imx6/02_source/imx_3.0.35_4.1.0 -p
Create ~/my-imx6/03_tools as tool directory create ~/my-imx6/03_tools as tool directory
$ mkdir ~/my-imx6/03_tools -p
2)Copy source code package to the development host copy source code package to the development host do it in this step in your own way. Tip: here copy “02_source code” from network disk to “~/my-imx6/02_source/imx_3.0.35_4.1.0” of Linux development host, and copy “03_tools/toolchain” from network disk to “~/my-imx6/03_tools” of Linux development host. tip: this step is to copy “02_source code”from network disk to “~/my-imx6/02_source/imx_3.0.35_4.1.0” of Linux development host.0”in development host,and copy “03_tool/toolchain”to “~/my-imx6/03_tools”。in development host

解压源码包 (decompress source code package)
1)解压u-boot源码和内核源码
decompress u-boot source code and kernel source code
$ cd ~/my-imx6/02_source/imx_3.0.35_4.1.0
$ tar xf u-boot-2009.08--svn*.tar.xz
$ tar xf linux-3.0.35--svn*.tar.xz

2)解压交叉编译工具
decompress cross compiler tool
$ cd ~/my-imx6/03_tools/
$ tar jxf gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.bz2


开发环境配置(development environment configuration)安装需要的包 (install package needed)
1)更新源列表
list of updated source
$ sudo apt-get update

更新完成后如下图所示:
after update,it will look like below:

2)安装aptitude包管理工具和ia32-libs
install aptitude package management tool and ia32-libs
提示:如果编译主机的Linux是32位的,可以跳过此步骤。
tips:if Linux of compiler host is 32bit,you can skip this step。

  • 安装aptitude包管理工具
install aptitude package management tool

$ sudo apt-get –y install aptitude
  • Install ia32-libs with aptitude
install ia32-libs with aptitude
$ sudo aptitude –y install ia32-libs Tip: The following figure is a screenshot of the installation command executed again after aptitude and ia32-libs have been installed. tips: following is the screenshots with re-execution of installation command after installation of aptitude and ia32-libs is finished.
3) Install mkimage tool install mkimage tool
$ sudo apt-get -y install uboot-mkimage Tips: The following is the screenshots with re-execution of installation command after installation of mkimage tool is finished. tips:following is the screenshots with re-execution of installation command after installation of mkimage tool is finished. 4)Install ncurses-dev install ncurses-dev Instruction: make menuconfig is dependent on it. instruction: make menuconfig is dependent on it. $ sudo aptitude -y install ncurses-dev
tips:following is the screenshots with re-execution of installation command after installation of ncurses-dev tool is finished。 1) Write platform information to a new configured file
$ echo "export ARCH=arm" > ~/my-imx6/03_tools/myimx6_3035_build_env
2)Write compiler tool chain path to configured file
  • Enter cross compiler tool directory
enter cross compiler tool directory $ cd ~/my-imx6/03_tools/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/
  • Write path to configured file
    write path to configured file
    $ sed -i "\$a IMX6_GCC462_PATH=$PWD" ~/my-imx6/03_tools/myimx6_3035_build_env
    • Write cross-compilation tool to configuration file
    37)]write cross compiler tool to configured file
    $ sed -i "\$a export CROSS_COMPILE=\$IMX6_GCC462_PATH/arm-none-linux-gnueabi-" ~/my-imx6/03_tools/myimx6_3035_build_env
    3) View the configuration file view configured file
    $ cat ~/my-imx6/03_tools/myimx6_3035_build_env
    4) Figures attached
    Note: if an error occurs in any step, you need to delete ~/my-imx6/03_tools/myimx6_3035_build_env ,and operate again all steps of this segment.
    Compile u-boot(compile u-boot)
    Enter u-boot source code directory (enter u-boot source code directory)
    $ cd ~/my-imx6/02_source/imx_3.0.35_4.1.0/u-boot-2009.08/
    Validate configured file
    • Execute source command
    execute source command
    $ source ~/my-imx6/03_tools/myimx6_3035_build_env
    • View compilation configuration
    view compiler configuration
    $ echo $ARCH $ echo $CROSS_COMPILE
    Tips:you can see that ARCH and CROSS_COMPILE is configured
    • Verify the cross-compilation tool configuration
    verify cross compiler tool configuration
    $${CROSS_COMPILE}gcc –v Tip: After executing the command, you can see that the terminal displays the version information of the cross-compilation tool. As shown below: tips: you can see version information of cross compiler tool shown on terminal after execution of command.as below:
    Clear u-boot configuration (remove u-boot configuration)
    $ make distclean
    u-boot configuration(u-boot configuration)
    • Evaluation board and corresponding u-boot compilation configuration:
    evaluation board and its corresponding u-boot compiler configuration:
    6Q (quad core) - 2G (6Q (quad core) - 2G)
    Evaluation board main model
    CPU type-memory capacity
    Corresponding u-boot configuration
    MY-IMX6-EK2006Q (quad. core) - 1G (6Q (quad. core) - 1G)myimx6ek200_6q_config
    myimx6ek200_6q_2g_config
    6U (dual core tile) - 1G (6U (dual core tile) - 1G) myimx6ek200_6u_config
    6S (single core) - 512M (6S (single core) - 512M) myimx6ek200_6s_config
    MY-IMX6-EK314 6Q (quad core) - 1G (6Q (quad.core) - 1G)myimx6ek314_6q_config
    6Q (quad core) - 2G (6Q (quad.core) - 2G)myimx6ek314_6q_2g_config
    6U (dual core tile) - 1G (6U (dual core tile) - 1G)myimx6ek314_6u_config
    6S (single core) - 512M (6S (single core) - 512M)myimx6ek314_6s_config
    • MYIMX6EK200-6Qxx-1G configuration example:
    MYIMX6EK200-6Qxx-1G configuration example:
    $ make myimx6ek200_6q_config
    Compile(compilation)
    • Execute compilation
    execute compilation
    $ make Tip: In order to increase the compilation speed, “-j4” is added after 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. 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 Tips: The u-boot compilation process will take a few minutes. tips: The u-boot compilation process will take a few minustes or so. you can get the compiled file u-boot.bin with ls command after compilation 1. Compile kernel
    Enter kernel source directory directory)
    $ cd ~/my-imx6/02_source/imx_3.0.35_4.1.0/linux-3.0.35/
    Validate configured file
    • Execute source command
    execute source command
    $ source ~/my-imx6/03_tools/myimx6_3035_build_env [img=642,28]http://wiki.myzr.com.view compiler configuration
    • Verify cross compiler tool configuration
    verify cross compiler tool configuration
    $ ${CROSS_COMPILE}gcc –v
    Tip: After executing the command, you can see that the terminal displays the version information of the cross-compilation tool. As shown below: tips: you can see version information of cross compiler tool shown on terminal after execution of command.as below:
    Prepare for kernel configuration
    • Clear kernel configuration
    remove kernel configuration
    $ make distclean
      , 37, 37)] 128)]
    Compile kernel
    • Compile uImage
    compile uImage $ make uImage
    Instruction: 4 threads compilation is used in the screenshots. instruction: 4 threads compilation is used in the screenshots.
    • Compilation completed
    complete compilation
    • Target file
    target file
    arch/arm/boot/uImage is the target file through compilation, you can view the file information with ls command. arch/arm/boot/uImage is the target file through compilation, you can view the file information with ls command.
    $ ls arch/arm/boot/uImage –la
    compile module
    • Compile
    compile
    $ make Instruction: 4 threads compilation is used in the screenshots. instruction: 4 threads compilation is used in the screenshots.
    • Compilation completed
    complete compilation
    • Target file
    target file After compilation, the .ko file of each module is in the directory where code is located. You can find the module compiled with find command. The reference command is as follows: .ko file of each module is in the directory where code is located after compilation, you can find the module compiled with find command after compilation, referring command as below: $ find -name *.ko
    Linux application compilation
    Write application
    1) Create application directorycreate application directory
    $ mkdir ~/my-imx6/02_source/application/ -p $ cd ~/my-imx6/02_source/application/
    2) Write application (here take hello.c as example) write application (here take hello.c as example create hello.c and write following code and save:
    • include
    int main(int argc, char **argv)
    {
       printf("Hello, MYZR!\n");
       
       return;
    }
    3) 查看代码
    view code
    $ cat hello.c


    使编译配置文件生效(validate compiler configured file)

    • 执行source命令
    execute source command
    $ source ~/my-imx6/03_tools/myimx6_3035_build_env


    • 查看编译配置
    view compiler configuration
    $ echo $ARCH
    $ echo $CROSS_COMPILE
    提示:可看到ARCH和CROSS_COMPILE被设置
    tips:you can see that ARCH和CROSS_COMPILE is configured


    • 验证交叉编译工具配置
    verify cross compiler tool configuration
    $ ${CROSS_COMPILE}gcc –v
    提示:执行命令后可以看到终端显示出交叉编译工具的版本信息。如下图:
    tips:you can see version information of cross compiler tool shown on terminal after execution of command.as below:


    编译应用程序 (compile application)
    2) 编译
    compile
    $ ${CROSS_COMPILE}gcc hello.c -o hello.out
    注意:上面的命令有包含“$”号,即“${CROSS_COMPILE}gcc”,是引用我们source时产生的环境变量。
    note:the above commands contain charater“$”,e.g“${CROSS_COMPILE}gcc”,which is the environment variable generated when referring to our source。

    3) 查看目标文件类型
    view type of target file
    $ file hello.out you can get the property of target file hello.out. The file system package is located in the mirror folder corresponding to the network disk. The file system package is located in the image file folder in the network disk. As to type of file system supported and way of download please refer to《MY-IMX6 buring guide》. 1)Create directory of file system and entercreate directory of file system and enter$ mkdir ~/my-imx6/04_rootfs/ -p $ cd ~/my-imx6/04_rootfs/
    2)Copy file system to ~/my-imx6/04_rootfs/directory copy file system to ~/my-imx6/04_rootfs/directory this step sbould be done in your own way 3)Decompress file system to specified directory $ mkdir rootfs $ sudo tar jxf rootfs-linux.tar.bz2 -C rootfs
    Add application to file system (add application to file system)
    $ cp ~/my-imx6/02_source/application/hello.out rootfs/app_test/
    5)Re-pakcage file system $ rm -rf rootfs-linux.tar.bz2 $ cd rootfs/ $ sudo tar cjf ../rootfs-linux.tar.bz2 *
    Add module to file system(add module to file system)
    Prepare .ko file of module needed,as to other operations please refer to“add application to file system”.

This post is from ARM Technology
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

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