cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Up STM32L452 as USB CDC Device with VBUS-Sense

TFels.1
Associate II

I'm working on a setup with a STM32L452RE and want to use the USB as a CDC-Device. I want to use the internal PullUp for D+ and the VBUS-sensing. I only find very unspecific Information about what i got to do in software.

Also which Pin to use (probably PA9) but i don't find any information about this in the reference manual or other documentation for the STM32L452.

4 REPLIES 4
gbm
Lead III

See the datasheet, AF tables. Still, I can't see too many reasons for VBUS sensing. If you turn on VBUS sensing in CubeMX, it will assign a proper pin for it automatically.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
TFels.1
Associate II

In the AF-Tabels in datasheet i can not find any info for VBUS-Sensing. Wheter at Port PA9 nor any other.

I can not find any configruations for VBUS sensing in CubeMX. I'm using CubeMX inside CudeIDE. Where to find this settings?

0693W00000Y8dLjQAJ.png 

Amel NASRI
ST Employee

Hi @TFels.1​ ,

Please refer to the 2 following resources:

Was suggested content helpful? If not, please let me know if you don't find the answer to your request and tell me what is missing.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi,

is it correct that i only need to connect the PIN PA9 to the voltagedivider mentioned in the AN 4879 and i'm done? Nothing else to configure but PA9 as Input?

That would be really simple.