2020-07-29 10:59 AM
I am trying to put STM32H743 into sleep mode using the following code
printf("Entering Sleep Mode\n");
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON , PWR_SLEEPENTRY_WFI);
printf("Exiting Sleep Mode\n");
I notice that my microcontroller dont go into sleep mode but it continue execution to the last printf instruction
the printf is mapped to use USB CDC,so it propagates to CDC_Transmit_FS() function which returns busy status after executing the HAL_PWR_EnterSLEEPMode() function
How could I overcome this problem?
Best Regards
Hossam Alzomor
2020-07-29 02:12 PM
If the USB is active, it's probably generating interrupts which wake up the system.
2020-08-03 10:02 PM
So , Should I disable the USB before going to Sleep Mode?
2020-08-04 12:12 PM
First read what a SLEEP and other low-power modes are and how they differ.
2020-08-05 01:26 AM
I have already did.
If you have something specific that you recommend me reading, kindly let me know.
2020-08-05 01:54 AM
RM0433 section 6.7 describes low-power modes pretty clearly. Read it over and over until you understand it. And keep in mind that terms matter - a CPU is not a MCU.