cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H5 NetXDuo examples fail to build

SiSte
Associate II

Hi,

I fail to compile the ethernet-related examples for the NULEO-H563ZI evalboard using STM32CubeIDE/GCC (v1.16.0). For instance, when building the example named "Nx_SNTP_Client" I get multiple "multiple definition of LAN8742..." :

...

arm-none-eabi-gcc -mcpu=cortex-m33 -g3 -DDEBUG -DTX_SINGLE_MODE_NON_SECURE=1 -c -x assembler-with-cpp -MMD -MP -MF"Application/User/Core/tx_initialize_low_level.d" -MT"Application/User/Core/tx_initialize_low_level.o" --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -o "Application/User/Core/tx_initialize_low_level.o" "C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Core/Src/tx_initialize_low_level.S"

arm-none-eabi-gcc "C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/AZURE_RTOS/App/app_azure_rtos.c" -mcpu=cortex-m33 -std=gnu11 -g3 -DDEBUG -DNX_INCLUDE_USER_DEFINE_FILE -DTX_INCLUDE_USER_DEFINE_FILE -DTX_SINGLE_MODE_NON_SECURE=1 -DUSE_HAL_DRIVER -DSTM32H563xx -c -I../../NetXDuo/App -I../../NetXDuo/Target -I../../Core/Inc -I../../AZURE_RTOS/App -I../../Drivers/STM32H5xx_HAL_Driver/Inc -I../../Drivers/STM32H5xx_HAL_Driver/Inc/Legacy -I../../Drivers/BSP/Components/lan8742 -I../../Middlewares/ST/netxduo/addons/dhcp -I../../Middlewares/ST/netxduo/common/drivers/ethernet -I../../Middlewares/ST/threadx/common/inc -I../../Drivers/CMSIS/Device/ST/STM32H5xx/Include -I../../Middlewares/ST/netxduo/common/inc -I../../Middlewares/ST/netxduo/ports/cortex_m33/gnu/inc -I../../Middlewares/ST/netxduo/addons/dns -I../../Middlewares/ST/netxduo/addons/sntp -I../../Middlewares/ST/threadx/ports/cortex_m33/gnu/inc -I../../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Application/User/AZURE_RTOS/App/app_azure_rtos.d" -MT"Application/User/AZURE_RTOS/App/app_azure_rtos.o" --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -o "Application/User/AZURE_RTOS/App/app_azure_rtos.o"

arm-none-eabi-gcc -o "Nx_SNTP_Client.elf" @"objects.list" -mcpu=cortex-m33 -T"C:\Users\s_steinkamp\STM32Cube\Example\Nx_SNTP_Client\STM32CubeIDE\STM32H563ZITX_FLASH.ld" --specs=nosys.specs -Wl,-Map="Nx_SNTP_Client.map" -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group

C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/BSP/STM32H5xx_Nucleo/lan8742.o: in function `LAN8742_RegisterBusIO':

C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:61: multiple definition of `LAN8742_RegisterBusIO'; ./Drivers/BSP/Components/lan8742.o:C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:61: first defined here

C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/BSP/STM32H5xx_Nucleo/lan8742.o: in function `LAN8742_Init':

C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:84: multiple definition of `LAN8742_Init'; ./Drivers/BSP/Components/lan8742.o:C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:84: first defined here

C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/BSP/STM32H5xx_Nucleo/lan8742.o: in function `LAN8742_DeInit':

C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:139: multiple definition of `LAN8742_DeInit'; ./Drivers/BSP/Components/lan8742.o:C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:139: first defined here

C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/BSP/STM32H5xx_Nucleo/lan8742.o: in function `LAN8742_DisablePowerDownMode':

C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:164: multiple definition of `LAN8742_DisablePowerDownMode'; ./Drivers/BSP/Components/lan8742.o:C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:164: first defined here

C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/BSP/STM32H5xx_Nucleo/lan8742.o: in function `LAN8742_EnablePowerDownMode':

C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:194: multiple definition of `LAN8742_EnablePowerDownMode'; ./Drivers/BSP/Components/lan8742.o:C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:194: first defined here

C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/BSP/STM32H5xx_Nucleo/lan8742.o: in function `LAN8742_StartAutoNego':

C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:224: multiple definition of `LAN8742_StartAutoNego'; ./Drivers/BSP/Components/lan8742.o:C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:224: first defined here

C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/BSP/STM32H5xx_Nucleo/lan8742.o: in function `LAN8742_GetLinkState':

C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:260: multiple definition of `LAN8742_GetLinkState'; ./Drivers/BSP/Components/lan8742.o:C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:260: first defined here

C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/BSP/STM32H5xx_Nucleo/lan8742.o: in function `LAN8742_SetLinkState':

C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:352: multiple definition of `LAN8742_SetLinkState'; ./Drivers/BSP/Components/lan8742.o:C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:352: first defined here

C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/BSP/STM32H5xx_Nucleo/lan8742.o: in function `LAN8742_EnableLoopbackMode':

C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:404: multiple definition of `LAN8742_EnableLoopbackMode'; ./Drivers/BSP/Components/lan8742.o:C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:404: first defined here

C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/BSP/STM32H5xx_Nucleo/lan8742.o: in function `LAN8742_DisableLoopbackMode':

C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:434: multiple definition of `LAN8742_DisableLoopbackMode'; ./Drivers/BSP/Components/lan8742.o:C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:434: first defined here

C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/BSP/STM32H5xx_Nucleo/lan8742.o: in function `LAN8742_EnableIT':

C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:474: multiple definition of `LAN8742_EnableIT'; ./Drivers/BSP/Components/lan8742.o:C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:474: first defined here

C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/BSP/STM32H5xx_Nucleo/lan8742.o: in function `LAN8742_DisableIT':

C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:514: multiple definition of `LAN8742_DisableIT'; ./Drivers/BSP/Components/lan8742.o:C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:514: first defined here

C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/BSP/STM32H5xx_Nucleo/lan8742.o: in function `LAN8742_ClearIT':

C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:553: multiple definition of `LAN8742_ClearIT'; ./Drivers/BSP/Components/lan8742.o:C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:553: first defined here

C:/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/BSP/STM32H5xx_Nucleo/lan8742.o: in function `LAN8742_GetITStatus':

C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:583: multiple definition of `LAN8742_GetITStatus'; ./Drivers/BSP/Components/lan8742.o:C:/Users/s_steinkamp/STM32Cube/Example/Nx_SNTP_Client/Drivers/BSP/Components/lan8742/lan8742.c:583: first defined here

collect2.exe: error: ld returned 1 exit status

make: *** [makefile:76: Nx_SNTP_Client.elf] Error 1

"make -j12 all" terminated with exit code 2. Build might be incomplete.




15:42:46 Build Failed. 15 errors, 0 warnings. (took 1m:41s.508ms)

 

The other examples that are ethernet-related behave comparably, I always get "multiple definition of" while linking.
I already tried to add the "-fcommon" flag to the compiler, but without success.
 
Any advice would be appreciated, I'm quiet new to the ThreadX world and have to implement a TCP server application. Minimal examples that actually compile would be a great help.
 
Kind regards
Simon
1 ACCEPTED SOLUTION

Accepted Solutions
STea
ST Employee

Hello @SiSte ,

can you try to open the project from C:\Users\your_name\STM32Cube\Repository\STM32CubeH5\Projects\NUCLEO-H563ZI\Applications\NetXDuo\Nx_SNTP_Client\
and compile it as i Don't seem ti get the same issue as you are describing even with version v1.3 of CubeFW

STea_0-1725271555371.png

Try to not import it from project selector in MX and tell me if you are able to compile.

Regards



In order 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.

View solution in original post

4 REPLIES 4
STea
ST Employee

Hello @SiSte ,

can you share with us the version of STM32H5Cube FW from which you extracted these examples?
as I have the Netxduo projects all compiling without errors on warning using IDE v1.16 and STM32H5Cube FW v1.2

STea_0-1725269554504.png

If you got this FW from Github make sure to use 

git clone --recurcive https://github.com/STMicroelectronics/STM32CubeH5.git

Regards

In order 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.
SiSte
Associate II

Hi and thanks for your reply,

I also run the IDE v1.16. I assume, that my FW Version is v1.3.0, as this is shown in the Cube Project Manager tab:

SiSte_0-1725270862447.png

I did not clone the example code on my own, as far as I recall, CubeMX downloaded it.

 

STea
ST Employee

Hello @SiSte ,

can you try to open the project from C:\Users\your_name\STM32Cube\Repository\STM32CubeH5\Projects\NUCLEO-H563ZI\Applications\NetXDuo\Nx_SNTP_Client\
and compile it as i Don't seem ti get the same issue as you are describing even with version v1.3 of CubeFW

STea_0-1725271555371.png

Try to not import it from project selector in MX and tell me if you are able to compile.

Regards



In order 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.
SiSte
Associate II

Hi STea,

apparently, this was at least part of the solution. What I did was cloning the H5Cube repo (recusively), create an empty project in the IDE and copy the files into it. Then the example builds as expected. As you assumed, the issue came with selecting the project example in MX and creating a project from it.

My issue is solved, thanks a lot.

Regards
Simon