Garbage Printing after wake up from STOP 2 mode - stm32l476rg
Hi,
We are working on STM32L476_NUCLEO board. We successfully entered and exit from STOP 2 mode upon RTC timer expiry. However, when we print a message after wake up, garbage is printed. Here is the code.
print ('Going to STOP 2 mode'); // Printed on console
USART2 -> CR1 |= 2;
/* Enter into STOP 2 Mode */
WRITE(0xE000ED10,
READ(0xE000ED10) | 1<<2
);temp32 = READ32(PWR_CR1);
WRITE32(PWR_CR1, temp32 | PWR_CR1_LPMS_STOP2);WFI_EXECUTE();
WRITE(
0xE000ED10,
0
);
WRITE(PWR_CR1, temp32);
/* Successfully returned from STOP 2 mode */
USART2 -> CR1 &= ~2;
print ('\r\nBack'); // Funny characters are printed.
Regards
#stm32l476 #stop-mode-2 #nucleo-stm