Zephry:编译
配置
# 下载源代码
git clone https://gitee.com/coollh/zephyr.git
# 下载SDK
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.8/zephyr-sdk-0.16.8_linux-x86_64.tar.xz
# 进入 sdk 目录,setup
tar xvf zephyr-sdk-0.16.8_linux-x86_64.tar.xz
cd zephyr-sdk-0.16.8/
./setup.sh
# 加入环境变量到 zephyr-env.sh
export ZEPHYR_GCC_VARIANT=zephyr
export ZEPHYR_SDK_INSTALL_DIR=../zephyr-sdk-0.16.8 ## Zephyr SDK 安装路径
export ZEPHYR_BASE=. ## Zephyr 源码路径
# source 环境变量文件
source zephyr-env.sh
# 安装依赖的库
pip3 install --user -r ~/zephyr/scripts/requirements.txt
编译并在qemu-x86上仿真运行 hello-world
cd zephyr/samples/hello_world/
mkcd build
cmake -GNinja -DBOARD=qemu_x86 ..
ninja # build
ninja run # build and run