zephyr windos编译环境安装
1、安装choco工具
1)以管理员身份打开Dos cmd 命令窗口
2)复制如下命令回车
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
安装完成,输入”choco /?” 可查看使用说明及版本信息
2、zephy 环境设置(http://docs.zephyrproject.org/getting_started/installation_win.html)
在命令窗口中依次输入如下命令:
1)choco feature enable -n allowGlobalConfirmation
2)choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
3)choco install git python ninja dtc-msys2 gperf
如果出现ninja 安装失败便手动安装
https://github.com/ninja-build/ninja/releases 下载 ninja-win.zip, 解压到C:\ProgramData\chocolatey\bin 路径下
命令窗口输入ninja --version
4) 下载zephyr 源码
git clone https://github.com/zephyrproject-rtos/zephyr.git
cd zephyr
pip install --user -r scripts/requirements.txt
pip install --user -r scripts/py2-requirements.txt
3、安装GNU ARM Embedded 到 c:\gccarmemb
4、编译
set ZEPHYR_TOOLCHAIN_VARIANT=gccarmemb
set GCCARMEMB_TOOLCHAIN_PATH=c:\gccarmemb
zephyr-env.cmd
cd zephyr\samples\hello_world
mkdir build & cd build
cmake -GNinja -DBOARD=nrf52_pca10040 ..
Ninja
End!!!