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;
}
Solved! Go to Solution.
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.
Since your MCU doesn't have MCG_C7 Register, it will run to "HardFault_Handler".
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
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.
Since your MCU doesn't have MCG_C7 Register, it will run to "HardFault_Handler".
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks for your help.谢谢帮助