Unknown destination type (ARM/Thumb) link error in CubeIDE v2.1.1 (GNU tools 14.3.1)
- April 27, 2026
- 2 replies
- 113 views
Hi
I am using latest CubeMx Ver 16.7.0 and CubeIde Ver 2.1.1
while trying to compile a USB CDC code this error shows once i linked the code :
"
C:/Users/../../Hardware - General/../Electronics/../Software/USB_CDC_U0/USB_CDC_U0/Debug/../Core/Src/stm32u0xx_hal_msp.c:102:(.text.HAL_PCD_MspInit+0x4c): undefined reference to `MX_USB_CDC_Init'
C:/ST/STM32CubeIDE_2.0.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: (MX_USB_CDC_Init): Unknown destination type (ARM/Thumb) in ./Core/Src/stm32u0xx_hal_msp.o
C:/Users/../../Hardware - General/../Electronics/../Software/USB_CDC_U0/USB_CDC_U0/Debug/../Core/Src/stm32u0xx_hal_msp.c:102:(.text.HAL_PCD_MspInit+0x4c): dangerous relocation: unsupported relocation
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:65: USB_CDC_U0.elf] Error 1
"
the called the function "MX_USB_CDC_Init" exist in the USB/Class/CDC dir, and the H file hold the function prototype and referenced from the "stm32u0xx_hal_msp.c" file
I have attached the project
Please help
