This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SIMPLELINK-LOWPOWER-F3-SDK: PowerCC23X0_lfoscQual

Part Number: SIMPLELINK-LOWPOWER-F3-SDK

Hi, TI Team.

I have a question regarding the PowerCC23X0_lfoscQual function in PowerCC23X0.c.

It appears that this function retries the TDC measurement if the LFOSC accuracy does not meet the required standard. I am concerned that if the LFOSC malfunctions and the TDC result never becomes valid, the system might get stuck in an infinite loop within the TDC measurement process.

Since this function is executed before the reset monitoring via LFMONCTL is enabled, I assume the device would not be able to recover via a system reset in this scenario.

Do you have any workarounds or recommended solutions for this potential issue?

Best regards

  • Hi sjmizuta,

    I have reviewed the PowerCC23X0.c and can understand your point.  I am asking the TI Drivers Team for clarification.  Meanwhile, perhaps it would be possible to implement a custom PowerCC23X0.c solution to address your concerns?  This pseudo-code would be added to PowerCC23X0_lfoscQual:

    /* at top of function */
    #define TDC_MAX_RETRIES    4
    static int32_t lastTdcCount = 0;
    static uint32_t tdcRetries = 0;
    
    /* in CKMD_MIS_TDCDONE_M handling */
    if (isClockGood)
    {
        tdcRetries = 0;
        /* existing success handling ... */
    }
    else
    {
        /* Clock not stable. Start a new TDC measurement or fallback if retries exceeded */
        if (++tdcRetries >= TDC_MAX_RETRIES)
        {
            Log_printf(LogModule_Power, Log_ERROR,
                       "PowerCC23X0_lfoscQual: TDC retries exceeded, falling back to LFXT");
            tdcRetries = 0;
    
            /* Defer to non-ISR context if necessary; example direct call: */
            PowerLPF3_selectLFXT(); /* start fallback LFXT qualification */
            /* Alternatively: set a flag for deferred fallback or call NVIC_SystemReset(); */
        }
        else
        {
            PowerCC23X0_restartLfclkTdcMeasurement();
        }
    }

    You would also need to set tdcRetries to zero in PowerLPF3_selectLFOSC as the starting point.

    Regards,
    Ryan

  • Hi Ryan,

    Thank you for providing the proposed countermeasures.
    I look forward to hearing from the TI driver team.


    Best regards,

  • Can you please discuss whether you've come across any run-time issues with the current implementation?  Otherwise it is difficult to fathom why the LFOSC would be failing in any scenario where the rest of the MCU is operating properly.  Also, note that this is handled through an interrupt context so that other code can run while the LF clock is settling.

    Regards,
    Ryan