2012-09-01 03:47 PM
I was trying to use malloc in a project which has been ported from an other platform. I get the message that...
_sbrk
... is undefined. This is used by _sbrk_r which again is used by malloc. I found no solution herein but looked at the following at http://embdev.net/topic/129753 I am not very familiar to this so a little help would do. I can create the function if needed, no prob. but I find it likely that this has already been solved somehow for stm32fxx devices and i rather like the idea to have something dedicated instead for me trying to implement this myself. FYI : The heap size is set to 16KB Breg Vidar #malloc-_sbrk #dynamic-allocation---just-say-noSolved! Go to Solution.
2012-09-01 05:44 PM
Dynamic memory allocation in embedded systems is very problematic, basically revolving around memory leakage, heap fragmentation and what to do when the allocation fails.
Consider your options to statically allocate resources, or fixed pools.http://en.wikipedia.org/wiki/Memory_management#Fixed-size-blocks_allocation
2012-09-01 05:44 PM
Dynamic memory allocation in embedded systems is very problematic, basically revolving around memory leakage, heap fragmentation and what to do when the allocation fails.
Consider your options to statically allocate resources, or fixed pools.http://en.wikipedia.org/wiki/Memory_management#Fixed-size-blocks_allocation
2012-09-03 04:59 AM
''I can create the function if needed, no prob. but I find it likely that this has already been solved somehow for stm32fxx devices...''
As clive1 suggests, the usual ''solution'' for embeded systems is to
not
use dynamic memory allocation! Your time may be better spent adjusting the code to a more ''embedded-friendly'' approach...