2012-01-10 03:31 AM
I'm having a strange problem when waking up from standby mode via an RTC alarm. All works as expected when there is no bootloader. Once I start using my custom bootloader the chip wakes up on RTC alarm but stalls when configuring the SPI port in the bootloader. If starting noramlly (not from standby) there is no problem. If I run the applicattion without a bootloader there is no problem waking from standby on RTC alarm.
I have isolated the stall to a single line in the bootloader right at the end of the SPI init function where the SPI is enabled: #define CR1_SPE_Set ((u16)0x0040) SPI1->CR1 |= CR1_SPE_Set; When the problem occurs the code never gets past this line. I should add that the SPI peripheral works correctly when not starting from a RTC alarm wake up so I'm pretty sure the SPI is being configured correctly. Any ideas?2012-01-10 11:23 PM
Check SPI regs on first boot and after wakeup.
Maybe they're set in some weird way.Maybe some clock isn't set.