KSDK 2.0 internal clock configuration on MKL25Z

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

KSDK 2.0 internal clock configuration on MKL25Z

ソリューションへジャンプ
1,719件の閲覧回数
gustavsl
Contributor III

I'm getting started with KSDK 2.0 and I'm having some troubling configuring a custom board using Kinetis KL25Z and no external crystal.

I want to run my application with the clock given by the internal oscillator. When I used Processor Expert, I could set it up using FEI mode and set the bus clock to 20.84MHz and the system clock to 41,68MHz.

I see there's a BootToFEIMode() function in fsl_clock.h, but none of the demo apps use this configuration.

How would I have to set up clock_config.h to achieve this?

 

Thanks,

 

Gustavo.

ラベル(1)
タグ(3)
0 件の賞賛
返信
1 解決策
1,554件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

The default mode for MCG is FEI mode, in the mode,

DMX32: 0

DRST_DRS: 00

 the FLL output clock is from 20MHz to 25MHz.

If you need that the FLL output 40~50MHz, you can set the DRST_DRS=01. Because the mode is the same, it is okay for you  to just change the DRST_DRS as 01.

Hope it can help you.

BR

Xiangjun Rong

元の投稿で解決策を見る

3 返答(返信)
1,555件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

The default mode for MCG is FEI mode, in the mode,

DMX32: 0

DRST_DRS: 00

 the FLL output clock is from 20MHz to 25MHz.

If you need that the FLL output 40~50MHz, you can set the DRST_DRS=01. Because the mode is the same, it is okay for you  to just change the DRST_DRS as 01.

Hope it can help you.

BR

Xiangjun Rong

1,554件の閲覧回数
gustavsl
Contributor III

Using the code above apparently worked.

The function CLOCK_GetBusClkFreq() returns 41943040, which is the bus frequency I was intending to achieve.

Thank you.

0 件の賞賛
返信
1,554件の閲覧回数
gustavsl
Contributor III

Hi, thank you for your response.

Would this BOARD_BootClockRUN() function work to initialize the clock that way or do I need to initialize anything else?

void BOARD_BootClockRUN(void) {

    const sim_clock_config_t simConfig = {
        .pllFllSel = 1U,        /* PLLFLLSEL select PLL. */
        .er32kSrc = 0U,         /* ERCLK32K selection, use LPO. */
        .clkdiv1 = 0x10010000U, /* SIM_CLKDIV1. */
    };

    CLOCK_SetSimSafeDivs();

    CLOCK_BootToFeiMode(kMCG_Dmx32Default,kMCG_DrsLow,NULL);
    CLOCK_SetInternalRefClkConfig(kMCG_IrclkEnable, kMCG_IrcSlow, 0);
    CLOCK_SetSimConfig(&simConfig);
}

Thank you,

Gustavo.

0 件の賞賛
返信