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

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

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

Jump to solution
1,175 Views
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;
}

Labels (1)
Tags (3)
0 Kudos
1 Solution
944 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

2 Replies
945 Views
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!
-----------------------------------------------------------------------------------------------------------------------

944 Views
bingee
Contributor I

Thanks for your help.谢谢帮助

0 Kudos