Name Date Size #Lines LOC

..--

applications/H25-Apr-2025-4213

docs/figures/H25-Apr-2025-

drivers/H25-Apr-2025-3,9091,536

nordic/H25-Apr-2025-350,515271,298

packages/H25-Apr-2025-196,752134,347

rt-thread/H25-Apr-2025-831,896568,652

.configH A D25-Apr-202510.9 KiB459412

KconfigH A D25-Apr-2025332 2615

README.mdH A D25-Apr-20252.9 KiB7850

SConscriptH A D25-Apr-2025298 1511

SConstructH A D25-Apr-2025977 3526

project.uvoptxH A D25-Apr-202578.2 KiB2,4122,395

project.uvprojxH A D25-Apr-202555.3 KiB1,4081,402

rtconfig.hH A D25-Apr-20253.6 KiB21881

rtconfig.pyH A D25-Apr-20252.2 KiB8461

rtthread-nrf52832.sctH A D25-Apr-2025464 1613

template.uvoptxH A D25-Apr-20255.2 KiB172165

template.uvprojxH A D25-Apr-202514.3 KiB387381

README.md

1# NRF52832 Nimble BSP 使用说明
2
3## 简介
4
5该 BSP 以 nrf52832 MCU 作为为平台,提供 NimBLE Bluetooth Stack 在 RT-Thread 上的基本功能。
6
7所使用的协议栈为 NimBLE 在 RT-Thread上的移植版本,提供完整的 Host 及 Controller 协议栈支持,主要特性如下:
8
9- 支持 BLE5.0 标准
10- 2Msym / s PHY 吞吐量
11- 安全管理(SM),支持 LE Legacy Pairing,  LE Secure Connections, Transport Specific Key Distribution
12- 配置灵活,最多支持 32 个并发连接
13- 提供常用的 Profile 和 Service 支持
14- 清晰的 HCI 接口抽象
15- 支持 BLE Mesh(PB-GATT and PB-ADV provisioning, Relay support, GATT Proxy ....)
16- 最小 4.5 KB RAM,69KB Flash 的资源占用
17
18更多关于 NimBLE Stack 的介绍请参考 ``http://mynewt.apache.org/latest/network/docs/index.html``。
19
20## 外设支持
21
22本 BSP 目前对外设的支持情况如下:
23
24| **片内外设**      | **支持情况** | **备注**                              |
25| :----------------- | :----------: | :------------------------------------- |
26| OS_Tick        |     支持      |    |
27| GPIO           |     支持      |    |
28| UART           |     支持      | TX-->6;RX-->8 |
29
30## 使用说明
31
32当前工程已经默认导入RT-Thread 4.0源码和NimBLE软件包,且打开心率服务(HRS)的配置,无需再次配置,可直接使用MDK5 双击打开工程文件编译。
33
34### 编译及烧写
35
36- 编译工程
37
38直接双击 project.uvprojx 工程文件,打开该工程后,点击 build 按钮,编译生成 hex 文件。
39
40- 烧写
41
42使用 JLINK 连接板子,选择对应的芯片型号,点击 Download 按钮进行烧写。
43
44### 运行结果
45
46烧写完成后,正确连接板载串口至终端软件,复位重新执行,打印如下信息,此时标志 RT-Thread 已经在正常工作,可输入其它 FINSH 命令查看系统状态信息,如 ``ps`` 、 ``free`` 等。
47
48```
49 \ | /
50- RT -     Thread Operating System
51 / | \     4.0.0 build Jan 23 2019
52 2006 - 2018 Copyright by rt-thread team
53hello world
54msh />
55```
56
57### BLE 的简单使用
58
59当前工程提供一个 Heart rate 示例。系统正常运行后,在 Finsh 命令行 输入 `` ble_hr ``,执行该 Demo。如下:
60
61```
62msh />ble_hr
63[I/nimble] GAP procedure initiated: stop advertising.
64[I/nimble] GAP procedure initiated: advertise; disc_mode=2 adv_channel_map=0 own_addr_type=0 adv_filter_policy=0 adv_itvl_min=0 adv_itvl_max=0
65msh />
66```
67
68此时手机打开 `nRF Master Control Panel` APP,能够扫描到名为 `rtt_blehr_sensor` 的设备,连接之后,模拟的 Heart rate 示例开始运行。现象如下:
69
70![heart_rate](docs/figures/heart_rate.png)
71
72## 注意事项
73
74- 该BSP UART默认使用 TX--->6;RX--->8 引脚,可根据板载设计自行修改;
75- 该协议栈移植自 Apache 开源方案 Nimble,相关介绍及 API 说明可参考``http://mynewt.apache.org/latest/network/docs/index.html``。
76
77
78