Why SPI become abnormal when we runtime trim LPO clock in S32K148

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

Why SPI become abnormal when we runtime trim LPO clock in S32K148

Jump to solution
218 Views
Ferty
Contributor I

Hello, NXP support team

Our system have a s32k148 mcu and a SoC, MCU and SoC communication by SPI, SoC is master and MCU is slave.

Now we open MCU internal RTC and assign the clock as 1Khz LPO, but the clock is not accuracy, so we "runtime" adjust the trim value of LPO.

If the MCU need to adjust the trim value, it will call CLOCK_SYS_UpdateConfiguration
clockMan1_InitConfig0.pmcConfig.lpoClockConfig.trimValue = lpo_clock_trim_value;
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);

Sometimes after the MCU update the trim value, the SoC's SPI driver will crash.

MCU is SPI slave, so it will use the clock from master, why the MCU change LPO clock will let SPI crash?

What relationship between LPO clock and SPI?

0 Kudos
1 Solution
175 Views
Ferty
Contributor I

Hello, NXP support team

Sorry, it is our mistake. It is because we call this function CLOCK_SYS_UpdateConfiguration() to trim LPO. And this function will re-initiate SIRC and affect SPI connection. I think it is root cause. Thanks for your help.

View solution in original post

2 Replies
176 Views
Ferty
Contributor I

Hello, NXP support team

Sorry, it is our mistake. It is because we call this function CLOCK_SYS_UpdateConfiguration() to trim LPO. And this function will re-initiate SIRC and affect SPI connection. I think it is root cause. Thanks for your help.

198 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Ferty,

Could you share some information about your project? Which SoC are you utilizing as master? Is the slave MCU using an example from the SDK package? 

Just to be sure, you are using the SoC as master, and when the MCU changes LPO clock, the master's SPI driver crashes? Have you tried disabling the SPI module while the MCU changes the LPO clock just so the LPO configuration does not affect it?

Best regards,
Julián

 

0 Kudos