2024-11-13 07:18 AM
Using STM32CubeMX (v6.12.1) with USB_OTG_HS enabled (as host) on an STM32F4.
On our device, we have the only OTG_HS_VBUS pin connected to the USB VBUS, and it is working correctly as a USB host. I was investigating if I can repurpose this pin (I guess probably not)... which led me to investigating the options in CubeMX.
The anomaly: changing whether the "Activate_VBUS" option is checked in CubeMX makes no difference in the generated firmware. (It only changes one line in the .ioc file.) And I can't find anything in the firmware that indicates the pin is being used.
Questions:
1. Is this a CubeMX bug? What does the setting do?
2. Is this pin actually being used?
3. If so, is there something in the firmware that indicates and/or controls that?
2024-11-18 01:47 AM
Hi @BMcDo.3
Which product are you using? You can implement VBUS sensing on your STM32F429x or F427x either by using the dedicated VBUS pin (PA9 or PB13) or any 5V tolerant pin with external interrupt functionality. Ensure that you handle the voltage levels correctly to avoid violating the AMRs of the pins. Check Management of VBUS sensing for USB device design - STMicroelectronics Community
Activate_VBUS checkbox naming might not explicitly indicate its purpose for VBUS sensing.
As stated in the article, when VBUS sensing feature is enabled, PA9 or PB13 should be configured as input (No pull up, no pull down). If still CubeMX does not configure it correctly, report to us with more details about the product etc.
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.
2024-11-18 07:58 AM
Our STM32F429x-based device acts only as a USB host (never USB device), and it connects only to USB devices which are not externally powered. (That is, our device as USB host provides power to any connected USB device.)
Does that mean that the feature controlled by this checkbox is not relevant or applicable to our device?
We set PB13 as push/pull output hi at startup, and never change it.
@FBL wrote:Activate_VBUS checkbox naming might not explicitly indicate its purpose for VBUS sensing.
So this "Activate_VBUS" checkbox controls the "VBUS sensing" feature? If so, it seems like a bad name to me. Agree? If so, can you/ST change that in CubeMX? If not, what am I missing?
Thanks.
2024-11-19 06:18 AM
Hi @BMcDo.3
Well, VBUS sensing could be used to detect various voltage thresholds related to USB operations, such as VBUS valid. But in host mode, the VBUS sensing pin is not required. The system can use the charge pump overcurrent flag to protect against electrical damage.
You are right, it is important to be aware of different naming conventions used in reference manuals "VBUS detection" or "VBUS pin" and in schematics "VBUS_FS." I will forward this request to MX team.
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.