2025-07-18 5:03 AM - last edited on 2025-07-18 6:10 AM by mƎALLEm
Hello everyone,
I’ve recently acquired two STM32H747I-DISCO boards to experiment with USB High-Speed host functionality, specifically using the ux_host_hub_hid_msc example (v3.3.0) provided in the STM32CubeIDE.
My goal is to test the Mass Storage Class (MSC) capability, specifically writing a file to a USB flash drive. However, after flashing the example to either board, the USB device is not detected when I insert the pen drive, and LED7 on the DISCO board turns on immediately.
According to the reference manual, LED7 should light up green when the ULPI PHY detects a USB connection and the board is acting as a host. In my case, this LED turns on even before connecting any USB device.
Also, this function writes a pin that is not set in the FW (GPIO Pin 5 Port H):
/**
* @brief Drive VBUS.
* state : VBUS state
* This parameter can be one of the these values:
* 1 : VBUS Active
* 0 : VBUS Inactive
* @retval Status
*/
void USBH_DriverVBUS(uint8_t state)
{
/* USER CODE BEGIN 0 */
/* USER CODE END 0*/
if (state == USB_VBUS_TRUE)
{
/* Drive high Charge pump */
/* Add IOE driver control */
/* USER CODE BEGIN DRIVE_HIGH_CHARGE_FOR_HS */
HAL_GPIO_WritePin(GPIOH, GPIO_PIN_5, GPIO_PIN_SET);
/* USER CODE END DRIVE_HIGH_CHARGE_FOR_HS */
}
else
{
/* Drive low Charge pump */
/* Add IOE driver control */
/* USER CODE BEGIN DRIVE_LOW_CHARGE_FOR_HS */
HAL_GPIO_WritePin(GPIOH, GPIO_PIN_5, GPIO_PIN_RESET);
/* USER CODE END DRIVE_LOW_CHARGE_FOR_HS */
}
HAL_Delay(200);
}
The USBH_DriverVBUS(USB_VBUS_TRUE) is called from the USBX_APP_Host_Init(VOID) function:
/**
* @brief USBX_APP_Host_Init
* Initialization of USB host.
* none
* @retval none
*/
VOID USBX_APP_Host_Init(VOID)
{
/* USER CODE BEGIN USB_Host_Init_PreTreatment_0 */
/* USER CODE END USB_Host_Init_PreTreatment_0 */
/* Initialize the LL driver */
MX_USB_OTG_HS_HCD_Init();
/* Initialize the host controller driver */
ux_host_stack_hcd_register(_ux_system_host_hcd_stm32_name,
_ux_hcd_stm32_initialize, (ULONG)USB_OTG_HS,
(ULONG)&hhcd_USB_OTG_HS);
/* Drive vbus */
USBH_DriverVBUS(USB_VBUS_TRUE);
/* Enable USB Global Interrupt */
HAL_HCD_Start(&hhcd_USB_OTG_HS);
/* USER CODE BEGIN USB_Host_Init_PostTreatment1 */
/* Start Application Message */
USBH_UsrLog("**** USB OTG HS HUB HID MSC Host **** \n");
USBH_UsrLog("USB Host library started.\n");
/* Wait for Device to be attached */
USBH_UsrLog("Starting HUB Application");
USBH_UsrLog("Connect your HUB Device");
/* USER CODE END USB_Host_Init_PreTreatment1 */
}
In fact, this pin corresponds to one input pins of the RAM memory:
screenshot from the design files MB1248-H747I-D03 (downloaded form ST)
Here’s my setup:
Am I missing something in the setup? I was expecting LED7 to remain off until a USB mass storage device is actually connected.
Any suggestions or guidance would be greatly appreciated. Thanks in advance!