2025-11-06 2:17 PM
I've been trying to build example projects (i.e. Ux_Host_HID) with the make tool chain config with stm32cubeMX
So when i run make, a bunch of stuff compiles, then i get this error.
$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
$(AS) -c $(CFLAGS) $< -o $@
$(BUILD_DIR)/%.o: %.S Makefile | $(BUILD_DIR)
$(AS) -c $(CFLAGS) $< -o $@
Note: all files are generated from STM32CubeMX form their examples directory.
2025-11-10 3:04 AM - edited 2025-11-10 4:04 AM
Hello @William2003
Thank you for your valuable contribution.
I was able to reproduce the issue mentioned above
The issue has already been identified and escalated to the development team under internal ticket number 220146. It will be addressed and resolved as soon as possible.
I will keep you posted with updates.
THX
Ghofrane
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.
2025-11-10 8:29 AM
2025-11-10 1:04 PM
I think the initial challenge was to make sure that the correct set of assembly files are selected (ac6, gnu, iar). In my case I was compiling with gnu.
Some notes:
[1] OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
C_SOURCES ->list of fullpath/file.c -> i.e. /Middlewares/ST/threadx/common/src/txe_timer_delete.c Middlewares/ST/threadx/common/src/txe_timer_info_get.c
C_SOURCES:.c=.o) -> replaces .c for .o -> i.e. /Middlewares/ST/threadx/common/src/txe_timer_delete.o Middlewares/ST/threadx/common/src/txe_timer_info_get.o
notdir (...) -> removes path txe_timer_delete.o txe_timer_info_get.o
addprefix($(BUIL_DIR), $(...)) -> ADDs build/ -> i.e. build/txe_timer_delete.c build/txe_timer_info_get.c
[2] vpath %.c $(sort $(dir $(C_SOURCES)))
yields all unique paths .c sources to vpath -> i.e. Middlewares/ST/threadx/common/src/ Middlewares/ST/threadx/common/src/
looks like vpath directive is used to append those files. I'm thinking of appending those paths to the VPATH MAKE SHELL VARIABLE instead. When I run the make file and print VPATH, its empty.
Thanks for the feedback
2025-11-10 8:58 PM - edited 2025-11-10 8:58 PM
I think the reason why this is failing, is because there are 3 versions of these assembly files
/home/williamkolment/STM32Cube/Example/Ux_Host_HID/Middlewares/ST/threadx/ports/cortex_m7/gnu/src/
/home/williamkolment/STM32Cube/Example/Ux_Host_HID/Middlewares/ST/threadx/ports/cortex_m7/ac6/src/
/home/williamkolment/STM32Cube/Example/Ux_Host_HID/Middlewares/ST/threadx/ports/cortex_m7/iar/src/
one for each type of toolchain. So, I suspect the vpath directive(lowercase) is not working properly
i.e. these lines -> vpath %.s $(sort $(dir $(ASM_SOURCES)))
So instead, I appended a path to VPATH make shell variable each time theres duplicate sets of files
VPATH = Middlewares/ST/threadx/ports/cortex_m7/gnu/src
This FIXED THE COMPILATION ERRORS
I suspect, that STM32CubeMx is generating more files a than needed.