AnsweredAssumed Answered

Freescale simple example leaves main()

Question asked by Cab Jones on May 27, 2012
Latest reply on May 29, 2012 by Cab Jones

CW 10.2 (1.0.0 upgrade) Win7x64 MC9S08LG32

 

Thefollowing program terminates with message

<terminated>SM_MC9S08LG32_PnE U-MultiLink [CodeWarrior Download]    
    <terminated, exit value: 0>C:\Users\John\workspace200\SM\MC9S08LG32\SM.abs (5/26/12 9:28 PM)   

 

void main(void) {  /* include your code here */
  SOPT1_COPE= 0; //Added this, doesn't help.  for(;;) {     __RESET_WATCHDOG(); /* feeds the dog */  } /* loop forever */  /* please make sure that you never leave main */}

It doesn't terminate in Debug mode--that would likely stop the COP, but that doesn't seem to be it.  What other kind of exit might Debug stop? Nor does it terminate if I add something useful like Send("Hello World"), like most programs would have.

 

What? Does our Smart Compiler "optimize out" the for loop?

 

-Cab-




Outcomes