-
Bug
-
Resolution: Fixed
-
High
-
TI Device Drivers
-
TIDRIVERS-4009
-
TIDRIVERS_4_30_01
-
TIDRIVERS_5_10_00
-
Situation:
The application uses TCXO.
- The application calls Power_setDependency(PowerCC26XX_XOSC_HF)
- After returning but before the clock source has switched, the application calls Power_releaseDependency(PowerCC26XX_XOSC_HF)
- We turn off the XOSC_HF but do not call ClockP_stop(ClockP_handle(&PowerCC26X2_module.tcxoEnableClock))
- tcxoEnableClock times out. We call switchXOSCHF() and eventually get to the RCOSC calibration fxn if it is enabled (it is by default)
- PowerCC26X2_initiateCalibration() turns on the XOSC_HF with Power_setDependency(PowerCC26XX_XOSC_HF). This is usually done to keep the XOSC_HF alive for the entirety of the calibration. In this case, it actually turns it on.
- We spin in one of the while loops waiting to configure the TDC to use the XOSC_HF as reference. We cannot switch to the XOSC_HF because we are already in the Clock SWI and the XOSC_HF switch fxn uses a Clock callback for TCXO and the Clock SWI cannot preempt itself.
- Deadlock
Code in a task to reproduce in a TCXO project (untested but should work):
Power_setDependency(PowerCC26XX_XOSC_HF);
Power_releaseDependency(PowerCC26XX_XOSC_HF);
while(1);
Fix:
... /* when release XOSC_HF, auto switch to RCOSC_HF */ else if (action == PowerCC26XX_DISABLE) { OSCHF_SwitchToRcOscTurnOffXosc(); /* Handle TCXO if selected in CCFG */ if (CCFGRead_XOSC_FREQ() == CCFGREAD_XOSC_FREQ_TCXO) { /* Disable Clock in case we have started it and are waiting for * the TCXO to stabilise. * If the Clock is not currently active, this should do nothing. */ ClockP_stop(ClockP_handle(&PowerCC26X2_module.tcxoEnableClock)); ...