newLib heap and ThreadX memory managment
bytesontherocks opened this issue · comments
Hello,
I have some experience with FreeRTOS, and the integration with the newLib heap and the heap mechanism for FreeRTOS was not fully integrated (see http://www.nadler.com/embedded/newlibAndFreeRTOS.html).
In the current ThreadX example I understand that the RAM map looks like that
The newLib heap can expand to _estack (ORIGIN(RAM) + LENGTH(RAM)) - _Min_Stack_Size according to the current "_sbrk" implementation that would mean that if you use malloc/new() at any point in your system, you could potentially be overwriting the ThreadX memory pool.
The NewLib heap and the ThreadX allocation are working completely unaware one of an other. If it is up to the user to be aware of that, that should be documented, it can cause quite a lot of problems. Otherwise, are you planing to offer a better integration?
Looking forward to reading your thoughts.
Thanks.
Hi @bytesontherocks,
Thank you for this contribution. Your report will be forwarded to our development teams. I will get back to you as soon as they provide me with their feedback.
With regards,
Hi @bytesontherocks,
Our development teams confirmed your point. However, they said good management of allocations in both NewLib
heap and ThreadX
memory pool falls on the "shoulders" of the user application.
From our side, we will try to highlight such an important point in our documentation.
Thank you again for having reported this point.
With regards,
ST Internal Reference: 107765