Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-9700

PowerCC26X2 does not stop tcxoEnableClock when releasing dependency if switch pending

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • TI Device Drivers
    • TIDRIVERS-4009
    • TIDRIVERS_4_30_01
    • TIDRIVERS_5_10_00
    • Hide
      CC13x2
      CC26x2
      Show
      CC13x2 CC26x2

      Situation:

      The application uses TCXO.

      1. The application calls Power_setDependency(PowerCC26XX_XOSC_HF)
      2. After returning but before the clock source has switched, the application calls Power_releaseDependency(PowerCC26XX_XOSC_HF)
      3. We turn off the XOSC_HF but do not call ClockP_stop(ClockP_handle(&PowerCC26X2_module.tcxoEnableClock))
      4. tcxoEnableClock times out. We call switchXOSCHF() and eventually get to the RCOSC calibration fxn if it is enabled (it is by default)
      5. 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.
      6. 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.
      7. 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));
      ...
      

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: