Hi together
We have a prototype pcb with a S32K148_144 MCU on it.
I took a sample program, which runs without problems on the Eval Board S32K148EVBQ176.
But on our prototype pcb, the function CLOCK_SYS_UpdateConfiguration() fails with an TIMEOUT. As a result, the program runs into defaultISR (file startup_S32K148.s line 374) after this functioncall.
Does anybody have a hint or a solution?
Sample project is attached.
reagrds
Mario
Solved! Go to Solution.
Hi Daniel
We checked again the clock settings. Then we found out that we accidentally used a 16MHz crystal instead of a 8MHz crystal.
Another point was to set the correct "HIGH Gain Oscillator Select"-Setting according to the manual.
With these correct settings, we were able to run our program on our prototype PCB.
We tried out the fault handling already before. There the PC was always pointing on a library function. But it didn't give a hint about the real error.
But for the moment our problem is solved.
Thank you
regards
Mario
Hi Mario,
Sorry for the late response.
I have just run you project and could reproduce the fault on S32K148_144 EVB.
As you can see below, it is a precise bus fault at address 0x40049068.
When the PINS driver is initialized, the PORTA PCC clock is gated off.
The CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT); function returns STATUS_TIMEOUT because the SOSC module clock cannot be validated.
Do you use an External clock generator or a crystal with the internal SOSC.
Because in the project, you selected external External clock source.
If crystal, then change the configuration to External crystal oscillator instead.
Thank you,
Regards,
Daniel
Hi Daniel
Thanks for your answer.
I changed the configuration to External crystal oscillator.
But there is still an error present. If I want to step throug the main program, the program runs into default ISR (file startup_S32K148.s line 377) within CLOCK_SYS_UpdateConfiguration(). If I check then the registers, I can see the following:
So there seems to be still a problem with the SOSC module?
regards
Mario
Hi Mario,
An instruction bus error, but hard to say what is the cause.
Have you changed the optimization level?
You can try to get the PC address of the instruction as explained here: Fault handling on S32K144.
Cortex™ M4 Devices Generic User Guide
Regards,
Daniel
Hi Daniel
We checked again the clock settings. Then we found out that we accidentally used a 16MHz crystal instead of a 8MHz crystal.
Another point was to set the correct "HIGH Gain Oscillator Select"-Setting according to the manual.
With these correct settings, we were able to run our program on our prototype PCB.
We tried out the fault handling already before. There the PC was always pointing on a library function. But it didn't give a hint about the real error.
But for the moment our problem is solved.
Thank you
regards
Mario