升级Zephyr&SDK

Creative Commons
本作品采用知识共享署名

昨天Update zephyr的code,master已经进到V1.12.99, update后要求sdk必须更新到0.9.3。本文说明如何进行相关配置的Update。

概述

本文说明如果更新zephyr代码和sdk。本文基于zephyr编译环境搭建Zephyr添加nrf52-moderate进行说明

Zephyr代码更新

本来没什么说的,在git clone的zephyr目录下执行git pull即可,奈何github现在git pull太慢只有几k,这里说明提速方法:
Step1: 打开下面网站
https://www.ipaddress.com/

Step2: 查询下面两个网址的ip

1
2
github.com
github.global.ssl.fastly.net

Step3: 将查询的ip地址和网址map加入到/etc/hosts中

1
2
192.30.253.112 github.com
151.101.13.194 github.global.ssl.fastly.net

Step4: 执行下面命令刷新

1
sudo /etc/init.d/networking restart

现在执行git pull,基本能把我的网络带宽占满

更新Zephyr SDK

下载SDK

https://github.com/zephyrproject-rtos/meta-zephyr-sdk/releases 下载zephyr-sdk-0.9.3-setup.run

安装

执行

1
sh zephyr-sdk-0.9.3-setup.run

选择路径安装在/home/frank/opt/zephyr-sdk/(原来的0.9.2安装在/home/frank/zephyr-sdk)

配置

~/.zephyrrc, sdk路径变化修改sdk路径

1
2
3
4
export PATH=/home/frank/cmake/cmake-3.8.2-Linux-x86_64/bin:$PATH
#export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
export ZEPHYR_SDK_INSTALL_DIR=/home/frank/opt/zephyr-sdk
export ZEPHYR_BASE=/home/frank/work/project/zephyr

~/work/project/nrf52_moderate/script/arm.sh,GCCARMEMB_TOOLCHAIN_PATH/ZEPHYR_GCC_VARIANT/gccarmemb被废弃,分别替换为GNUARMEMB_TOOLCHAIN_PATH/ZEPHYR_TOOLCHAIN_VARIANT/gnuarmemb

1
2
export GNUARMEMB_TOOLCHAIN_PATH="/opt/gcc-arm-none-eabi-7-2017-q4-major"
export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb

~/work/project/nrf52_moderate/boards/arm/nrf52_moderate/nrf52_moderate.yaml,gccarmemb被废弃,替换为gnuarmemb

1
2
3
4
5
6
7
8
9
10
11
identifier: nrf52_moderate
name: Nrf52 Moderate
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
supported:
- ble
ram: 64
flash: 512

~/work/project/nrf52_moderate/boards/arm/nrf52_moderate/Kconfig, Kconfig不再定义default值

1
2
3
4
5
6
7
8
9
10
11
if BOARD_NRF52_MODERATE

config MOTHER_BOARD_LED
bool
prompt "nrf52 moderate mother board led"
help
If disabled, the mother board no support led drv



endif # BOARD_NRF52_MODERATE

编译

编译和运行方式都不变