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