2025-05-24 2:54 AM
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/inc
And, at the end in include_paths, $(usbx_include_paths)
2025-05-24 3:44 AM
Why you mean this isnt ok? You use MX and in project setup is position terget IDE or not? See you here TouchGFX?
Or simple button load to target stop basicaly work after you change preject system created by TGFX. No more.
2025-05-24 4:13 AM
Hi @MM..1
TouchGFX uses the Makefile to compile and flash into the target. The CubeIDE does not.
When the code and files are generated with CubeMX, CubeIDE is updated with the correct path to compile USBX as well.
TouchGFX Designer is unaware of that because the Makefile is not updated. So, when you compile and try to download the project within TouchGFX Designer, it can't compile because the whole USB include path is not added automatically to the Makefile.
Hope it clarifies the issue