This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how to control malloc start address. Evil rts2800_fpu32.lib !!

Other Parts Discussed in Thread: TMS320F28335

I use EZDSP kit , TMS320F28335 . In my project I need 128k x 16 memory to be assigned for dynamic memory allocation  (malloc) . so I  dedicated the external SARAM for this purpose. I wrote the following lines in the .cmd file

MEMORY
{.

.

 ALLOCZONE  : origin = 0x200000, length = 0x020000 

}

SECTIONS

{

.

.

.esysmem         : > ALLOCZONE,     PAGE = 1

}

when I dynamically allocate memory by malloc in the following statement:


x=(short*) malloc (0x200);

while whatching the (x) variable, the watch window  shows that   x = 0x200002  instead of     0x200000 . this means that I can not use the full 128k size. I will always have a shortage of 2 bytes.

When I looked at the map file I found this :

.esysmem 1 00200000 00020000 UNINITIALIZED
00200000 00000001 rts2800_fpu32.lib : memory.obj (.esysmem)
00200001 0001ffff --HOLE--

it seems that 1 or 2 bytes are reserved for  rts2800_fpu32.lib  . Any clue how to get rid of rts2800_fpu32.lib annoyance ? because these  evil 2 bytes always lead to the failure of the allocation.