With a B-L072Z-LRWAN1 discovery board. After a stop mode wake up using the RTC, I go back to the while(1) loop of the main fonction. But I'm blocked at the end of the loop. Do someone knows why ?
I'm sure that I don't go out of the loop cause I ask a led to blink if I exit the loop.
Here are my fonctions to enter and exit the stop mode.
void stm32l_lowPowerSetup(void)
{
HW_RTC_SetAlarm( 5000 );//5sec
__HAL_RCC_PWR_CLK_ENABLE(); // Enable Power Control clock
HAL_PWREx_EnableUltraLowPower(); // Ultra low power mode
HAL_PWREx_EnableFastWakeUp(); // Fast wake-up for ultra low power mode
// Disable Unused Gpios
_stm32l_disableGpios();
// Switch to STOPMode
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
}
void stm32l_lowPowerResume(void)
{
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
DBG_Init( );
HW_Init( );
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_RTC_Init();
MX_SPI1_Init();
MX_USART2_UART_Init();
MX_I2C1_Init();
MX_ADC_Init();
HAL_I2C_MspInit(&hi2c1);
EXTI->PR |= ( EXTI_PR_PR0 |EXTI_PR_PR1 |EXTI_PR_PR2 |EXTI_PR_PR3 |EXTI_PR_PR4 |EXTI_PR_PR5 |
EXTI_PR_PR6 |EXTI_PR_PR7 |EXTI_PR_PR8 |EXTI_PR_PR9 |EXTI_PR_PR10 |EXTI_PR_PR11 |
EXTI_PR_PR12 |EXTI_PR_PR13 |EXTI_PR_PR14 |EXTI_PR_PR15 |EXTI_PR_PR16 |EXTI_PR_PR17 |
EXTI_PR_PR19 |EXTI_PR_PR20 |EXTI_PR_PR21 |EXTI_PR_PR22 );
}