Where is CLOCK_SetInternalRefClkConfig() in KL03 SDK 2.0?

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

Where is CLOCK_SetInternalRefClkConfig() in KL03 SDK 2.0?

ソリューションへジャンプ
1,197件の閲覧回数
chucksmith
Contributor II

Hello, I want to clock the LPTMR using the internal reference clock, but this does not work unless the internal reference clock is enabled, so I need to call CLOCK_SetInternalRefClkConfig(), per the SDK 2.0 API reference. But I cannot find CLOCK_SetInternalRefClkConfig anywhere in the 2.0 SDK.

 

Thanks

ラベル(1)
0 件の賞賛
返信
1 解決策
993件の閲覧回数
charlesasquith
NXP Employee
NXP Employee

I see what you mean. The code should work as intended if you use one of the predefined masks, such as kMCGLITE_IrclkEnable. On that note, however, I see that there is a 0U in BOARD_BootClockRUN's .irclkEnableMode, which is not a predefined mask and will have the affect you described.

To fix this, make sure you put one of the predefined masks (kMCGLITE_IrclkEnable or kMCGLITE_IrclkEnableInStop) into .irclkEnableMode and everything should work as intended. I will send this to the right people to get the 0U replaced with a mask, and see about getting the API reference manual updated.

With this in mind, I do believe that the steps outlined in my first reply should hold.

Best regards,

Charles

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
993件の閲覧回数
charlesasquith
NXP Employee
NXP Employee

Hi Chuck,


assuming you've filled out configuration structures already, then all you should have to do in terms of API is:
1. Call CLOCK_SetSimSafeDivs()

2. Call  CLOCK_SetMcgliteConfig(...)

3. Call  CLOCK_SetSimConfig(...)

Is this not the case?

Charles

0 件の賞賛
返信
993件の閲覧回数
chucksmith
Contributor II

After poking around a bit, I did find CLOCK_SetMcgliteConfig(), and that does the job. However, I am still surprised the API reference document for the SDK refers to a function, CLOCK_SetInternalRefClkConfig() that apparently does not exist.

Also, I believe there is an issue in CLOCK_SetMcgliteConfig(), in the following line of code:

    MCG->C1 = MCG_C1_CLKS(targetConfig->outSrc) | targetConfig->irclkEnableMode;

If irclkEnableMode is just a 0 or a 1, then the C1 bit this is loaded into is incorrect...it needs to be shifted into bit 1.

Thanks,

Chuck

0 件の賞賛
返信
994件の閲覧回数
charlesasquith
NXP Employee
NXP Employee

I see what you mean. The code should work as intended if you use one of the predefined masks, such as kMCGLITE_IrclkEnable. On that note, however, I see that there is a 0U in BOARD_BootClockRUN's .irclkEnableMode, which is not a predefined mask and will have the affect you described.

To fix this, make sure you put one of the predefined masks (kMCGLITE_IrclkEnable or kMCGLITE_IrclkEnableInStop) into .irclkEnableMode and everything should work as intended. I will send this to the right people to get the 0U replaced with a mask, and see about getting the API reference manual updated.

With this in mind, I do believe that the steps outlined in my first reply should hold.

Best regards,

Charles

0 件の賞賛
返信
993件の閲覧回数
chucksmith
Contributor II

Agreed - thanks.

0 件の賞賛
返信