Skip to main content
HAlzo
Associate III
July 29, 2020
Question

STM32H7 don't enter sleep mode,but CDC_Transmit_FS fails!!

  • July 29, 2020
  • 5 replies
  • 1167 views

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

This topic has been closed for replies.

5 replies

TDK
July 29, 2020

If the USB is active, it's probably generating interrupts which wake up the system.

"If you feel a post has answered your question, please click ""Accept as Solution""."
HAlzo
HAlzoAuthor
Associate III
August 4, 2020

So , Should I disable the USB before going to Sleep Mode?

Piranha
Principal III
August 4, 2020

First read what a SLEEP and other low-power modes are and how they differ.

HAlzo
HAlzoAuthor
Associate III
August 5, 2020

I have already did.

If you have something specific that you recommend me reading, kindly let me know.

Piranha
Principal III
August 5, 2020

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.