2020-08-17 06:51 AM
Hi all,
i realized that , printf doesnt work after wake up from sleep mode, i am using rtc to wake up mcu from sleep mode every minutes. Here is my structure config.
sAlarm.Alarm = RTC_ALARM_A;
sAlarm.AlarmDateWeekDay = 0x31; // Nonspecific
sAlarm.AlarmDateWeekDaySel = RTC_ALARMDATEWEEKDAYSEL_DATE;
sAlarm.AlarmMask = RTC_ALARMMASK_DATEWEEKDAY | RTC_ALARMMASK_HOURS | RTC_ALARMMASK_MINUTES;
sAlarm.AlarmSubSecondMask = RTC_ALARMSUBSECONDMASK_NONE;
sAlarm.AlarmTime.Hours = 0x0;
sAlarm.AlarmTime.Minutes = 0x0;
sAlarm.AlarmTime.Seconds = 0x0;
sAlarm.AlarmTime.SubSeconds = 0x0;
sAlarm.AlarmTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE;
sAlarm.AlarmTime.StoreOperation = RTC_STOREOPERATION_RESET;
Every one minute, this code works.
void HAL_RTC_AlarmAEventCallback(RTC_HandleTypeDef *hrtc)
{
__HAL_RTC_ALARM_EXTI_CLEAR_FLAG();
gsm_machine_debug("\r\nHAL_RTC_AlarmAEventCallback \r\n");
//send_data_flag = 1;
}
But if i put to mcu to sleep mode with debug window. This callback works still but printf is no longer working.
Does anyone have any advices about why it is not working ?
Best Regards ?
Volkan
Solved! Go to Solution.
2020-08-17 08:50 AM
clocks/baud rates are wrong, pins are not initialized?
Make sure the pins, clocks and peripheral are all reenabled, and configured suitably.
2020-08-17 08:50 AM
clocks/baud rates are wrong, pins are not initialized?
Make sure the pins, clocks and peripheral are all reenabled, and configured suitably.
2020-08-18 03:53 AM
you are right, i forgot to configure systemclock after woke up from stop mode. i want to ask another question if it is possible.
You have any documentation or links about to do's after wake up ? (it may be sound stupid question )
Best Regards,
Volkan.