When I debug to "MCG_C7_OSCSEL_VAL",the mcu will run to "HardFault_Handler".

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

When I debug to "MCG_C7_OSCSEL_VAL",the mcu will run to "HardFault_Handler".

ソリューションへジャンプ
2,426件の閲覧回数
bingee
Contributor I

I used MK60DN512ZVLQ10 and KSDK 2.0.0

There are some problems with this code.
When I debug to "MCG_C7_OSCSEL_VAL",the mcu will run to "HardFault_Handler".

What should I do?

file name :fls_clock.c
/*******************************************************************************
* Code
******************************************************************************/

static uint32_t CLOCK_GetMcgExtClkFreq(void)
{
uint32_t freq;

switch (MCG_C7_OSCSEL_VAL)
{
case 0U:
/* Please call CLOCK_SetXtal0Freq base on board setting before using OSC0 clock. */
assert(g_xtal0Freq);
freq = g_xtal0Freq;
break;
case 1U:
/* Please call CLOCK_SetXtal32Freq base on board setting before using XTAL32K/RTC_CLKIN clock. */
assert(g_xtal32Freq);
freq = g_xtal32Freq;
break;
default:
freq = 0U;
break;
}

return freq;
}

ラベル(1)
タグ(3)
0 件の賞賛
1 解決策
2,195件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

The KSDK2.0 doesn't support MK60DN512ZVLQ10.

According to Kinetis K 100MHz Rev 1.x to Rev 2.x Migration Guide, MK60DN512ZVLQ10 belong to Rev 1.x.

Part numbering and maskset information.png

Since your MCU doesn't have MCG_C7 Register, it will run to "HardFault_Handler".

MCG_C7 Register.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

2 返答(返信)
2,196件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

The KSDK2.0 doesn't support MK60DN512ZVLQ10.

According to Kinetis K 100MHz Rev 1.x to Rev 2.x Migration Guide, MK60DN512ZVLQ10 belong to Rev 1.x.

Part numbering and maskset information.png

Since your MCU doesn't have MCG_C7 Register, it will run to "HardFault_Handler".

MCG_C7 Register.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

2,195件の閲覧回数
bingee
Contributor I

Thanks for your help.谢谢帮助

0 件の賞賛