fsl_clock_manager.c has changed in SDKV1.2.0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fsl_clock_manager.c has changed in SDKV1.2.0

869 Views
DaveTonyCook
Contributor IV

Hi

 

The SDK V1.2.0 has changed significantly from V1.1.0 in particular I am interested to know what changes / bugs have been fixed in fls_clock_manager.c in v1.2.0 of the SDK

 

What do I need to be aware of if I want to copy this file into my v1.1.0 based project.

 

Thanks

Labels (1)
0 Kudos
3 Replies

446 Views
ivadorazinova
NXP Employee
NXP Employee

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

446 Views
DaveTonyCook
Contributor IV

Hi

We are using the K24F1M0 144 pin device

0 Kudos

446 Views
ivadorazinova
NXP Employee
NXP Employee

Hello Dave Tony Cook,

thank you for your response.

You probably have on mind K24FN1M0. KSDK 1.2 supports MK24FN1M0VDC12, MK24FN1M0VLL12, MK24FN1M0VLQ12.

So I recommend you use always the newest version.

I hope this helps,

Iva

0 Kudos