前一个文档写到在安装Gecko SDK Suite v4.4时,github代码拉取不下来,因此找了一个getee的资源拉取,但是后面通过实际测试发现,该SDK可以实现简单的功能,如LED BLINK,但在使用蓝牙的时候,该SDK的demo编译失败(原因应该是有库文件没有下载,因为github的拉取的资源有2G多,而gitee只有几十M),因此最终还是通过vpn拉取了github上的Gecko
SDK Suite v4.1(后面下载手机APP也需要vpn)。github地址:https://github.com/SiliconLabs/gecko_sdk
创建Demo程序
Bootloader
首先需要给板子烧写bootloader程序,demo如下图所示,选择Bootloader - SoC Bluetooth AppLoader OTA DFU。

同样导出IAR工程,从linkerfile.icf文件可以看到bootloader烧写起始位置为0x80000000,将bootloader编译下载到开发板。

Bluetooth demo
选择Bluetooth - SoC Blinky demo,如下图所示。

同样导出IAR工程,从linkerfile.icf文件可以看到bootloader烧写起始位置为0x8012000,app程序烧写在bootloader区域之后。将SoC Blinky demo编译下载至开发板。
至此开发板的环境搭载完成,接下来配置手机端app。

下载手机APP
配套的手机app为Simplicity Connect,需要在谷歌应用商店下载。打开app后在Demo选项里找到Blinky,打开可以看到板子的蓝牙名称为Blinky Example,点击即可连接到开发板,接下来就可以用手机app对开发板进行控制。

功能演示:
按下手机APP端的灯泡按键可以控制板载LED的亮灭,按下板载按键,可以在手机APP显示按键被按下。
- APP 控制板载LED


- APP显示板载按键状态


|