2025-07-14 8:35 AM
I'm working with the NUCLEO -F 446ZE MB1137 B-01 development board. My goal is to make a Virtual Com Port tunnel, where I plug in PA11/PA12 (USB device) to a PC and PB14/PB15 (USB host) to another product my company makes. I want to use the full speed (12 MBits/s) on both USB peripherals. It was very straight-forward to get the USB device to work using STM32CubeIDE, but no matter what I do I can't get the USB host to work. To isolate the problem, I removed the USB device completely and I’m currently only focusing on the USB host. I've added some logging here and there (using a sw bit-bang UART) e.g. in USBH_UserProcess, USBH_CDC_ClassRequest, OTG_HS_IRQHandler and in case of errors in MX_USB_HOST_Init. I have set PG6 high (right after the call to MX_USB_HOST_Init) to enabled VBUS on the CN13 connector (and measured 5 V on the 4th pin on a micro-USB to USB-A-female connector) and LED LD8 shows green light and LED LD7 (over-current indicator) never lights up. I'm using HSE 8 MHz and I make sure to multiply and divide it properly so that USB gets 48 MHz in the clock tree. Still, it seems the firmware is not reacting at all when I plug something into connector CN13. I've tried plugging in my company’s product, an FTDI USB-to-serial cable, and an optical mouse (its LED on the bottom did not light up). Does anybody know what I'm doing wrong?
Connectivity USB_OTG_HS:
External Phy: Disable (grayed out)
Internal FS Phy: Host_Only
Activate_SOF: Unchecked
Activate_VBUS: Unchecked
Speed: Host Full Speed 12MBit/s
Enable internal IP DMA: Disabled
Physical interface: Internal Phy
Signal start of frame: Disabled
User constants: None
USB On The Go HS End Point 1 Out global interrupe: Unchecked
USB On The Go HS End Point 1 In global interrupt: Unchecked
USB On The Go HS global interrupt: Checked. Prio 5, subprio 0
PB14 USB_OTG_HS_DM n/a Alternate Function Push Pull No pull-up and no pull-down Very High
PB15 USB_OTG_HS_DP n/a Alternate Function Push Pull No pull-up and no pull-down Very High
USB_HOST:
Class For HS IP: Communication Host Class (Virtual Port Com)
Class For HS IP: Disable (Grayed out; I can’t select anything else)
USBH_MAX_NUM_ENDPOINTS (Maximum number of endpoints): 2
USBH_MAX_NUM_INTERFACES (Maximun number of interfaces): 2
USBH_MAX_NUM_SUPPORTED_CLASS (Maximun number of supported class): 1
USBH_MAX_NUM_CONFIGURATION (Maximun number of supported configuration): 1
USBH_KEEP_CFG_DESCRIPTOR (Keep the configuration into RAM): Enabled
USBH_MAX_SIZE_CONFIGURATION (Maximun size in bytes for the Configuration Descriptor): 256 bytes
USBH_MAX_DATA_BUFFER (Maximun size of temporary data): 512 bytes
USBH_DEBUG_LEVEL (USBH Debug Level): 0: No debug message
USBH_USE_OS (Enable the support of an RTOS): Enabled
USBH_PROCESS_PRIO (The CMSIS-RTOS osPriority value specifies the priority for the USB Host thread): priority: normal (default)
USBH_PROCESS_STACK_SIZE (The CMSIS-RTOS stack size requirements in words): 128
Drive_VBUS_HS GPIO Output PG6 [USB_PowerSwitchOn[STMPS2151STR_EN]]
2025-07-14 10:00 AM
Hi @arnold_w
Did you test the same controller USB_OTG_HS using PB14/PB15 in device mode? If working without issues, you may refer to this example in host mode.
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.