2025-02-27 9:45 AM
This appears to be loosely related to
If I start with Cube IDE:
File -> New -> STM32 Project then select NUCLEO-C071RB and then Ux_Host_HID_Standalone
all goes swimmingly well. However, if I start with CubeMX, then choose the same example I get errors:
I can make the Platform Settings error go away by assigning a GPIO to who knows what, per the related post, but I don't want to waste a GPIO and furthermore, I want to make changes to the project that I cannot do using the IDE-only method. Is there some other setting I'm missing in the CubeMX example creation?
2025-02-27 12:01 PM
My best guess at the moment is that the CubeMX generated version requires the dummy GPIO for
void USBH_DriverVBUS(uint8_t state);
found in usbxh_platform.c .h
I don't see this function being called anywhere though.
2025-02-27 3:42 PM - edited 2025-02-27 3:42 PM
Drive_VBUS is not a dummy GPIO. It is the MCU output of the USB host that enables 5V power to the USB connector.
2025-02-28 2:12 AM
Hi @Grant Bt
It is simply a warning in CubeMX. In your case, external charge pump for VBUS voltage generation might be not necessary since a stable 5V supply is already available on the board.
According to schematics, if a stable 5V supply is already available, a basic power switch can be used instead of a charge pump "also called Drive_VBUS". The VBUS2 voltage is connected to U17 for overvoltage protection. Depending on the USB Host's power capability, the boards can draw power from the VBUS terminal of CN13. In the schematic, this power line is labeled as 5V_USB.
To conclude, you don't need to assign a GPIO unnecessarily.
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.
2025-02-28 7:39 AM - edited 2025-02-28 3:55 PM
Thanks, I will dig into this a little more. I understood the purpose for the USBH_DriverVBUS() function, but it's curious that the two project creation methods cause different results. If one edits the IOC from the instantly-functional-no-GPIO-IDE-created-project, then once again the requirement in CubeMX pops up whereby one needs to specify a GPIO for this. Using the IDE (v1.7) created technique, that function does not initially exist anywhere in the project, so it must be pulling files from somewhere else, or at least the catalog of files is different from starting with CubeMX. Honestly if would be nice to have an option in CubeMX to choose whether or not to require this (rather than a warning you can't dismiss without using a GPIO).
As you mention, in my case I may not use/need this kind of switch since the USB device MCU is embedded in the final product along with the C071 acting as host for it.
On my NUCLEO board U17 is not populated, so I never even noticed it before, so thanks for that too. I will research the electronics further.
One followup question if I may. ... would the QFP48 pin part also work as a USB host? I see conflicting online information. The block diagram does not indicate host. I guess I could build the firmware, but without hardware with that part I would not be able to test it.
2025-02-28 3:54 PM
Honestly if would be nice to have an option in CubeMX to choose whether or not to require this (rather than a warning you can't dismiss without using a GPIO).
I have not built projects to compare/contrast, but the Platform Settings error/warning appears only when
USBX Mode and Configuration -> Host Controllers FS
is checked. I don't know if that brings in other features or not, but will test next week.