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.

TMS570LS1114上电过程中PLL2时钟源开启失败,发生Errata SYS#046故障

Other Parts Discussed in Thread: HALCOGEN, TMS570LS1114

TMS570LS1114上电过程中偶发PLL2 clock source 开启失败,导致程序在HalCoGen生成的system.c文件中Errata SYS#46解决方案部分进入while()死循环 

/* Work Around for Errata SYS#46:
     *
     * Errata Description:
     *            Clock Source Switching Not Qualified with Clock Source Enable And Clock Source Valid
     * Workaround:
     *            Always check the CSDIS register to make sure the clock source is turned on and check
     * the CSVSTAT register to make sure the clock source is valid. Then write to GHVSRC to switch the clock.
     */
    /** - Wait for until clocks are locked */
    SYS_CSVSTAT = systemREG1->CSVSTAT;
    SYS_CSDIS = systemREG1->CSDIS;
    while ((SYS_CSVSTAT & ((SYS_CSDIS ^ 0xFFU) & 0xFFU)) != ((SYS_CSDIS ^ 0xFFU) & 0xFFU))
    {
        SYS_CSVSTAT = systemREG1->CSVSTAT;
        SYS_CSDIS = systemREG1->CSDIS;
    } /* Wait */

上述代码Errata SYS#46解决方案只是通过寄存器CSDIS和CSVSTAT检查时钟源是否开启,如果开启失败,只会导致程序陷入死循环一直等待开启,无法上电,并不能有效解决问题,

请问有人遇到过相同的问题吗?什么原因可能导致PLL2 clock source偶发的开启失败?应该怎么避免并解决这种问题呢?

  • 很抱歉,我暂时还没有遇到过这种问题

    感觉您的问题像是踩了SSWF021#45 PLL Fails to Start的坑

    您现在CSVSTAT置1了吗?
  • 您好:CSVSTAT没有置1,这种情况是偶发的,但是出现过PLL开启失败的控制器,反复测试总是能够复现,因为我们用的HALCoGen版本为04.07.00,没有添加SSWF021#45的解决方案,请问SSWF021#45解决方案能够解决PLL开启失败的问题吗?是通过重启来解决吗?PLL开启失败的原因可能是什么呢?是所有控制器都可能会有开启失败的风险吗???

  • 如SSWF021#45所述,正确初始化PLL控制寄存器并设置适当的时钟源时禁用位清零后,经过规定的OSCIN周期数后,PLL应为锁定,相应的CSVSTAT位应置1。

    When the PLL control registers are properly initialized and the appropriate clock source disable bit is cleared, after the prescribed number of OSCIN cycles, the PLL should be locked and the appropriate CSVSTAT bit should be set.

    While the main clock is being driven by the oscillator, the software loop checking that the PLL has locked (CSVSTAT = 1 ) should also check if the ESM flag for PLL slip has been set

    另外还需要检查ESM flag是否置位

    关于这个我们还有专门的文档,配合了相关的代码,您可以参考一下

    www.ti.com/.../spna233b.pdf
  • 非常感谢您的回答,我在程序中添加了SSWF021#45的解决方案,经过几千次的反复试验,复现的概率降低了,但是仍然会有PLL fail to start的情况发生,死在下面代码段中while(1),目前uint32 _errata_SSWF021_45_both_plls(uint32 count)这个函数的参数尝试次数给的默认值5,请问如果想完全避免这种问题,有什么好的建议吗?可以增加count值或者在while(1)中加上软件复位来处理吗?会有安全隐患吗?   

    /* check for power-on reset condition */
        /*SAFETYMCUSW 139 S MR:13.7 <APPROVED> "Hardware status bit read check" */
        if ((SYS_EXCEPTION & POWERON_RESET) != 0U)
        {  
    /* USER CODE BEGIN (12) */
    /* USER CODE END */
            /* Add condition to check whether PLL can be started successfully */
            if (_errata_SSWF021_45_both_plls(PLL_RETRIES) != 0U)
            {
                /* Put system in a safe state */
             while(1)
             {
              
             }
            }