cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H5 NetXDuo examples fail to build

SiSte
Visitor

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
0 REPLIES 0