Hi,
I am trying to run some basic examples on an FS32K144HAT0MLFT that I have on a custom board. I installed the S32 Design Studio for ARM 2.2 Update 1 S32 SDK for S32K1xx SR RTM 3.0.3 and wanted to run the CAN 2.0 example. The example builds without issues, but the problem is in the SPLL_init_160MHz(void) function. When I step through the debugger the execution gets stuck on this line, looping endlessly:
while(!(SCG->SPLLCSR & SCG_SPLLCSR_SPLLVLD_MASK)); /* Wait for SPLL valid */
This is the whole function:
void SPLL_init_160MHz(void) {
while(SCG->SPLLCSR & SCG_SPLLCSR_LK_MASK); /* Ensure SPLLCSR unlocked */
SCG->SPLLCSR = 0x00000000; /* SPLLEN=0: SPLL is disabled (default) */
SCG->SPLLDIV = 0x00000302; /* SPLLDIV1 divide by 2; SPLLDIV2 divide by 4 */
SCG->SPLLCFG = 0x00180000; /* PREDIV=0: Divide SOSC_CLK by 0+1=1 */
/* MULT=24: Multiply sys pll by 4+24=40 */
/* SPLL_CLK = 8MHz / 1 * 40 / 2 = 160 MHz */
while(SCG->SPLLCSR & SCG_SPLLCSR_LK_MASK); /* Ensure SPLLCSR unlocked */
SCG->SPLLCSR = 0x00000001; /* LK=0: SPLLCSR can be written */
/* SPLLCMRE=0: SPLL CLK monitor IRQ if enabled */
/* SPLLCM=0: SPLL CLK monitor disabled */
/* SPLLSTEN=0: SPLL disabled in Stop modes */
/* SPLLEN=1: Enable SPLL */
while(!(SCG->SPLLCSR & SCG_SPLLCSR_SPLLVLD_MASK)); /* Wait for SPLL valid */
}
The example is the same one found in the "AN5413 - S32K1xx Series Cookbook - Application Note, 2.9 CAN 2.0"
Could that have something to do with the particular version of the S32K144 microcontroller? I am receiving the S32K144 EVB soon and I'll try it on that one as well. My primary need is to have CAN 2.0 Extended working.
If there are some other examples better suited for this, I'd be happy to try them.
Thanks in advance!