AnsweredAssumed Answered

DEVKIT-ZVL128. LIN Bootloader Master-node, stuck at Clock_init()

Question asked by chury jeong on Jan 29, 2018
Latest reply on Feb 5, 2018 by chury jeong

When I run "S12Z_LIN_MagniVBootloader_Translator" of AN5389SW on DEVKIT-ZVL128, 

PC(program counter) seems to be stuck at Clock_init(CLK_32_MHZ). 

 

void main(void) {
unsigned char dataCounter,phraseCounter;
CPMUVREGCTL_VREG5VEN = 1; /* 5v regulator */
Clock_init(CLK_32_MHZ); // Never return here. 
SCI1_init(32000000,19200); /* SCI1 is linked to PC communication */
MODRR0_SCI1RR = 1; /* TX ROUTED TO PT5 (white)/ RX ROUTED TO PT4(green) */
LIN_init();

...

 

in Clock.c, 

void Clock_init(unsigned char bus_clk){

CPMUOSC_OSCE = 0; /* Disable external oscillator */

if(bus_clk==CLK_8_MHZ){
//CPMUREFDIV_REFDIV = 3;
CPMUREFDIV_REFFRQ = 0;
CPMUSYNR_SYNDIV = 15;
CPMUSYNR_VCOFRQ = 1;
CPMUPOSTDIV_POSTDIV = 1;
}
else if(bus_clk == CLK_12_5_MHZ){
CPMUREFDIV_REFDIV = 3;
CPMUREFDIV_REFFRQ = 0;
CPMUSYNR_SYNDIV = 24;
CPMUSYNR_VCOFRQ = 1;
CPMUPOSTDIV_POSTDIV = 1;
}
else if(bus_clk == CLK_24_MHZ){
//CPMUREFDIV_REFDIV = 3;
CPMUREFDIV_REFFRQ = 0;
CPMUSYNR_SYNDIV = 47;
CPMUSYNR_VCOFRQ = 1;
CPMUPOSTDIV_POSTDIV = 1;
}
else{
//CPMUREFDIV_REFDIV = 3;
CPMUREFDIV_REFFRQ = 0;
CPMUSYNR_SYNDIV = 31;
CPMUSYNR_VCOFRQ = 1;
CPMUPOSTDIV_POSTDIV = 0;
}

while(CPMUIFLG_LOCK==0){} // Never return here. 

CPMURFLG = 0x60; /* Clear PORF and LVRF */
}

 

CPMUIFLG_LOCK seems not to be changed to "1". 

 

Question #1) 

- I did not changed any strap option on the EVM board since uppack. 

- Do I need to change some strap to make the EVM board work as LIN Master. 

- Why clock is not locked, please let me know the reason. 

Outcomes