KBOOT launching application problems (MK22)

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

KBOOT launching application problems (MK22)

681 Views
thcooke77
Contributor III

I have been struggling getting my application to boot after programming from KBOOT sometimes. I am using KDS3.0 and KSDK1.3

My application will sometimes hang at in the startup_MK22F51212.c file at the second  while loop:

  /* Check that the source of the FLL reference clock is the requested one. */

  if (((SYSTEM_MCG_C1_VALUE) & MCG_C1_IREFS_MASK) != 0x00U) {

    while((MCG->S & MCG_S_IREFST_MASK) == 0x00U) {

    }

  } else {

    while((MCG->S & MCG_S_IREFST_MASK) != 0x00U) {

    }

  }

I would imagine it is caused by the different clocking schemes used by the bootloader and my application.

Has anyone else encountered this problem? Is there any more documentation which explain the clock settings in the Bootloader Configuration Area (BCA)?

In my application I use the internal IRC 48MHz clock, PEE, with the PLL output set to 96MHz. The FLL module is disabled.

Thanks,

Terry Cooke

Labels (1)
0 Kudos
1 Reply

425 Views
mjbcswitzerland
Specialist V

Terry

I have many uTasker serial loader users (including KBOOT mode) who have difficulties with working with MQX (in particular) or KSDS projects (less).

The main issue is that the clock configuration in these environments (sometimes (?) - since it is not alway a problem) assumes that the clock module is in its reset configuration state and fails (hangs) when this is not the case - it is however generally consistent and not random in nature.

The simpest workaround is to ensure that the boot loader clock settings are the same as the application will finally be using and jump past the application clock configration since it is then redundant.

Or a check of the setting can be made (eg. a status check of the clock source/switch settings) and either the clock configuration is executed (when it is seen that it is in the reset state) or else jumped when not.

Regards

Mark

0 Kudos