2018-08-30 06:10 AM
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.
2018-08-30 08:03 AM
You can leave the pullup on all the time, unless you want to force re-enumeration from the software.
JW
2018-08-31 01:31 AM
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