cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with IDE 1.9.0 and 1.10.0 with STMH7 RTOS + LWIP

DCorn
Associate III

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?

3 REPLIES 3

@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

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.

DeeFuse
Associate II

You can either

  • change the toolchain to GCC 9.3 in "C/C++ Build" > "Settings" > "Open Toolchain Manager"
  • add the "-fcommon" flag in "C/C++ Build" > "Settings" > "MCU GCC Compiler"

More informatino about the GCC 10 Migration can be found here: https://gcc.gnu.org/gcc-10/porting_to.html