STM32F105 PA9/OTG_FS_VBUS Issues
ISSUE 1: PA9/OTG_FS_VBUS +5V Tolerance
When the STM32F105 is configured as a USB device, the PA9/OTG_FS_VBUS is used to detect the presense of a USB host.
ST Micro evaluation designs show the PA9/OTG_FS_VBUS pin connected to +5 VBUS through a zero ohm resistor.
ST Micro evaluation designs show the PA9/OTG_FS_VBUS pin connected to +5 VBUS through a zero ohm resistor.
There are two potential problems with this approach.
The first potential problem is that the PA9/OTG_FS_VBUS input, although it is 5V tolerant,
may be damaged (as per ST support) if connected to +5V when the STM32F105 VDD is 0V.
This may occur in both self powered and host powered applications.
This will occur in a self-powered application when power is switched off/unplugged
while the USB connection to the Host is still active.
This will occur in a host powered application during the time it takes the VDD regulator
to come up to it's regulated output voltage.
to come up to it's regulated output voltage.
Some designers have recommended a series resistor between the PA9/OTG_FS_VBUS pin and +5V VBUS.
See ISSUE 2. To avoid the potential to damage the PA9/OTG_FS_VBUS pin, ST support has recommeded
connecting the pin to VDD instead.
connecting the pin to VDD instead.
I have verified that this will work with USB application code as well as DFU bootloader mode.
One of the problems with this approach is that you lose the ability to detect the presense of the USB host
if you are a self-powered device.
One of the problems with this approach is that you lose the ability to detect the presense of the USB host
if you are a self-powered device.
In that case, I think the only solution is to drive PA9/OTG_FS_VBUS input from the output of a +3V3 LDO
(such as digikey AP7313-33SAG-7DICT-ND) which is powered from +5V VBUS.
(such as digikey AP7313-33SAG-7DICT-ND) which is powered from +5V VBUS.
ISSUE 2: PA9/OTG_FS_VBUS Current Sink
Take the evaluation design or your own design with the STM32F105
and put a milliamp-meter in-between PA9/OTG_FS_VBUS and +5V VBUS.
Plug and unplug your USB connection to the host up to 50 times.
Every once in a while, you'll see that the PA9/OTG_FS_VBUS input is sinking 45 mA.
Connect the PA9/OTG_FS_VBUS pin to +3V3 VDD and you'll also measure 45 mA.
This pin becomes a true 45 mA current sink.
If you happen to be in DFU mode and running the DFUse demo application
you'll see that you are in fact connected and the USB interface is still working properly.
Disconnect one lead from your meter and reconnect and you'll see that the pin is still sinking 45 mA.
The only way to stop this condition is to power down the STM32F105 and power up again
or you may have to power cycle a few times.
If you happen to have a 1K resistor in series with PA9/OTG_FS_VBUS and +5V VBUS
when this current sink condition is active,
the USB interface will not be active - no DFU boot loader,
no USB device application code will work.
Here's an experiment I tried while PA9/OTG_FS_VBUS pin is exhibiting this 45 mA current sink behaviour
and I am in DFU mode while connected to host running the DFUse application.
I have a 0-100 ohm potentiometer in series with PA9/ORG_FS_VBUS and +3V3.
If I set the series pot to 0 ohm, I measure 45 mA and USB is ACTIVE.
If while I measure the V at PA9 while increasing the R,
the USB will go inactive at PA9 V = 1.2V with 39 mA and 98 ohm R.
While monitoring V at PA9, the USB will remain inactive until I decrease R such
that PA9 V = 1.6V with a current into PA9 of 45 mA.
I'm waiting to hear back from ST support on this.
Will the STM32F105 be damaged if our device is powered up in a server application
and PA9/OTG_FS_VBUS pin is sinking 45 mA for 6 months straight?
Should we switch to the STM32F103 and lose the USB DFU cabibility? Questions and more questions.
The VBUS pin can be freed by disabling the VBUS sensing option.
This is done by setting the NOVBUSSENS bit in the OTG_FS_GCCFG register.
In this case the VBUS is considered internally to be always at VBUS valid level (5 V).
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本