2024-01-03 1:22 AM
Dear community,
we're using a Makefile Project with STM32H5xx and NetX Duo using the LAN8742
When the code is generated, CubeMX is adding the line:
.../STM32Cube/Repository/STM32Cube_FW_H5_V1.1.1/Drivers/BSP/Components/lan8742/lan8742.c \
twice to the Makefile which leads to multiple definition errors in Compile.
The line has to be removed by Hand afterwards.
I think this is malicous behaviour here.
Best Regards
Pascal
Solved! Go to Solution.
2024-01-08 7:44 AM - edited 2025-03-05 7:07 AM
Thanks for bringing this issue to our attention.
I confirm this issue and I've reported internally.
Internal ticket number: 170199 (This is an internal tracking number and is not accessible or usable by customers).
PS: Issue solved on the last release of the STM32CubeMX
Best Regards.
STTwo-32
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.
2024-01-03 3:40 AM - edited 2024-01-03 4:07 AM
Hello @stst9180
I can't reproduce this problem. I'm using the last version of the STM32CubeIde (V 1.14.0). and CubeMX (V6.10.0).
Can you give more details (screenshots, firmware versions,...) .
Best Regards.
STTwo-32
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.
2024-01-03 5:33 AM - edited 2024-01-03 5:35 AM
I'm using CubeMX 6.1.0 and CubeIDE 1.13.2 but the version of IDE should not matter as bug is already in the cubemx-generated code. Below you see the cubemx configuration part of NETXDUO:
In ProjectManager I selected:
It seems that this one is only appearing in Makefile-Mode. Nevertheless this is needed for our project.
As I don't want to post the whole .ioc file here, I try to figure out the relevant parts:
MxCube.Version=6.10.0
MxDb.Version=DB.6.0.100
NETXDUO.ETH_ON=1
NETXDUO.IPParameters=ETH_ON,LAN_8742
NETXDUO.LAN_8742=1
NetXDuo.BSP.number=1
NetXDuo0.BSP.STBoard=false
NetXDuo0.BSP.api=BSP_COMPONENT_DRIVER
NetXDuo0.BSP.component=lan8742
NetXDuo0.BSP.condition=
NetXDuo0.BSP.instance=lan8742
NetXDuo0.BSP.ip=
NetXDuo0.BSP.mode=
NetXDuo0.BSP.name=LAN_Component
NetXDuo0.BSP.semaphore=SEMA_lan8742
NetXDuo0.BSP.solution=lan8742
ProjectManager.AskForMigrate=true
ProjectManager.BackupPrevious=false
ProjectManager.CompilerOptimize=6
ProjectManager.ComputerToolchain=false
ProjectManager.CoupleFile=true
ProjectManager.CustomerFirmwarePackage=
ProjectManager.DefaultFWLocation=true
ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32H563VITx
ProjectManager.FirmwarePackage=STM32Cube FW_H5 V1.1.1
ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
ProjectManager.HeapSize=0x200
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=true
ProjectManager.LibraryCopy=1
ProjectManager.MainLocation=Core/Src
ProjectManager.NoMain=false
ProjectManager.PreviousToolchain=STM32CubeIDE
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=BK_SM.ioc
ProjectManager.ProjectName=BK_SM
ProjectManager.ProjectStructure=
ProjectManager.RegisterCallBack=I2C,SPI,TIM,UART,USART
ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=Makefile
ProjectManager.ToolChainLocation=
ProjectManager.UAScriptAfterPath=
ProjectManager.UAScriptBeforePath=
ProjectManager.UnderRoot=false
VP_NETXDUO_VS_Crypto.Mode=Crypto
VP_NETXDUO_VS_Crypto.Signal=NETXDUO_VS_Crypto
VP_NETXDUO_VS_EthernetOoPhyOoInterface.Mode=LAN8742_Phy_Interface
VP_NETXDUO_VS_EthernetOoPhyOoInterface.Signal=NETXDUO_VS_EthernetOoPhyOoInterface
VP_NETXDUO_VS_NXOoCore.Mode=NX_Core
VP_NETXDUO_VS_NXOoCore.Signal=NETXDUO_VS_NXOoCore
VP_NETXDUO_VS_NetworkOoInterface.Mode=Ethernet_Interface
VP_NETXDUO_VS_NetworkOoInterface.Signal=NETXDUO_VS_NetworkOoInterface
VP_NETXDUO_VS_TLS.Mode=TLS
VP_NETXDUO_VS_TLS.Signal=NETXDUO_VS_TLS
When I now "generate code" the produced Makefile has twice the source file of the network driver:
/home/pascal/STM32Cube/Repository/STM32Cube_FW_H5_V1.1.1/Drivers/BSP/Components/lan8742/lan8742.c \
/home/pascal/STM32Cube/Repository/STM32Cube_FW_H5_V1.1.1/Drivers/BSP/Components/lan8742/lan8742.c \
which leads to:
usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: ../../Build/Release/lan8742.o: in function `LAN8742_RegisterBusIO':
lan8742.c:(.text.LAN8742_RegisterBusIO+0x0): multiple definition of `LAN8742_RegisterBusIO'; ../../Build/Release/lan8742.o:lan8742.c:(.text.LAN8742_RegisterBusIO+0x0): first defined here
Please tell me If I can post more needfull information. If you can't still reproduce I would generate a new project where I can post the corresponding files.
Best Regards Pascal
2024-01-03 7:48 AM
It will be better if you share a .ioc file that reproduce this behavior.
Best Regards.
STTwo-32
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.
2024-01-04 1:01 AM - edited 2024-01-04 1:01 AM
2024-01-08 7:44 AM - edited 2025-03-05 7:07 AM
Thanks for bringing this issue to our attention.
I confirm this issue and I've reported internally.
Internal ticket number: 170199 (This is an internal tracking number and is not accessible or usable by customers).
PS: Issue solved on the last release of the STM32CubeMX
Best Regards.
STTwo-32
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-21 7:12 AM - edited 2025-11-21 7:38 AM
This error/problem has returned on Ethernet examples in CubeMX for the STM32H573I-DK. However the makefile looks far different and does NOT have two lines relating to LAN8742. The error message is: ...STM32Cube/Example/Nx_MQTT_Client/Drivers/BSP/Components/lan8742/lan8742.c:61: multiple definition of `LAN8742_RegisterBusIO'; ./Drivers/BSP/Components/lan8742.o:C:/Users/dbaker/STM32Cube/Example/Nx_MQTT_Client/Drivers/BSP/Components/lan8742/lan8742.c:61: first defined here
I am using STM32CubeIDE 2.0.0 and STM32CubeMX 6.16.0
Suspect .ioc, and makefile (renamed to makefile.txt) attached.
2025-11-21 7:21 AM
Hello @LostIon
Thank you for posting.
I'm currently checking this behavior using STM32CubeIDE 2.0.0 and STM32CubeMX 6.16.0 , I will get back to you asap.
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.