AnsweredAssumed Answered

Project runs with debugger, but will not run without debugger

Question asked by KEVIN KRATZER on Oct 18, 2018
Latest reply on Jul 24, 2019 by Erich Styger

What kind of set up problem is this?  The MKE02Z64VLD2 M0+ processor operates 2 SPI modules and PWM inverter output operate just fine when the debugger (Universal Multilink) is attached. If the debugger is removed with power on, the project works fine.  However, if the power is removed discharging the supply completely, upon power up the project will not run with no debugger attached).  Processor Expert was used to generate the projects inits.  The external 32.768 KHz crystal runs at frequency at high gain with a beautiful sine-wave.  The Kinetis Design Studio (Version: 3.2.0) is used for this project.

Kinetis Microcontrollers@@@##

Here is the Processor Expert clock initialization code:

/* System clock initialization */
/* ICS_C2: BDIV|=1 */
ICS_C2 |= ICS_C2_BDIV(0x01); /* Update system prescalers */
/* SIM_BUSDIV: ??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,BUSDIV=0 */
SIM_BUSDIV = 0x00U; /* Update system prescalers */
/* Switch to FEE Mode */
/* ICS_C2: BDIV=1,LP=0 */
ICS_C2 = (uint8_t)((ICS_C2 & (uint8_t)~(uint8_t)(
ICS_C2_BDIV(0x06) |
)) | (uint8_t)(
ICS_C1 = (ICS_C1_CLKS(0x00) | ICS_C1_RDIV(0x00));
while((ICS_S & ICS_S_IREFST_MASK) != 0x00U) { /* Check that the source of the FLL reference clock is the external reference clock. */
while((ICS_S & 0x0CU) != 0x00U) { /* Wait until output of the FLL is selected */
/*** End of PE initialization code after reset ***/


Manual:  Clock section begins on page 263.