Phenomenon:
S32K144's system OSC(SOSC_CLK) is always not valid.
“ while(!(SCG->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK));” is running forever。
SOSCCSR.SOSCVLD is always 0.
The clock source code are as follows。
void SOSC_init_8MHz(void) {
SCG->SOSCDIV=0x00000101; /* SOSCDIV1 & SOSCDIV2 =1: divide by 1 */
SCG->SOSCCFG=0x00000024; /* Range=2: Medium freq (SOSC betw 1MHz-8MHz)*/
/* HGO=0: Config xtal osc for low power */
/* EREFS=1: Input is external XTAL */
while(SCG->SOSCCSR & SCG_SOSCCSR_LK_MASK); /* Ensure SOSCCSR unlocked */
SCG->SOSCCSR=0x00000001; /* LK=0: SOSCCSR can be written */
/* SOSCCMRE=0: OSC CLK monitor IRQ if enabled */
/* SOSCCM=0: OSC CLK monitor disabled */
/* SOSCERCLKEN=0: Sys OSC 3V ERCLK output clk disabled */
/* SOSCLPEN=0: Sys OSC disabled in VLP modes */
/* SOSCSTEN=0: Sys OSC disabled in Stop modes */
/* SOSCEN=1: Enable oscillator */
while(!(SCG->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK)); /* Wait for sys OSC clk valid */
}
Solved! Go to Solution.
The problem has been solved.
※The reason for the problem is the Crystal oscillator hardware problem.
Hello, cheng,
I also have this problem, do you how to solve this problem, can you share, thanks.
The problem has been solved.
※The reason for the problem is the Crystal oscillator hardware problem.
I also debug the S32K144 base software at present, can i ask you some questions. I am using the IAR IDE,when i realize CAN driver, it cann't enter the transmit complete interrupt service function. I want to know how did you do to enter the function,thank you.
数据发送后,IFLAG1寄存器有变化吗?
CAN相关的中断寄存器(NVIC, IMASK1)设置了吗?
Has the value of the IFLAG1 register changed after the data has been sent?
Is CAN's NVIC&IMASK1 set ?