Other Parts Discussed in Thread: LAUNCHXL-CC2640R2
Hi,
I am developing an BLE application on custom hardware using the Simplelink SDK and till now I had a periodic 1ms interrupt for my use case. This was the reason, my hardware was never going into sleep mode.
Now that I am testing sleep mode on simple_peripheral example code the custom hardware is not able to go into sleep. I know this is the reason because the device is advertising data perfectly but as soon as I try to connect via my nRF connect app on my android phone, the device stops responding and I receive a GATT ERROR. Also, as soon as I disable to POWER_SAVING define, before compiling, in the predefined symbols list, it connects perfectly.
I implemented the crystal less mode as per this link: Developing a Bluetooth Low Energy Application — Bluetooth Low Energy Software Developer's Guide 3.00.01 documentation on the simple peripheral example code. I flashed the same file to both LAUNCHXL-CC2640R2 eval board any my custom hardware with CC2640R2L MCU (Simplelink SDK v4.40 and TI compiler v20.2.3). The basic Simple_peripheral example code does not use any GPIOs so I disabled them in Board_init() function to remove any custom hardware specific dependancy.
Result: After I reset the boards, the eval board works normally but the custom hardware is not able to connect.
I referred to CC13xx/CC26xx Hardware Configuration and PCB Design Considerations document from TI where it states that:
"Incorrect RTC frequency will lead to the device missing the connection events and thus breaking the link with the central device."
However, I am trying to use the internal RCOSC for the same, so it should not depend on external hardware correct?
I can verify that I am in fact using the internal RCOSC (and that it is configured properly) as I used the OSCClockSourceGet function to get the HF, MF and LF clock source. I added the following code in the 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); } }
And I got the following output in the Expressions window during debug:
hf unsigned int 1 0x200004D8
mf unsigned int 1 0x200004E0
lf unsigned int 2 0x200004DC
So, the LF source is infact the OSC_RCOSC_LF which is the internal RC Oscillator.
I am assuming that if I am using the internal RCOSC, and not the 32.768 Crystal on board, the sleep clock should be working fine. Please let me know how to debug this issue. On our custom board for RF, we are also using differential mode with internal bias, just like the eval board. Thanks.