imxq Freescale Yocto Project编译记录

参考: IMX6Q环境搭建、安装Yocto包和编译

编译内核

  • 配置menuconfig指令:
    bitbake -c menuconfig -v linux-imx
  • 单独编译kernel、模块、设备树
    bitbake -c compile -f -v linux-imx
    bitbake linux-imx -c compile_kernelmodules -f -v
    bitbake -c deploy -f -v linux-imx
  • 若要编译文件系统则用下面总指令
    bitbake core-image-minimal
  • 单独编译u-boot
    bitbake -c compile -f -v u-boot-imx
    bitbake -c deploy -f -v u-boot-imx

下面是使用Ubuntu 16.04 编译3.10.53版本遇到的ERROR:
1.

| In file included from /home/okletsgo/work/tmp/fsl-release-bsp/build/tmp/work/x86_64-linux/ncurses-native/5.9-r15.1/ncurses-5.9/ncurses/curses.priv.h:283:0,
|                  from ../ncurses/lib_gen.c:19:
| _15038.c:1364:15: error: expected ')' before 'int'
| ../include/curses.h:1906:56: note: in definition of macro 'mouse_trafo'
|  #define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)

解决: 解决从源码编译ncurses6.0编译lib_gen.c报错的问题
搜索 curses.tail 文件. 将该文件中的注释"/* generated /"删除.
extern NCURSES_EXPORT(bool) mouse_trafo (int
, int*, bool); /* generated */
然后删除文件curses.h, 再编译.

argp-help.o: In function `argp_fmtstream_write':
argp-help.c:(.text+0x1df0): multiple definition of `argp_fmtstream_write'
argp-fmtstream.o:argp-fmtstream.c:(.text+0x7a0): first defined here
argp-help.o: In function `argp_fmtstream_puts':
argp-help.c:(.text+0x1e40): multiple definition of `argp_fmtstream_puts'
argp-fmtstream.o:argp-fmtstream.c:(.text+0x860): first defined here
argp-help.o: In function `argp_fmtstream_putc':
argp-help.c:(.text+0x1eb0): multiple definition of `argp_fmtstream_putc'
argp-fmtstream.o:argp-fmtstream.c:(.text+0x800): first defined here

原因: argp-fmtstream.h 中 #define ARGP_FS_EI extern inline
extern inline在GNU89和C99标准中用法不同,这里使用GNU89标准编译
解决:
vim /home/okletsgo/work/tmp/fsl-release-bsp/build/tmp/work/x86_64-linux/cross-localedef-native/2.20-r0/build/Makefile
添加编译参数 -std=gnu89
可以将cross-localedef-native提取出来编译, 生成argp-fmtstream.o argp-help.o后替换进去

其他:


linux源码:/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.10.53-r0/git

设备树:/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.10.53-r0/git/arch/arm/boot/dts

u-boot源码:/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/work/imx6qsabresd-poky-linux-gnueabi/u-boot-imx/2014.04-r0/git

rootfs:/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/work/imx6qsabresd-poky-linux-gnueabi/fsl-image-gui/1.0-r0/rootfs

cross-gcc-4.8.2: /media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/sysroots/x86_64-linux/usr/bin/cortexa9-vfp-neon-poky-linux-gnueabi

u-boot单独编译:

vim build_u-boot.sh
#!/bin/bash

export ARCH=arm
export CROSS_COMPILE=/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/sysroots/x86_64-linux/usr/bin/cortexa9-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi- 
export CC="/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/sysroots/x86_64-linux/usr/bin/cortexa9-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/sysroots/imx6qsabresd"
make mx6qsabresd_config
make CC="$CC"
./build_u-boot.sh

设备树单独编译:

export ARCH=arm
export CROSS_COMPILE=/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/sysroots/x86_64-linux/usr/bin/cortexa9-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi- 
export CC="/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/sysroots/x86_64-linux/usr/bin/cortexa9-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/sysroots/imx6qsabresd"
make imx6q-sabresd.dtb

kernel单独编译:

export ARCH=arm
export CROSS_COMPILE=/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/sysroots/x86_64-linux/usr/bin/cortexa9-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi- 
export CC="/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/sysroots/x86_64-linux/usr/bin/cortexa9-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/sysroots/imx6qsabresd"
make imx_v7_defconfig
make zImage -j4 CC="$CC"

使用mfg-tools烧写镜像时, USB_OTG_ID脚要拉低, 否则会显示"No device Connected"


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值