arch/arm/src/stm32h5/stm32_usbdrdhost.c: Fixed Hub support

Fixed a few bugs in the initial stm32_usbdrdhost.c implementation
when using a USB hub. Fixed fault when freeing control endpoints.
Fixed crash when disconnecting devices from hubs due ot use after free.

Signed-off-by: daniellizewski <daniellizewski@geotab.com>
This commit is contained in:
daniellizewski
2026-04-09 13:49:50 -04:00
committed by Xiang Xiao
parent 3e570aa219
commit 1632beaede
4 changed files with 122 additions and 40 deletions
@@ -54,4 +54,5 @@ CONFIG_STM32H5_USE_HSE=y
CONFIG_SYSTEM_NSH=y
CONFIG_TASK_NAME_SIZE=0
CONFIG_USART3_SERIAL_CONSOLE=y
CONFIG_USBHOST_HUB=y
CONFIG_USBHOST_MSC=y
@@ -151,6 +151,16 @@ int stm32_usbhost_initialize(void)
uinfo("Register class drivers\n");
#ifdef CONFIG_USBHOST_HUB
/* Initialize USB hub class support */
ret = usbhost_hub_initialize();
if (ret < 0)
{
uerr("ERROR: usbhost_hub_initialize failed: %d\n", ret);
}
#endif
#ifdef CONFIG_USBHOST_MSC
/* Register the USB mass storage class class */