Skip to main content
fe3
Associate III
March 10, 2022
Solved

CubeIDE 1.9.0 FreeRTOS Advanced Settings -> USE_NEWLIB_REENTRANT Enabled Compile Fails

  • March 10, 2022
  • 8 replies
  • 11019 views

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

This topic has been closed for replies.
Best answer by Sara BEN HADJ YAHYA

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.

8 replies

fe3
fe3Author
Associate III
March 10, 2022

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

fe3
fe3Author
Associate III
March 10, 2022

Find attached an example project

Sara BEN HADJ YAHYA
ST Technical Moderator
March 10, 2022

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.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
Piranha
Principal III
March 23, 2022

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
fe3Author
Associate III
March 25, 2022

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
ST Employee
April 29, 2022

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 Technical Moderator
June 29, 2022

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.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
fe3
fe3Author
Associate III
June 30, 2022

Hello Sara,

Thanks for the information

Ferdinand