CC2652R7
这个支持 Matter 的示例可用作灯泡设备类型,具有开启/关闭功能。这些步骤已在针对 SimpleLinkTM 多标准无线 MCU 的 Texas Instruments LP-CC2652R7 CC2652R7 LaunchPadTM 开发套件上进行了验证。
此示例使用测试供应商 ID (VID) 0xFFF1
和产品 ID (PID) 0x8005
。
本文档中的步骤已在 macOS Ventura 13.3.1 版上进行了验证。
初始设置
- 安装 TI SYSCONFIG 1.15.0:https://www.ti.com/tool/download/SYSCONFIG/1.15.0.2826
- 安装 UniFlash:https://www.ti.com/tool/download/UNIFLASH
- 克隆并初始化
matter
代码库:git clone https://github.com/TexasInstruments/matter.git
cd matter
git fetch origin v1.0-ti-branch
git checkout FETCH_HEAD
git submodule update --init --recursive
source ./scripts/activate.sh
- 安装依赖项:
pip install ecdsa
构建映像并刷写开发板
- 为 Lighting 应用构建映像:
cd ~/matter/examples/lighting-app/cc13x2x7_26x2x7
gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\""
ninja -C out/debug
- 将 CC2652R7 开发板连接到计算机,然后使用 Uniflash 将映像刷写到开发板:
- 打开 Texas Instruments UniFlash。
- 点击启动。
- 选择设置和实用程序标签页。
- 在手动清除部分中,选择抹掉整个闪存(之后必须重新连接到目标)。
- 点击清空整个 Flash。
- 选择计划标签页。
- 加载启动映像管理器 (BIM) 的映像:
- 点击浏览。
- 转到
~/matter/examples/lighting-app/cc13x2x7_26x2x7/out/debug
。 - 选择
chip-LP_CC2652R7-lighting-example-bim.hex
。 - 点击 Open。
- 点击加载图片。
- 加载
lighting-app
的图片:- 点击 +。
- 选择
chip-LP_CC2652R7-lighting-example.bin
。 - 取消选中图片 1。
- 点击加载图片。
验证示例
- 设备应在计算机上显示为 USB 串行设备。
您可在
/dev/
中查找:ls -la /dev/tty*
- 您可以使用
screen
或minicom
打开串行控制台。例如,如果设备处于/dev/tty.usbmodemL150011K1
状态:screen /dev/tty.usbmodemL150011K1 115200
- 按下 USB 连接器旁边的重置按钮,以重置系统并启动
lighting-app
。 - 手动开启 BLE 通告(需要 Google Home app (GHA) 才能发现设备)。按住 BTN-2 并保持超过一秒,您应该会在串行控制台中看到如下消息:
Enabled BLE Advertisements
- 如果你想开灯,请按 BTN-1 按钮。
- 如需关灯,请按 BTN-2 按钮。
- 如果之前已配对过该板,建议您将其恢复出厂设置。如需执行恢复出厂设置,请按住 BTN-1 超过 1 秒钟。
Clearing Thread provision Erasing Thread persistent info... System restarting
后续步骤
成功构建 Matter 示例后,创建开发者项目。