cancel
Showing results for 
Search instead for 
Did you mean: 

USBX Host compilation errors on STM32U5G9J-DK2 with ThreadX + TouchGFX

Ameni
Associate III

Hello,

I am using the following official example as a reference:
https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/STM32U5x9J-DK/Applications/USBX/Ux_Host_HUB_HID_MSC

I tried to use the Ux_Host_HUB_HID_MSC project on STM32U5G9J-DK2 as a base and adapt it to my application (ThreadX + USBX + TouchGFX).

However, despite using this example, I am still facing compilation errors related to STM32 USB Host initialization.

Main errors:

  • _ux_hcd_stm32_initialize not declared

  • hhcd_USB_OTG_HS not declared

  • MX_USB_OTG_HS_HCD_Init() implicitly declared

These errors occur in app_usbx_host.c, when calling ux_host_stack_initialize().

This seems to be related to a STM32 USB HCD (USB OTG HS) configuration issue or missing / non-included source files compared to the official example.

Could you please advise:

  • which STM32 USB Host source files must be included?

  • whether a specific CubeMX configuration is required for USBX Host on STM32U5G9J-DK2?

  • or if some parts of the official example are not compatible with TouchGFX-based projects?

Thank you in advance for your help.

Best regards,

2 REPLIES 2
FBL
ST Employee

Hi @Ameni 

Did you generate your project code using STM32CubeMX? If yes, could you please share your .ioc file?

Also, if you are encountering compilation errors with the provided example project, please ensure that you cloned the repository using the --recursive option so that all submodules are properly fetched.

 

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.




Best regards,
FBL
Ameni
Associate III

Hello ,

Thank you for your response.

I have retrieved the official example code, which compiles correctly as is.

However, the CubeMX (.ioc) file associated with this example is not directly usable for my project. When I try to create a new CubeMX project and replicate all the settings, I encounter errors during code generation — exactly the same ones I mentioned previously during compilation.

As a result, I do not yet have a functional .ioc file for my project integrating ThreadX + USBX + TouchGFX. I do have the file, but it produces the same errors in CubeIDE, both when opening it and during code generation.

Please find my .ioc file attached for reference.

Thank you in advance for your help.

Best regards