6 years, 11 months ago.

FRDM K64F board startup code

I want to change the default system clock source on my K64F board. Apparently after reset it loads the clock configuration registers with values that will make the MCU use the 50Mhz external clock, but as I have disabled the external clock, I want to modify the configuration. Quote from NXP forum where I already asked this question, and was suggested to ask here as I'm using the Mbed IDE:

" I'm unsure where I should put those clock register changes. I'm using ARM mbed environment, and I cannot find the startup code where it modifies the clock. I have found system_MK64F12.c file and there is the SystemInit function which "is supposed" to configure the clocks, but there is no clock setting writes, only something related to watchdog timer. If I put your code there to modify clock configuration, nothing seems to happen. I have grep searched all library folders for anything related to MCG register writes but cannot find anything useful. I'm quite puzzled, as I have worked with STM32 micros before, and they have the clock startup configuration in SystemInit which is easy to modify."

Could it be that the SDA bootloader chip is doing the startup configuration, and I cannot modify it as it is a firmware?

1 Answer

6 years, 11 months ago.

hi,

what you are looking for is in BOARD_BootClockRUN() function. This one is called in the mbed overrides (later after SystemInit).