cancel
Showing results for 
Search instead for 
Did you mean: 

VBUS sensing not working at Stop Mode

KMats.2
Associate

I'm used mcu stm32l476vg.

I'll have to low power mode.

It is in low power mode using the following API.

HAL_PWR_EnterSTOPMode(PWR_MAINREGULATOR_ON, PWR_STOPENTRY_WFI);

But although it is in low power mode, it does not return by USB insertion.

I ask for your help...

1 REPLY 1

You would need to set up EXTI line 17 and then whatever settings within the OTG module to get the OTG_FS_WKUP signal going. I am not sure what exactly that requires and the documentation is not crystal clear. Maybe there are examples, I did not search.

It's probably much easier to set the pin to which VBUS is connected, as an EXTI interrupt directly, without the involvement of the OTG module. There won't be wakeup upon host-initiated suspend resume (without pulling/inserting the cable), but you didn't say you'd need that.

JW