Hello Dave,
yes, there are some changes for fsl_clock_manager.c in KSDK1.1 and KSDK1.2
Because of structure change for KSDK1.2 were added definitions for macro for clock manager critical section,
#if (USE_RTOS)
mutex_t g_clockLock;
#define CLOCK_SYS_LOCK_INIT() OSA_MutexCreate(&g_clockLock)
#define CLOCK_SYS_LOCK() OSA_MutexLock(&g_clockLock, OSA_WAIT_FOREVER)
#define CLOCK_SYS_UNLOCK() OSA_MutexUnlock(&g_clockLock)
#define CLOCK_SYS_LOCK_DEINIT() OSA_MutexDestroy(&g_clockLock)
#else
#define CLOCK_SYS_LOCK_INIT() do {}while(0)
#define CLOCK_SYS_LOCK() do {}while(0)
#define CLOCK_SYS_UNLOCK() do {}while(0)
#define CLOCK_SYS_LOCK_DEINIT() do {}while(0)
#endif
added system timer
#if FSL_FEATURE_SYSTICK_HAS_EXT_REF
uint32_t CLOCK_SYS_GetSystickFreq(void)
{
/* Use external reference clock. */
if (!(SysTick->CTRL & SysTick_CTRL_CLKSOURCE_Msk))
{
#if FSL_FEATURE_SYSTICK_EXT_REF_CORE_DIV
return CLOCK_SYS_GetCoreClockFreq() / FSL_FEATURE_SYSTICK_EXT_REF_CORE_DIV;
#else
return 0U;
#endif
}
else // Use core clock.
{
return CLOCK_SYS_GetCoreClockFreq();
}
}
#endif
different structure of FBE mode
CLOCK_HAL_SetFbeMode(MCG,
oscsel,
targetConfig->frdiv,
targetConfig->dmx32,
targetConfig->drs,
fllStableDelay,
&outClkFreq);
added new functionality for MCGIRCLK
if (targetConfig->irclkEnable)
{
if (kMcgIrcFast == targetConfig->ircs)
{
/* Update FCRDIV if necessary. */
CLOCK_HAL_UpdateFastClkInternalRefDiv(MCG, targetConfig->fcrdiv);
}
CLOCK_HAL_SetInternalRefClkMode(MCG, targetConfig->ircs);
while (targetConfig->ircs != CLOCK_HAL_GetInternalRefClkMode(MCG)) {}
}
and adding new functions for initialization OSC according to configuration, deinitialization, setting OSCERCLK for clock transition, initialization RTC OSC and its deinitialization.
More easier way than migrate project from KSDK1.1 to KSDK1.2 is create new one, but you can inspire by this general guide (for migration project), but there is no clock settings.
In additional, here could be also very useful discussion for you
Clock configuration with KDS3.0/KSDK1.2.0
Please, what do you use for MCU?
I hope it helps you,
Best Regards,
Iva
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------