2023-07-18 11:44 PM
How to properly regenerate code in a TouchGFX example demo code.
Hi,
I'm here to pose some questions about how to correctly re-generate the code of a TouchGFX demo project
following some changes regarding, for example, the FreeRTOS configuration that is used in the demo.
I was able to compile and run a demo project for a STM32H7474I Disco board using STM32CubeIDE
(version 1.13.0).
Now what I need is to add to the rest of the demo's code also a library whose code uses newlib's
malloc/free() function. To do this at the moment I put its source directory under the Middleware
folder of the demo project and imported it via STM32CUbeIDE; after that I properly added library's
include path in the demo project C settings.
When I recompiled the resulting project, the make tool failed to build the application because of
a missing _REENT symbol when it tried to compile the cmsis_os2.c file coming from FreeRTOS package.
The first header file it includes is <string.h>, and when it does that, it complains that _REENT
symbol in undeclared.
Searching on the Web I perhaps understand that when the code of a project is using newlib's
functions (as in my case after adding my library) in FreeRTOS configuration the
configUSE_NEWLIB_REENTRANT has to be enabled.
So the first attempt was to simply open the FreeRTOSConfig.h file and to add in it the
#define configUSE_NEWLIB_REENTRANT (1) and to rebuild the project, but the result was still
wrong, the _REENT symbol remained missing.
Perhaps the problem persists because of there is another way to chance FreeRTOSConfig.h and
to add reentrant newlib support in FreeRTOS.
Should I regenerate the CubeMX code running the CubeMX tool (version 6.9.0) feeding to it
the demo's .ioc file after having enabled the configUSE_NEWLIB_REENTRANT option?
Should I also re-generate the TouchGFX code via TouchGFX designer tool (version 4.22.0)
after the above step?
I tried both of the above methods, but none resolve the problem, the _REENT symbol is
still missing.
Where I am wrong? Is already someone encountered this kind of problem?
Thanks in advance to who can help me.
.
2023-07-19 02:46 AM
Further investigating on the problem I changed in the project settings the
kind of newlib that's possible to select. Four option are available:
Selecting a newlib library with standard C or C++ cause the linker to fail,
not the compiler.