1. nRF 5340环境搭建和工具下载
1. 1 软件安装
nRF Connect for Desktop
https://www.nordicsemi.com/Products/Development-tools/nrf-connect-for-desktop
nRF Command Line Tools
https://www.nordicsemi.com/Products/Development-tools/nrf-command-line-tools/download
vscode
https://code.visualstudio.com/download
1.2 SDK和工具链下载
打开nRF Connect for Desktop
下载NCS编译链(我这里已经下载完成所以button显示是open)

点开后选择SDK版本进行下载(我这里已经下载完成所以button显示是open vs code)
由于这个工具是从github进行做
git clone
操作,因此需要魔法上网并且开全局模式,否则可能因为网络原因无法下载完成

如果因为网络中断,可以选择update SDK进行继续下载

下载完成后可能会提示你vscode的其他下载工具未下载,选择下载就行

进入vscode可以看到扩展工具栏多了nrf的工具,如果显示有工具链和sdk的版本名字说明你安装完成

如果魔法上网开全局模式也不能安装SDK到可以尝试在vscode下载,然后安装,和在desktop一致,参考https://www.bilibili.com/read/cv26507574/

2. 跑一个demo
创建一个app,并选择例子,这里选择mesh demo




连接开发板并烧录

串口打印默认115200,可以看到打印说明运行成功

参考
https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/bluetooth/mesh_demo
https://www.youtube.com/watch?v=QTtLZIPcYfM\&list=PLoKOKJqgqHs9mReagSVnB8FAQBJuRMCEt\&index=1
https://docs.zephyrproject.org/latest/samples/bluetooth/mesh_demo/README.html
https://www.nordicsemi.com/Products/Development-hardware/nrf5340-dk/getstarted?lang=zh-CN