MKL25 SPI de-initialize

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

MKL25 SPI de-initialize

Jump to solution
642 Views
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!

Labels (1)
0 Kudos
1 Solution
511 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
511 Views
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 Kudos
512 Views
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 Kudos
511 Views
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 Kudos