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!
Solved! Go to Solution.
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!
-----------------------------------------------------------------------------------------------------------------------
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;
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!
-----------------------------------------------------------------------------------------------------------------------
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!