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
Thanks for your reporting, and I'll transfer it to SDK software team.
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------