zephyr qemu环境搭建

zephyr qemu cm3 环境搭建记录

因为有一些工具之前已经安装所以没有完全按照文档所说的如下方式

sudo apt install --no-install-recommends git cmake ninja-build gperf \
  ccache dfu-util device-tree-compiler wget \
  python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
  make gcc gcc-multilib

zephyr 在编译时候提示本机cmake 和dtc 的版本较低

-->重新下载高版本cmake 配置环境变量export PATH=~/cmake-3.14.7/bin:$PATH

-->dtc 需要apt-get remove device-tree-compiler 卸载后,下载https://launchpad.net/ubuntu/+source/device-tree-compiler/1.4.7-3ubuntu2 deb包安装

安装arm none 交叉编译器

-->sudo apt-get install gcc-arm-none-eabi  默认会安装在/usr/bin路径下

CMake was unable to find a build program corresponding to "Ninja"

-->sudo apt-get install nijia-build

最终的~/.zephyrrc 的内容有

  export PATH=~/backup/cmake-3.14.7/bin:$PATH
  export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
  export GNUARMEMB_TOOLCHAIN_PATH=/usr
  unset ZEPHYR_SDK_INSTALL_DI

执行hello world samples 的编译和运行命令,中间如果有出错记得rm -rdf build 删掉缓存cmake文件

pip3 install --user -U west

west init zephyrproject

cd zephyrproject

west update
//代码抓取完成

source zephyr_env.sh

cd smaples/helloworld

west build -b qemu_x86 samples/hello_world

west build -t run

==========================================================================

zephyr 环境搭建wiki: https://docs.zephyrproject.org/latest/getting_started/index.html

zephyr 官方网站: https://docs.zephyrproject.org/latest/

中文微信公众号: ZephyrProject

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

shenhuxi_yu

感谢投币,继续输出

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值