Skip to main content
Rajeev Arora
Senior
December 6, 2021
Solved

STM32CubeMX version 6.4.0 generates code with missing REENT.H file

  • December 6, 2021
  • 2 replies
  • 6972 views

..

Best answer by Khouloud ZEMMELI

Hi again @Rajeev Arora​ ,

Thank you for providing your ioc file, it helped me to reproduce the problem.

Actually, it's a normal behavior, in fact, when USE_NEWLIB_REENTRANT is enabled when using Keil or IAR toolchain, CubeMx project compilation will fail : "cannot open source file "reent.h".

For that, the USE_NEWLIB_REENTRANT parameter must be Disabled with EWARM OR MDK-ARM.

(There's a warning when you generate your project, mentioning the information)

Hope my answer helped you :) 

Khouloud

2 replies

Rajeev Arora
Senior
December 6, 2021

Hello @Khouloud ZEMMELI​ 

STM32CubeMX version 6.4.0 generates code with missing REENT.H file when code is generated for MDK-ARM (minimum version V5.32)

compiling freertos.c...
../Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h(71): error: #5: cannot open source input file "reent.h": No such file or directory
 	#include <reent.h>
../Core/Src/freertos.c: 0 warnings, 1 error

Please help fix the issue.

Regards,

Rajeev

Khouloud ZEMMELI
ST Employee
December 7, 2021

Hello @Rajeev Arora​ ,

Thank you for your post,

Could you please share your ioc file to be able to check the problem?

Thanks, Khouloud

Khouloud ZEMMELI
ST Employee
December 7, 2021

Got it, thanks for the share :)

I'll check it then I'll get back to you.

Khouloud

JGile
Associate
April 28, 2022

Thank you for your answers above. They really helped. Just to add further clarification on how to disable USE_NEWLIB_REENTRANT .

On Cube MX, Go to Pin out->FREERTOS_M7-Advanced Settings and set USE_NEWLIB_REENTRANT to Disabled

Explorer
February 7, 2025

Thank you