cancel
Showing results for 
Search instead for 
Did you mean: 

RTC wakeup fom standby problem

trevor23
Associate III
Posted on January 10, 2012 at 12:31

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?

1 REPLY 1
domen23
Associate II
Posted on January 11, 2012 at 08:23

Check SPI regs on first boot and after wakeup.

Maybe they're set in some weird way.

Maybe some clock isn't set.