当前位置:网站首页>imx6 yocto编译备忘
imx6 yocto编译备忘
2022-08-11 05:14:00 【Cupid99】
1、Git把源码下到fsl-release-bsp后,配置编译选项:
$DISTRO=fsl-imx-fb MACHINE=imx6qsabresd source fsl-setup-release.sh -b build-fb
-b 可以指定你要将文件编译到哪个目录
2、全编译:
在build-fb目录下执行:
$bitbake core-image-base
编译出来的image在 fsl-releases-bsp/build-fb/tmp/deploy/images/imx6qsabresd目录下,包括的u-boot zImage rootfs。如不小心删掉了deploy/images/imx6qsabresd下的文件,想重新生成,执行如下步骤:
$bitbake -c cleanall core-image-base
$bitbake -c compile -f u-boot-imx
$bitbake -c deploy -f u-boot-imx //部署生成的u-boot镜像到deploy/images/imx6qsabresd
$bitbake -c compile -f linux-imx
$bitbake -c deploy -f linux-imx //部署生成的内核镜像到deploy/images/imx6qsabresd
$bitbake core-image-base //生成rootfs到deploy/images/imx6qsabresd
如有报错:
1)ERROR: Task 4 (.../fsl-release-bsp/sources/meta-fsl-bsp-release/imx/meta-bsp/recipes-bsp/u-boot/u-boot-imx_2015.04.bb, do_compile) failed with exit code '1'
是因之前有修改uboot配置,只须再把uboot重新配置:
$echo "UBOOT_CONFIG = \"emmc\"" >> conf/local.conf
2)执行compile -f linux-imx报错:
.../fsl-release-bsp/build-fb/tmp/work-shared/imx6qsabresd/kernel-source is not clean, please run 'make mrproper'
则按提示的路径直接cd到kernel-source,执行make mrproper即可。
3、U-Boot配置:
$cd build-fb
$echo "UBOOT_CONFIG = \"emmc\"" >> conf/local.conf
$MACHINE=imx6qsabresd bitbake -c deploy u-boot-imx
4、生成toolchain:
$cd build-fb
$bitbake meta-toolchain
5、安装toolchain:
$cd tmp/deploy/sdk
$./fsl-imx-fb-glibc-i686-meta-toolchain-cortexa9hf-vfp-neon-toolchain-4.1.15-1.2.0.sh
Freescale i.MX Release Distro SDK installer version 4.1.15-1.2.0
================================================================
Enter target directory for SDK (default: /opt/fsl-imx-fb/4.1.15-1.2.0): (回车,选择默认安装路径)
The directory "/opt/fsl-imx-fb/4.1.15-1.2.0" already contains a SDK for this architecture.
If you continue, existing files will be overwritten! Proceed[y/N]? y
[sudo] password for test01:
Extracting SDK.................done
Setting it up...done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
$ . /opt/fsl-imx-fb/4.1.15-1.2.0/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
6、安装完成后根据提示配置环境变量:
$. /opt/fsl-imx-fb/4.1.15-1.2.0/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
然后就可在源码文件夹独立编译:
1)uboot源码:fsl-releases-bsp/build-fb/tmp/work/imx6qsabresd-poky-linux-gnueabi/u-boot-imx/2015.04-r0/git
$make mx6qsabresd_defconfig
$make
2)kernel源码:fsl-releases-bsp/build-fb/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/4.1.15-r0/git
imx6q的默认配置defconfig文件在:
fsl-release-bsp\sources\meta-fsl-arm\recipes-kernel\linux\linux-fslc-mx6
可将其拷贝到内核文件夹,在menuconfig中将其load后save到.config中(load前一定要先执行toolchain的环境变量导入,否则会加载失败),再编译:
$export ARCH=arm
$make zImage
*另:完成第6步后,可单独编译测试用的*.c代码:
$echo $CC
arm-poky-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=/opt/fsl-imx-fb/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
可见CC中已配好相关的编译选项,所以用以下命令编译写的测试hello.c:
$ $CC -o hello hello.c
生成的二进制文件属性:
$file hello
hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=b5885ce459ae1de3413051cdeb8e912d5f510f9a, not stripped
边栏推荐
- curl 命令调用接口demo
- Keras与tensorflow 使用基础
- 阿里天池学习赛 新闻文本分类
- Golden Warehouse Database KingbaseGIS User Manual (6.8. Geometry Object Input Function)
- 判断一个字符串是否为空,如果为空,对其赋值,如果不为空,获取字符的个数并打印第一个字符
- IDEA中配置checkstyle
- HAVE FUN | “SOFA 星球”飞船计划、源码解析活动最新进展
- oracle tablespace and user creation
- PyTorch显存机制分析
- [ARM] rk3399 mounts nfs error
猜你喜欢

C language antithesis: who is the murderer!

玩转mysql之查看mysql版本号

阿里云无法远程连接数据库MySQL错误码10060解决办法_转载

Redis-数据类型(基本指令、String、List、Set、Hash、ZSet、BitMaps、HyperLogLog、GeoSpatial)/发布和订阅

tensorflow代码翻译成pytorch代码 -详细教程+案例

代码在线审查(添加网页批注)的实现

BGP Comprehensive Experiment

MySQL must know and must know (primary articles)

(二)Docker安装Redis实战(持久化AOF和RDB快照)

【嵌入式开源库】MultiTimer 的使用,一款可无限扩展的软件定时器
随机推荐
arraylist之与linkedlist
4 Module 3: Literature Reading and Research Methods
【Cron】学习:cron 表达式
curl 命令调用接口demo
redis分布式锁
Core Data 多线程设计
[Untitled] 2022 Amination Process Exam Questions Mock Exam Question Bank and Online Mock Exam
redis连接idea
[No 2022 Shanghai Security Officer A Certificate Exam Question Bank and Mock Exam
Thymeleaf
(三)性能实时监控平台搭建(Grafana+Prometheus+Node_explorer+Jmeter)
报表控件Stimulsoft报告中的数据矩阵条形码介绍
2022 coal mine gas inspection test, simulation test question and answer
Use Adobe genuine software for prostitution to reduce the slow employment and non-employment of fresh graduates
IDEA使用记录
redis集群模式--解决redis单点故障
实战noVNC全过程操作(包含遇到的问题和解决)
CentOS7静默安装Oracle11g_转载
四大函数式接口
Django--20实现Redis支持、上下文以及上下文和接口的交互