MKL25 SPI de-initialize

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

MKL25 SPI de-initialize

跳至解决方案
1,402 次查看
psycho
Contributor I

My bootloader uses a SPI-Flash chip. If I have read from or written to the SPI bus in the bootloader, when I jump to my application code it does not run correctly. When it tries to wake from sleep (VLLS0), it either does not wake up or it gets stuck in the bootloader initialization - I am not sure which.

However, if I run the bootloader and I do NOT read/write to the SPI bus, the application code runs correctly. Even though the SPI bus is still being initialized in the PE code.

Anyone have any ideas on what to check next? I have tried SPI_Deinit() and that has no effect. The SPI module is running in polling mode.

Thanks!

标签 (1)
0 项奖励
回复
1 解答
1,271 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Kevin,

I think it will make the SPI stuck in the poll circuit without writing one to ACKISO bit to release the I/O pads after MCU wake up from the VLLS0 mode.

After adding the code to write one to this bit, how's it going?
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,271 次查看
psycho
Contributor I

I *think* I figured it out.... In the before PE init section of the CPU module, I had two lines in there for my main app. But I did not have them there for the bootloader.

  if (PMC_REGSC &  PMC_REGSC_ACKISO_MASK)

       PMC_REGSC |= PMC_REGSC_ACKISO_MASK;

0 项奖励
回复
1,272 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Kevin,

I think it will make the SPI stuck in the poll circuit without writing one to ACKISO bit to release the I/O pads after MCU wake up from the VLLS0 mode.

After adding the code to write one to this bit, how's it going?
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,271 次查看
psycho
Contributor I

I have put all the code back in and the device seems to be performing as expected. Thank you for the confirmation on the SPI detail!

0 项奖励
回复