Codewarrior 56800 V8.0 Optimization problem (using processor expert)

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

Codewarrior 56800 V8.0 Optimization problem (using processor expert)

2,343 Views
hlsa
Contributor I
I'm currently working on a project using CodeWarrior 7.2 (with processor expert) using the highest optimization level (Level 4). This works pretty fine.
 
Now I tried to compile the same project with CodeWarrior 8.0 also using optimization level 4, but my program doesn't start. When I use the debugger and "break" debugging, it shows me that the program never leaves the entry code of the processor expert.
 
The entry code is:
Code:
void _EntryPoint(void){  /*** !!! Here you can place your own code before PE initialization using property "User code before PE initialization" on the build options tab. !!! ***/  /*** ### 56F8323 "Cpu" init code ... ***/  /*** PE initialization code after reset ***/  /* System clock initialization */  setRegBitGroup(OSCTL, TRIM, (word)getReg(FMOPT1)); /* Set the trim osc freq with factory programmed value */  setRegBit(OSCTL, CLK_MODE);          /* Select an internal oscillator mode */  clrRegBit(PLLCR, PRECS);             /* Select an internal clock source for the CPU core */  setRegBit(OSCTL, COPD);              /* External oscillator power-down */  setReg(PLLCR, (PLLCR_LCKON_MASK | PLLCR_ZSRC0_MASK)); /* Enable PLL, LCKON and select clock source from prescaler */  /* PLLDB: LORTP=2,PLLCOD=0,PLLCID=1,—–=0,PLLDB=0x3B */  setReg16(PLLDB, 0x213B);             /* Set the clock prescalers */   while(!getRegBit(PLLSR, LCK0)){}     /* Wait for PLL lock */  setReg(PLLCR, (PLLCR_LCKON_MASK | PLLCR_ZSRC1_MASK)); /* Select clock source from postscaler */  /* FMCLKD: ˜™=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,DIVLD=0,PRDIV8=1,DIV=0x12 */  setReg16(FMCLKD, 0x52);              /* Set the flash clock prescaler */   /*** End of PE initialization code after reset ***/  /*** !!! Here you can place your own code after PE initialization using property "User code after PE initialization" on the build options tab. !!! ***/  asm(JMP init_56800_);                /* Jump to C startup code */}

 
The program waits for PLL lock, which is the following line:
Code:
  while(!getRegBit(PLLSR, LCK0)){}     /* Wait for PLL lock */

 
To get my program running, I have to use optimization level 1.
 
Holger
Labels (1)
Tags (1)
0 Kudos
1 Reply

575 Views
piotrek
Contributor III
I have tried CW8 for DSC56800 on my CW4 project for 56F807. The program didn't work. To make it work I had to set optimization level to 0 and disable the peephole optimization. With the peephole optimization enabled, the program will run OK from an external RAM but not from the internal flash. The CW compiler, at least for 56800 parts, doesn't handle the pipeline dependencies properly and can generated a defective code.
I have created SR related to this problem and the problem has been confirmed.
 
I would expect the CodeWarrior team to provide some online access to a list of known problems. Or, if there are too many, just to recall the compiler and refund the many. And maybe some recompensation for the lost time - just a wish.
 
Piotr
0 Kudos