BOSSARD Guillaume

LPC546xx - CLOCK_GetFlexCommClkFreq - Error report

Discussion created by BOSSARD Guillaume on Dec 12, 2017
Latest reply on Dec 17, 2017 by jeremyzhou

I would like to report an error in "CLOCK_GetFlexCommClkFreq function" of "fsl_clock.c" for LPC546xx.

Below my correction :

 

/* Get FLEXCOMM Clk */
uint32_t CLOCK_GetFlexCommClkFreq(uint32_t id)
{
    return (SYSCON->FCLKSEL[id] == 0U) ? CLOCK_GetFro12MFreq() :
           (SYSCON->FCLKSEL[id] == 1U) ? CLOCK_GetFroHfFreq() :
           //(SYSCON->FCLKSEL[id] == 2U) ? CLOCK_GetPllOutFreq()  : // original error !!!
           //(SYSCON->FCLKSEL[id] == 3U) ? CLOCK_GetI2SMClkFreq() : // original error !!!
           (SYSCON->FCLKSEL[id] == 2U) ? CLOCK_GetAudioPllOutFreq() : // my correction
           (SYSCON->FCLKSEL[id] == 3U) ? CLOCK_GetMclkClkFreq() : // my correction
           (SYSCON->FCLKSEL[id] == 4U) ? CLOCK_GetFreq(kCLOCK_Frg) : 0U;
}

 

Reference : UM10912 -> 7.5.37 Flexcomm Interface clock source select registers

Outcomes