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.

RM57L843: PLL1 Slip test problem

Part Number: RM57L843
Other Parts Discussed in Thread: HALCOGEN,

Hello, team.

According to Safety Manual (SPNU575A), I implemented PLL1 Slip detector (CLK2).

I copied checkPLL1Slip() anc checkPLL2Slip()  from TI Sample code in demo_app (..\SafeTI Diagnostic Library\2.4.0\demo_app\common\source\faultInject.c).

However, System halt occurs in checkPLL1Slip().

 

checkPLL2Slip() is not problem.

It's my setupPLL() code.

void setupPLL(void)
{

/* USER CODE BEGIN (3) */
/* USER CODE END */

    /* Disable PLL1 and PLL2 */
    systemREG1->CSDISSET = 0x00000002U | 0x00000040U;
    /*SAFETYMCUSW 28 D MR:NA <APPROVED> "Hardware status bit read check" */
    while((systemREG1->CSDIS & 0x42U) != 0x42U)
    {
    /* Wait */
    }

    /* Clear Global Status Register */
    systemREG1->GBLSTAT = 0x301U;

    /** - Configure PLL control registers */
    /** @b Initialize @b Pll1: */

    /**   - Setup pll control register 1:
    *     - Setup reset on oscillator slip
    *     - Setup bypass on pll slip
    *     - setup Pll output clock divider to max before Lock
    *     - Setup reset on oscillator fail
    *     - Setup reference clock divider
    *     - Setup Pll multiplier
    */
    systemREG1->PLLCTL1 =  (uint32)0x00000000U
                        |  (uint32)0x20000000U
                        |  (uint32)((uint32)0x1FU << 24U)
                        |  (uint32)0x00000000U
                        |  (uint32)((uint32)(8U - 1U)<< 16U)
                        |  (uint32)(0xA400U);

    /**   - Setup pll control register 2
    *     - Setup spreading rate
    *     - Setup bandwidth adjustment
    *     - Setup internal Pll output divider
    *     - Setup spreading amount
    */
    systemREG1->PLLCTL2 =  (uint32)((uint32)255U << 22U)
                        |  (uint32)((uint32)7U << 12U)
                        |  (uint32)((uint32)(1U - 1U) << 9U)
                        |  (uint32)61U;

    /** @b Initialize @b Pll2: */

    /**   - Setup pll2 control register :
    *     - setup Pll output clock divider to max before Lock
    *     - Setup reference clock divider
    *     - Setup internal Pll output divider
    *     - Setup Pll multiplier
    */
    systemREG2->PLLCTL3 = (uint32)((uint32)(1U - 1U) << 29U)
                        | (uint32)((uint32)0x1FU << 24U)
                        | (uint32)((uint32)(8U - 1U)<< 16U)
                        | (uint32)(0xA400U);

    /** - Enable PLL(s) to start up or Lock */
    systemREG1->CSDIS = 0x00000000U
                      | 0x00000000U
                      | 0x00000008U
                      | 0x00000080U
                      | 0x00000000U
                      | 0x00000000U
                      | 0x00000000U
                      | 0x00000004U;
}

My board is Custom board. (Not evaluation board)

Below is PLL Setting in Halcogen.

  

Please let me know where the wrong is.

Best regard.

Gene.

  • Hi Gene,

    Is it possible for you to attach the complete project?

    If that possible i can easily debug the issue otherwise i have to recreate the project at my end.

    --

    Thanks & regards,
    Jagadish.

  • Hi Jagadish. 

    Please understand that I cannot share the entire project for security reasons.

    However, it is possible that some of the contents necessary for analysis can be shared on a limited basis.

     

    Best regards.

    Gene

  • Hi Jinwook,

    Just now i tested "checkPLL1Slip" code at my end and i don't see any issues and the code successfully executed the function "checkPLL1Slip"

    I am attaching my code here please take a look.

    PLL1_Slip_Detection_TEST_RM57.zip

    --

    Thanks & regards,
    Jagadish.

  • Hi. Jagadish.

    Thank you for your reply.

    I found my problem.

    I implemented safety manual according to example in "SafeTI Diagnostic Library\2.4.0\demo_app\HALCoGen\RM57L843_NoOS".

    I guess there is a problem in Example code.

    afterSTC() on HL_sys_startup.c in Example

     

    ESM_ApplicationCallback() in Example

    esmGroup1Handler() on sl_esm.c  in Example

    checkPLL1Slip() on faultInject.c in Example

    My problem is as follow. (Execution Sequence)

    1. ESM_ApplicationCallback() execution. ( ① )

    2. checkPLL1Slip() execution. ( ② )

    3. systemREG1->PLLCTL1 ^= 0x8000U;  on checkPLL1Slip().  ( ⑤ )

    4. Then, I expected to generate ESM PLL1 slip error signal. 

        However, PLL1 slip error signal generation is  after  "if((esmREG->SR1[0U] & 0x400U) != 0x400U)"  execution. ( ⑥ )

        So, PLL1 recovery code was not executed.

        After  "if((esmREG->SR1[0U] & 0x400U) != 0x400U)"  execution, ESM PLL1 slip error signal was generation lately. ( ③ , ④ )

    ----------------------------------------------------------------------------------------

    I think this problem may only be a problem with custom boards. 

    Please review this issue.

     

    Best regards.

    Gene.