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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
230 次查看
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 项奖励
1 解答
187 次查看
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.

在原帖中查看解决方案

2 回复数
188 次查看
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.

210 次查看
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 项奖励