Loading...
 
Skip to main content

System Workbench for STM32


malloc fails on NucleoSTM32F030R8

I have attempted to use the solution proposed in topic "malloc heap issue with CubeMX Project" from this forum with no success either.
Please anyone has a solution, or should I implement the full malloc and free routine from scratch ?

I have written malloc and free routines from scratch and it has worked, but carries some issues what is better recommended not to use them:
1) The payload for mapping each portion of memory is around 40 bytes. It means only long data makes sense to be alocated;
2) The area previously occupied by a malloc that has been already freed will only be reused when the furthers malloc being freed. It really works as a stack with holes in the middle. For solving it, it would be require to segment the memory, what would increase even more the payload.

In order to solve my problem I have moved to a fixed data in a array, using a ring concept


 
Collapse/expand modules below