Adding USBX to a project doesn't update the MakeFile used by TouchGFX Designer
So I've opened a brand new project for the board STM32U5A9J-DK (ThreadX) via TouchGFX Designer. I generated the code and flashed into the board. No issue.
I opened the .ioc file, added the USB_OTG_HS and the USBX with the Audio Class. I've then generated the code with CubeMX. The code is correctly generated but the Makefile used by TouchGFX Designer is not updated. Once trying to compile and flash for the target, you'll have that the .h files are missing.
The fix is to manually add to the gcc/Makefile:
usbx_os_path := $(cubemx_middlewares_path)/ST/usbx
os_source_paths := \
AZURE_RTOS/App \
USBX/App \
$(cubemx_os_path)/common/src
os_include_paths := \
AZURE_RTOS/App \
USBX/Target \
USBX/App \
$(cubemx_os_path)/common/inc
# USBX source paths
usbx_source_paths := \
$(usbx_os_path)/common/core/src \
$(usbx_os_path)/common/usbx_device_classes/src \
$(usbx_os_path)/common/usbx_stm32_device_controllers
# USBX include paths
usbx_include_paths := \
$(usbx_os_path)/common/core/inc \
$(usbx_os_path)/common/usbx_device_classes/inc \
$(usbx_os_path)/common/usbx_stm32_device_controllers \
$(usbx_os_path)/ports/generic/incAnd, at the end in include_paths, $(usbx_include_paths)
