Hi, last week I had my project working perfectly in Keil 22.214.171.124 generated from STM32 Cube Mx 4.7, i'm using an STM32F103C8T6 for an univercity project. Per a professor request i had to add usb communication with a serial monitor, so i went and added the pins in cube mx and enabled the usb middleware as CDC (virtual com) , then generated the new code. BTW all my code is inside the "user code" sections in the generated main.c file (and i checked that nothing was deleted). Problem is that when de compiling the linker encounters "symbols multiply defined" and points at two files, example below:
blink basico\blink basico.axf: Error: L6200E: Symbol USB_ActivateEndpoint multiply defined (by stm32f1xx_ll_usb_1.o and stm32f1xx_ll_usb.o).
Files are stm32f1xx_ll_usb_1.o and stm32f1xx_ll_usb.o . The "_1" makes me think that it is creating a copy of the original file, however, even if I delete both files it creates them againg and gives the same error.
All this started happenig when I added the usb support in CUBEMX, the previous version of the project compiles without errors.
That's clearly a bug in CubeMX then. You'll have to ask there.
Marcoccio said:Files are stm32f1xx_ll_usb_1.o and stm32f1xx_ll_usb.o .
Those are object files; ie, the files that the compiler creates from translating your source files.
The corresponding source files would be stm32f1xx_ll_usb_1.c and stm32f1xx_ll_usb.c
Marcoccio said:makes me think that it is creating a copy of the original file
Which "it" are you referring to?
The compiler will create an object file for each & every source file in your project (unless you specifically exclude them) - so, if you have multiple copies of the same source file, you will get multiple copies of the object file!
And, if you have multiple copies of an object file, you will get multiple definitions when the Linker links them together!
Broeker said:a bug in CubeMX
Or an error / mis-configuration in the CubeMX Project.
View all questions in Keil forum