本文的主线 Dependencies => West => Toolchain => Project
Dependencies
![zephyr-startup-native-01.png](/images/2022/05/zephyr-startup-native-01.png)
注意: 以上三个安装文件 (对!!! 是三个) 都需要安装 否则烧录错误”ERROR: JLinkARM DLL load failed”
1 2 3 4 5 6 7 8 9
| xcode-select --install
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" brew -v
brew install cmake ninja gperf python3 ccache qemu dtc wget
|
West
1 2 3 4 5 6 7 8 9 10 11
| pip3 install -U west
west init -m https://github.com/zephyrproject-rtos/zephyr --mr v2.7.0 ~/zephyrproject
cd ~/zephyrproject
west update
west zephyr-export
pip3 install -r ~/zephyrproject/zephyr/scripts/requirements.txt
|
1 2 3 4 5 6 7 8 9 10 11
| mkdir ~/.local cd ~/.local
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.14.1/zephyr-sdk-0.14.1_macos-x86_64.tar.gz
tar xvf zephyr-sdk-0.14.1_macos-x86_64.tar.gz
cd zephyr-sdk-0.14.1 ./setup.sh
|
每次开发都需要执行环境变量更新
1 2 3
| source ~/zephyrproject/zephyr/zephyr-env.sh
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
Project
1 2 3 4 5 6 7
| cp -R ~/zephyrproject/zephyr/samples/basic/blinky ~/Desktop
cd ~/Desktop/blinky
west build -p auto -b nrf52840dk_nrf52840
west flash
|
参考