2018-03-20 06:35 AM
Hi everybody,
i'm tryng to wake up MCU STM32L051T6 from stop mode using a GPIO pin. The pin is PB4 on Rising edge.
This is the code:
void stopMode(void)
{ DBGMCU -> CR |= DBGMCU_CR_DBG_STOP;RCC -> APB1ENR |= RCC_APB1ENR_PWREN;
RCC -> IOPENR |= RCC_IOPENR_GPIOAEN;EXTI -> IMR |= EXTI_IMR_IM4;
EXTI -> RTSR |= EXTI_RTSR_TR4;NVIC_SetPriority(EXTI4_15_IRQn, 0);
NVIC_EnableIRQ(EXTI4_15_IRQn);PWR->CR |= PWR_CR_CWUF; // clear the WUF flag after 2 clock cycles
PWR->CR &= ~( PWR_CR_PDDS ); // Enter stop mode when the CPU enters deepsleep RCC->CFGR |= RCC_CFGR_STOPWUCK; // HSI16 oscillator is wake-up from stop clock SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; // low-power mode = stop mode __WFI(); // enter low-power mode}The isr never goes!
Can someboby help me?
Thanks
Damiano
#exit-stop #ll-gpio #exti #wake-upSolved! Go to Solution.
2018-03-20 07:14 AM
I resolved!
The problem was that i missed to select the source input for the EXTIx exernal interrupt. i Wrote the SYSCFG_EXTICR1 register with 0x01 and all works correctly
Thanks
2018-03-20 07:14 AM
I resolved!
The problem was that i missed to select the source input for the EXTIx exernal interrupt. i Wrote the SYSCFG_EXTICR1 register with 0x01 and all works correctly
Thanks