cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use a STM32F105 in USB device mode without the use of PA9 VBUS sensing pin?

Duempel
Associate

I am currently using a STM32F105 MCU configured to USB Device_Only mode by STM32CubeMX, including middlewares for communication device class (VCP).

Since I had to use the PA9 pin as an alternate function (USART1_TX), I've planed to use another GPIO for USB bus-voltage detection. Now I'm stuck getting the internal D+ pull-up controled by my application. It seems that the analog comparator on PA9 pin is directly driving the resistor if VBUSBSEN bit in GCCFG register is set. Is there any way to enable this pull-up or any other event which enables the resistor by software? I've only found the Soft Disconnect Bit (SDIS) in OTG_FS_DCTL which can remove this resistor.

2 REPLIES 2

You can leave the pullup on all the time, unless you want to force re-enumeration from the software.

JW

Duempel
Associate

Hi Jan,

can you tell me, how to turn on the pullup, without using the PA9 pin? I can not find any useful bits for this in the registers. Adding an external resistor to the DP line is also not an option, because I am using the same hardware in an other application as USB Host and do not have any other free ports to switch an external pullup on/off.

Thanks