2017-07-27 12:55 AM
I have a problem with STM32F756 USB CDC (HS with FS PHY) device and core sleeping. I isolated all other code and left only the USB driver and main loop calling WFI instruction. If there is no call to WFI, USB is working properly, but if I call WFI in the main loop, USB stops responding. USB clock is not stopped on entering in sleep. Any advise?
#__wfi #stm32f7 #sleep #usbSolved! Go to Solution.
2017-07-31 03:14 PM
Hi ,
Please check my reply 5 year ago ( Dec 2012) on first STM32F2 having similar behavior
If the same, we will ensure that the new code/ example is fixig it in definitive way.
Let us know if it helps.
Cheers
STOne-32.
2017-07-31 11:24 AM
I am seeing the same thing with STM32F446. __WFI() in my idle task worked fine on my old board that used the OTG_FS IP. But I switched to a new board with the OTG_HS with internal FS phy connected and now USB device won't work if I have the __WFI() in my idle task. Is there an errata for this?
2017-07-31 03:14 PM
Hi ,
Please check my reply 5 year ago ( Dec 2012) on first STM32F2 having similar behavior
If the same, we will ensure that the new code/ example is fixig it in definitive way.
Let us know if it helps.
Cheers
STOne-32.
2017-08-01 07:26 AM
,
,
to_deletelullaby techie
‌ that worked perfectly.Here is my new code for sleeping. I could probably just set the registers one and done someplace I suppose.
/* Disable OTGHSULPILPEN and enable OTGHSLPEN per https://community.st.com/0D50X00009XkaYoSAJ
,
__HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_DISABLE(),,
__HAL_RCC_USB_OTG_HS_CLK_SLEEP_ENABLE(),,
/* Prepare to sleep until interrupt */,
SCB->,SCR &,= (uint32_t) (~((uint32_t) (SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk))),,
__WFI(),2017-08-01 11:04 AM
Thank you!
Everything works now.