cancel
Showing results for 
Search instead for 
Did you mean: 

CubeIDE 1.9.0 FreeRTOS Advanced Settings -> USE_NEWLIB_REENTRANT Enabled Compile Fails

fe3
Associate III

Processor STM32F746ZGT

Hello,

When I use FreeRTOS (CMSIS_V2) in STM32CubeIDE 1.9.0, I get the prompt when generating code (as in the previous versions):

The USE_NEWLIB_REENTRANT must be set in order to make sure that newlib is fully reentrant.  The option will increase the RAM usage. Enable this option under FreeRTOS > Advanced Settings > USE_NEWLIB_REENTRANT

If I perform the requested setting, as I did in the previous versions, the code is generated without any hint. However, when compiling, I get the following error message:

c:\st\stm32cubeide_1.9.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.9.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+fp/hard\libc.a(lib_a-reent.o):(.bss.errno+0x0): multiple definition of `errno'; ./Middlewares/Third_Party/LwIP/system/OS/sys_arch.o:D:/uni/Microconsult/STM32/CubeIDE/10-lwipDemo/Debug/../Middlewares/Third_Party/LwIP/system/OS/sys_arch.c:45: first defined here
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:78: 10-lwipDemo.elf] Error 1

Do I need to perform any additional setting on the linker ?

Regards

Ferdinand

1 ACCEPTED SOLUTION

Accepted Solutions
Sara BEN HADJ YAHYA
ST Employee

Hello @fe3​ ,

Thanks for your feedback,

I reproduced the issue and I confirm that using LWIP with FreeRTOS generate multiple definition error.

The issue is reported to the dev team to be fixed. I will keep you posted with the updates.

Internal ticket number: 124192 (This is an internal tracking number and is not accessible or usable by customers).

If your issue is solved or reported, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly 🙂

Thanks for your contribution,

Sara.

View solution in original post

8 REPLIES 8
fe3
Associate III

I just discovered that the problem arises in connection with RTOS and lwip.

fe3
Associate III

Find attached an example project

Sara BEN HADJ YAHYA
ST Employee

Hello @fe3​ ,

Thanks for your feedback,

I reproduced the issue and I confirm that using LWIP with FreeRTOS generate multiple definition error.

The issue is reported to the dev team to be fixed. I will keep you posted with the updates.

Internal ticket number: 124192 (This is an internal tracking number and is not accessible or usable by customers).

If your issue is solved or reported, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly 🙂

Thanks for your contribution,

Sara.

https://github.com/STMicroelectronics/STM32CubeH7/blob/b340b13929e36a3427b8d94e8b1006022f82273f/Middlewares/Third_Party/LwIP/system/OS/sys_arch.c#L45

That errno should not be there at all! As many things, it is there just because of some fantasies of incompetent developers.

fe3
Associate III

Thanks for the notice. I have tested it. If I comment out the definition, the program can be created successfully and it works. The disadvantage is that after each code generation with CubeMX the change has to be done again.

Bino
Senior

If you want to have this change permanent, you can do it at this location C:\Users\xxxxxxx\STM32Cube\Repository\STM32Cube_FW_Fxx_Vx.xx.x\Middlewares\Third_Party\LwIP\system\OS

Sara BEN HADJ YAHYA
ST Employee

Hello @fe3​ , @Piranha​ , @Bino​ 

This issue is fixed in STM32CubeMX latest release.

V6.6.0 is now available under this Link.

Thanks for your contribution.

Sara.

fe3
Associate III

Hello Sara,

Thanks for the information

Ferdinand