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.

AM263P4: PLL/Clock XTALCLK_OSC Status

Part Number: AM263P4

I am implementing a manufacturing test application.

If possible, I would like to read and report any status available concerning the crystal (XTALCLK_OSC), and the clocks generated by the PLL/Clocking.

For instance, SPRUJ55 Section 6.4 describes a Limp Mode “A dedicate coarse clock loss logic checks the XTAL clock against the RC CLK continuously to detect if the XTAL clock is toggling.”

However, I do not see any information in that section concerning registers that can be read.

SPRUJ55 section 6.4.5 Clocking Registers. Says: “For additional details related to device clocking registers, please refer to the Control - RCM Registers section.”

However, I do not see any information in that section that is related.

 

Please advise.

  • Hi Scott,

    CLKSRCSEL and CLKINUSE Registers can be checked to get the CLK source and status.

    #include <stdio.h>
    #include <kernel/dpl/DebugP.h>
    #include <drivers/hw_include/cslr_soc.h>
    #include <drivers/soc.h>
    #include <drivers/soc/am263x/soc_rcm.c>
    
    uint32_t base = CSL_TOP_RCM_U_BASE;
    
    static inline void
    App_readAndPrintRegValue()
    {
        // clksrcsel
        uint32_t pllCoreClkSrcSel;
        pllCoreClkSrcSel = HW_RD_REG32(base + CSL_TOP_RCM_PLL_REF_CLK_SRC_SEL) & CSL_TOP_RCM_PLL_REF_CLK_SRC_SEL_PLL_CORE_REF_CLK_SRC_SEL_MASK;
        DebugP_log("CSL_TOP_RCM_PLL_REF_CLK_SRC_SEL: 0x%x\r\n", pllCoreClkSrcSel);
    
        // clkinuse
        uint32_t r5ssClkStatus;
        r5ssClkStatus = HW_RD_REG32(base + CSL_TOP_RCM_R5SS_CLK_STATUS) & CSL_TOP_RCM_R5SS_CLK_STATUS_CLKINUSE_MASK;
        DebugP_log("CSL_TOP_RCM_R5SS_CLK_STATUS: 0x%x\r\n", r5ssClkStatus);
    }

    For frequency

    enum SOC_RcmPeripheralClockSource_e clkSrc = SOC_RcmPeripheralClockSource_XTALCLK;
    
    uint32_t clkFreq = SOC_rcmGetPeripheralClockFrequency(clkSrc);
    
    DebugP_log("Clock Frequency: %u\r\n", clkFreq);

    You can also checkout .../mcu_plus_sdk/source/drivers/soc/am263x/soc_rcm.c and soc_rcm.h for more info,
    and .../mcu_plus_sdk/source/drivers/hw_include/am263x/cslr_top_rcm.h for info on registers for clocks.

    Regards,
    Akshit