Hello everybody!
I hope my topic is in the correct place here because I wasn't sure if it belongs to the Clock&Timing forum. If not, please move it there if possible.
We have a custom Board containing a CC2640R2F running BLE over a Johnson IPC and a PCB Antenna. Sadly I dimensioned the CL capacitors of the LF Crystal too big so it can't oscillate correctly which leads to BLE advertisements being successful but any connection attempt failing. Replacing the capacitors is no option right now as they are in a tiny package we can't replace without problems and the project manager wants to first verify the functionality in a few tests before changing anything on the hardware.
I tried to verify this with the "simple peripheral" example configured for the internal LF RC oscillator instead of the external crystal and got it to connect successfully.
But when I try to get our own program set up for doing so, it seems as the calibration isn't working. The AON_RTC -> SUBSECINC register keeps showing 0x00800000. In the simple_peripheral example the value there was correctly changed by the calibration routine.
For the implementation of the calibration routine I followed the instructions in SWRA499C:
- aded "USE_RCOSC" to the predefined symbols of the stack library and the project
- removed "ccfg_app_ble.c" from compilation, added "ccfg_app_ble_rcosc.c" instead here found in simplelink_cc2640r2_sdk_5_30_00_03\source\ti\blestack\common\cc26xx\rcosc
(we're not using BT 5, so I assume blestack instead of ble5stack should be correct
- copied "rcosc_calibration.c" and .h to the "Startup" folder of the app project
- added this code to the header includes of the main file
#ifdef USE_RCOSC
#define RCOSC_CALIBRATION_PERIOD 1000
#include "rcosc_calibration.h"
#include <ti/blestack/inc/hci.h>
#endif //USE_RCOSC
- added the following code in the init function just after Board_initGeneral();
#ifdef USE_RCOSC
RCOSC_enableCalibration();
#endif // USE_RCOSC
- changed the power settings in the boad .c-file
#include <ti/drivers/Power.h>
#include <ti/drivers/power/PowerCC26XX.h>
const PowerCC26XX_Config PowerCC26XX_config = {
.policyInitFxn = NULL,
.policyFxn = &PowerCC26XX_standbyPolicy,
.calibrateFxn = &PowerCC26XX_calibrate,
.enablePolicy = true,
.calibrateRCOSC_LF = true,
.calibrateRCOSC_HF = true,
};
- changed the build configuration from "FlashROM_StackLibrary" to "FlashROM_StackLibrary_RCOSC"
But after all, still no change. SUBSECINC still stays at the same value without a change. Does anybody have a good hint here? On the simple_peripheral example this was enough to get it running.
Thanks a lot in advance and have a great week everybody!
best wishes from Germany,
Nico