2024-05-02 10:10 PM
hi all currently i am working with stm32l051c8 , using that i can work with standby mode, its not entering to standby mode, can u guide me any one
if (__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET)
{
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB); // clear the flag
/** display the string **/
char *str = "Wakeup from the STANDBY MODE\n\n";
HAL_UART_Transmit(&huart2, (uint8_t *)str, strlen (str), HAL_MAX_DELAY);
/** Disable the WWAKEUP PIN **/
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN2); // disable PA0
}
/** Now enter the standby mode **/
/* Clear the WU FLAG */
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
/* Display the string */
char *str = "About to enter the STANDBY MODE\n\n";
HAL_UART_Transmit(&huart2, (uint8_t *)str, strlen (str), HAL_MAX_DELAY);
/* Enable the WAKEUP PIN */
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2);
/* one last string to be sure */
char *str2 = "STANDBY MODE is ON\n\n";
HAL_UART_Transmit(&huart2, (uint8_t *)str2, strlen (str2), HAL_MAX_DELAY);
/* Finally enter the standby mode */
HAL_PWR_EnterSTANDBYMode();