AnsweredAssumed Answered

Custom bootloader, PLL issue when jumping to user application

Question asked by Andrew Darrow on Jul 7, 2016
Latest reply on Jul 11, 2016 by Andrew Darrow

We are using a custom board with a Kinetis K64. We have a custom bootloader which is a Processor Expert based project, and some of it is based on the Kinetis Bootloader. We also have a custom application which is a Processor Expert based project and uses MQX RTOS for KSDK 1.3.0.

 

The problem we are having is sometimes when we jump from the bootloader over to the application, we get stuck in a PLL loop in the startup code of the application. Here is the line of code that the application gets stuck on:

 

while((MCG->S & MCG_S_LOCK0_MASK) == 0x00U) { /* Wait until PLL is locked*/

 

This line of code is in the following file:

/OurProject/SDK/platform/devices/MK64F12/startup/system_MK64F12.c

 

Sometimes everything works fine and we get out of this loop and the application launches correctly. Other times it just sits there forever.

 

If we just flash in the application and run it without bootloader, the application starts every single time with no problems, so there is something wrong with our handoff from bootloader to app.

 

Does anyone have any idea what might be causing this problem?

Outcomes