2017-11-19 12:26 PM
(I'm sorry if this is the wrong place to report this)
STM32CubeMX 4.23 (tested with MacOS High Sierra, Arch Linux x86_64 with x32 binary emulation) is generating spurious entries during Makefile generation (such as Src/main.c and various other files listed twice) which causes link errors such as:
'.../Src/usb_device.c:63: multiple definition of `MX_USB_DEVICE_Init'
build/usb_device.o:.../Src/usb_device.c:63: first defined here'
The temporary fix is to remove any multiple entries from the Makefile, then all compiles and links (apparently) correctly.
Apologies If there's something wrong with my setup that is causing this, granted I've seen it reported elsewhere when searching for solutions to these errors
#stm32cubemx #bug #4.232017-11-28 03:03 AM
I am also experiencing this problem.
2017-11-28 03:23 AM
Hello,
This issue is already raised internally to CubeMx team to fix it.
Thank you for your contribution.
Best Regards
Imen
2017-12-02 04:37 AM
I also experienced this problem on linux STM32Cube version 4.23.0. Oddly I generated a makefile in the Windows version 4.22.1, and it generated a Makefile that worked fine on linux, I only had to change the BINPATH to point to my gcc tools.
Thanks,
Mike
2018-01-19 06:37 AM
Running on Linux (Fedora 27) and I also have this duplicate source issue: Fixed it with this hack on /usr/local/STMicroelectronics/STM32Cube/STM32CubeMX/db/plugins/projectmanager/templates/Makefile.tpl
It's not nice but the sort removes duplicates.
# list of objects
OBJECTS = $(sort $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o))))vpath %.c $(sort $(dir $(C_SOURCES)))# list of ASM program objectsOBJECTS += $(sort $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o))))vpath %.s $(sort $(dir $(ASM_SOURCES)))2018-01-20 02:01 AM
Yep, that was reported, including the fact that SOURCES_DIR may contain also .c files (at least, main.c and stm32l1xx_it.c)
2018-02-12 06:18 AM
hello
richardbenson91477
,Evandro Teixeira,
Koivisto.Jyrki
andGuta_Ciucur.Vasile
,I confirm theissue of duplicated source files when CubeMX generates the code with makefile.
As you say, the workaround is to suppress every duplicated source files and it compiles and links successfully after.
Sorry for the inconvenience it may cause.
Our development teams are working on that point, I will keep you inform as soon as the correction is available in a CubeMX release.
BR. Jeanne
2018-02-13 08:31 PM
Excellent, thanks
On Mon, Feb 12, 2018 at 2:18 PM, Jeanne Joly <st-microelectronics@jiveon.com
2018-02-14 07:11 AM
OK thank you!
2018-02-14 09:37 AM
Finally! Thank you as well!
The real problem is, when
Koivisto.Jyrki
published this very handy hack, the reaction of the CubeMX developers was to hide the Makefile.tpl in the next (actual at the post date) version of the Cube. Fortunately, the software still looks for the file in it's designated folder and takes it into account if it finds it there, so you can place there the file from the previous version. I continued to work this way, thanks toKoivisto.Jyrki
. and to the programmer that kept this option alive. Thank you to both of them, is the reason that I still continue using STM32, despite you know what...