出自《上李邕》作者:李白
大鹏一日同风起,扶摇直上九万里。
安装过程详见官方文档,只点坑点。
注意 选择ubuntu系统,因为zephyr SDK目前不支持macOS和win。
west init
clone Zephyr Project 组织下zephyr仓库作为清单仓库
west update
clone cmsis segger等等最新的硬件供应厂商的驱动库
west.yml
列出上游仓库的 url-base
以及需要clone
的厂商驱动库清单,可以将不需要的厂商驱动库删除,添加自定义自己需要的驱动库。
https://github.com/zephyrproject-rtos/zephyr/blob/master/west.yml
# /home/hell/zephyrproject/west.yml # west init west update 需下载的清单文件
manifest:
defaults:
remote: upstream
remotes:
- name: upstream
url-base: https://github.com/zephyrproject-rtos
# Please add items below based on alphabetical order
projects:
- name: cmsis
revision: 542b2296e6d515b265e25c6b7208e8fea3014f90
path: modules/hal/cmsis
- name: hal_atmel
revision: 1fe96f0a5e1a11d8101b258a3b84d35dc7178401
path: modules/hal/atmel
# ...
- name: edtt
path: tools/edtt
revision: c39888ff74acf421eeff9a7514fa9b172c3373f7
- name: trusted-firmware-m
path: modules/tee/tfm
revision: 7e51033f7bf4ad54a008e5c3cdf244d1d6954af0
self:
path: zephyr
west-commands: scripts/west-commands.yml
west init
clone zephyrproject github主仓库,下载速度很慢。
此处需要配置VMware虚拟机使用主机的梯子。(如果有阿里云香港或者海外版的VPS,可以按此路径)
我摸索了几种方式后,发现以下方式可行 (使用fastgit进行提速)。
注意 :在码云上Zephyr没有官方维护的仓库群,个人维护的仓库群 west update
所需的库不全
west init -m https://hub.fastgit.org/zephyrproject-rtos/zephyr ~/zephyrproject
# /home/hell/zephyrproject/zephyr
west update
clone west.yml
上游清单文件列出的驱动库,需修改 url-base
进行提速
remotes:
- name: upstream
url-base: https://hub.fastgit.org/zephyrproject-rtos
Export a Zephyr CMake package
hell@ubuntu:~/zephyrproject$ west zephyr-export
Zephyr (/home/hell/zephyrproject/zephyr/share/zephyr-package/cmake)
has been added to the user package registry in:
~/.cmake/packages/Zephyr
ZephyrUnittest (/home/hell/zephyrproject/zephyr/share/zephyrunittest-package/cmake)
has been added to the user package registry in:
~/.cmake/packages/ZephyrUnittest
scripts/requirements.txt
根据requirements.txt
下载python依赖项
pip源修改为阿里PyPI镜像源
此处也需要fastgit进行提速,zephyr-sdk-0.11.3-setup.run 800+M
cd ~/zephyr_sdk
wget https://hub.fastgit.org/zephyrproject-rtos/sdk-ng/releases/download/v0.11.3/zephyr-sdk-0.11.3-setup.run
cd ~/zephyrproject/zephyr
west build -p auto -b nucleo_f103rb samples/basic/blinky
west flash
Comments
Be the first one to comment on this page!