-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
Description
In case anyone out there runs into this issue, and in case anyone wants to file a PR to address it.
The current FSL for Kinetis K64 is out of date. That hasn't generally been a problem, but when trying to bring up a custom board, mbed-os was getting stuck in this step in the mbed version of the FSL:
status_t CLOCK_SetExternalRefClkConfig(mcg_oscsel_t oscsel) {
...
MCG->C7 = (MCG->C7 & ~MCG_C7_OSCSEL_MASK) | MCG_C7_OSCSEL(oscsel);
if (kMCG_OscselOsc == oscsel)
{
if (MCG->C2 & MCG_C2_EREFS_MASK)
{
while (!(MCG->S & MCG_S_OSCINIT0_MASK))
{
}
}
}
if(needDelay)
...
After pulling the latest FSL from NXP, I noticed they removed this while loop. Looks like mbed has a buggy version of fsl_clock.c
FSL version:
status_t CLOCK_SetExternalRefClkConfig(mcg_oscsel_t oscsel) {
...
MCG->C7 = (MCG->C7 & ~MCG_C7_OSCSEL_MASK) | MCG_C7_OSCSEL(oscsel);
if(needDelay)
...
Using this version of fsl_clock.h, fsl_clock.c, my board boots to main no problem.
Issue request type
[ ] Question
[ ] Enhancement
[X ] Bug