2022-03-08 05:34 AM
I have a project using both RTOS and LWIP. I updated my IDE today and the project will not compile I get the following error below that errno is declare multiple times. errno is only declared once in the project. Even if I create a project with RTOS + LWIP using CubeMX I get the same error. It will go away if I comment it out in sys_arch.c. Is there another solution.
c:\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127\tools\arm-none-eabi\bin\ld.exe: c:/st/stm32cubeide_1.3.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+dp/hard\libc_nano.a(lib_a-reent.o):(.bss.errno+0x0): multiple definition of `errno'; ./Middlewares/Third_Party/LwIP/system/OS/sys_arch.o:C:/Software/Firmware/EtherNetTest/Debug/../Middlewares/Third_Party/LwIP/system/OS/sys_arch.c:45: first defined here
collect2.exe: error: ld returned 1 exit status
Is there a work around without changing code in LWIP?
2022-03-15 08:56 AM
@Khouloud OTHMAN Experienced the same problem here with F4. It seems there is a bug in Micro Xplorer code generator. Workaround? Comment the line in sys_arch.c
2022-03-15 10:20 AM
Hello @Vahid Ajallooeian , @DCorn ,
First le me thank you for your feedback.
Actually, you're right, there is a build issue when generating code using STM32CubeIDE toolchain With activating both LWIP and FreeRTOS.
The error in the log, is due to a multiple definition of errno: one in sys_arch.c (Lwip) used when FreeRTOS is enabled and the other in newlib as STM32CubeIDE uses newlib which embeds the errno definition.
A similar issue was also reported by this post.
Noting this issue is uniquely reproduced when using STM32CubeIDE as a toolchain.
With this being said, this issue has been already reported internally to be fixed. I'll keep you posted with the updates.
Sorry for any inconvenience that this may cause and thank you for your contribution.
Khouloud.
2022-03-21 12:48 AM
You can either
More informatino about the GCC 10 Migration can be found here: https://gcc.gnu.org/gcc-10/porting_to.html