I can't build the program with memory allocation functions thats work
correctly.
I definded _sbrk() and _sbrk_functions, but malloc returns zero-pointer,
or getting stick in after second call of _sbrk_r().
CPU - LPC2214
i tried to compile syscalls.c in pure arm mode and in thumb-interwork,
but result is same
----------------syscalls.c cut------------------------------------
extern char _end;
caddr_t _sbrk(int incr)
{
HalDebugInfo("sbrk\n");
static unsigned char *heap_end =0;
unsigned char *prev_heap_end=0;
if( heap_end == 0 ) heap_end = (caddr_t)&_end;
prev_heap_end = heap_end;
heap_end += incr;
return(caddr_t) prev_heap_end;
}
void *_sbrk_r(struct _reent* reent, ptrdiff_t incr)
{
return _sbrk(incr);
}
-----------------------------------------------------------------
Whats version of libc should i use ?
..\arm-elf\lib\interwork\libc.a // the program get stack in
after
// second _sbrk_r call
..\arm-elf\lib\thumb\interwork\libc.a // malloc always return zero
pointer
..\arm-elf\lib\be\interwork
..\arm-elf\lib\be\nofmult
Does anybody has a working code for memory functions ?