主题中讨论的其他器件: LAUNCHXL-CC2640R2
您好!
我正在使用 Simplelink SDK 在定制硬件上开发 BLE 应用、直到现在、我的用例有一个周期性的1ms 中断。 这就是我的硬件从不进入睡眠模式的原因。
现在、我在 simple_peripheral 示例代码上测试睡眠模式定制硬件无法进入睡眠模式。 我知道这是因为器件能够完美地广播数据、但一旦我尝试通过 Android 手机上的 NRF 连接应用程序进行连接、器件就会停止响应、并收到 GATT 错误。 此外、一旦我禁用 power_saving define、在编译之前、在预定义符号列表中、它就会完美连接。
我根据以下链接实现了无晶振模式: 开发低功耗蓝牙应用-低功耗蓝牙软件开发人员指南3.00.01文档 、该文档位于简单外设示例代码上。 我使用 CC2640R2L MCU (Simplelink SDK v4.40和 TI 编译器 v20.2.3)将同一文件烧录到 LAUNCHXL-CC2640R2评估板的任何定制硬件。 基本 simple_peripheral 示例代码不使用任何 GPIO,因此我在 Board_init()函数中禁用它们以删除任何特定于硬件的自定义可靠性。
结果:在我复位电路板后、评估板正常工作、但定制硬件无法连接。
我参考 了 TI 的 CC13xx/CC26xx 硬件配置和 PCB 设计注意事项文档、其中指出:
"错误的 RTC 频率将导致器件丢失连接事件、从而断开与中央器件的链路。"
但是、我正在尝试将内部 RCOSC 用于相同的目的、因此它不应依赖于外部硬件是否正确?
我可以验证我实际上使用的是内部 RCOSC (并且它已正确配置)、因为我使用了 OSCClockSourceGet 函数来获取 HF、MF 和 LF 时钟源。 我在 SimplePeripheral_performPeriodicTask (void)中添加了以下代码
/********************************************************************* * @fn SimplePeripheral_performPeriodicTask * * @brief Perform a periodic application task. This function gets called * every five seconds (SBP_PERIODIC_EVT_PERIOD). In this example, * the value of the third characteristic in the SimpleGATTProfile * service is retrieved from the profile, and then copied into the * value of the the fourth characteristic. * * @param None. * * @return None. */ static void SimplePeripheral_performPeriodicTask(void) { uint8_t valueToCopy; volatile uint32_t hf = 5, lf = 5, mf = 5, test = 6; //#define OSC_RCOSC_HF 0x00000000 //#define OSC_XOSC_HF 0x00000001 //#define OSC_RCOSC_LF 0x00000002 //#define OSC_XOSC_LF 0x00000003 hf = OSCClockSourceGet(OSC_SRC_CLK_HF); lf = OSCClockSourceGet(OSC_SRC_CLK_LF); mf = OSCClockSourceGet(OSC_SRC_CLK_MF); test = OSCClockSourceGet(OSC_SRC_CLK_HF); // Call to retrieve the value of the third characteristic in the profile if (SimpleProfile_GetParameter(SIMPLEPROFILE_CHAR3, &valueToCopy) == SUCCESS) { // Call to set that value of the fourth characteristic in the profile. // Note that if notifications of the fourth characteristic have been // enabled by a GATT client device, then a notification will be sent // every time this function is called. SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR4, sizeof(uint8_t), &valueToCopy); } }
在调试期间、我在"Expressions"窗口中获得了以下输出:
HF 无符号 int 1 0x200004D8
mf 无符号 int 1 0x200004E0
LF unsigned int 2 0x200004DC
因此、LF 源实际上是内部 RC 振荡器 OSC_RCOSC_LF。
我假设如果我使用的是内部 RCOSC、而不是板载32.768晶体、睡眠时钟应该工作正常。 请告诉我如何调试此问题。 在我们的射频定制板上、我们还使用具有内部偏置的差分模式、就像评估板一样。 谢谢。