2024-11-27 10:40 PM
Hi,
My test board can enter sleep mode OK, but doesn't wake up when PC13 goes high: (never reach __enable_irq())
void Sleep() {
__disable_irq();
SysTick->CTRL = 0;
// Enable WKUP4 (PC13)
PWR->WKUPEPR = PWR_WKUPEPR_WKUPEN4; // Enable WKUP4
PWR->WKUPCR = 0xFFFFFFFF; // Clear all wake-up flags
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
PWR->CR1 |= PWR_CR1_LPDS; // Low Power Deep Sleep
__DSB();
__ISB();
__WFI(); // Enter deep sleep
__enable_irq();
}