AnsweredAssumed Answered

RTC wakeup fom standby problem

Question asked by Trevor on Jan 10, 2012
Latest reply on Jan 11, 2012 by Domen Puncer
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?

Outcomes