DSPRelated.com
Forums

MEM_alloc( ) - unidentified item

Started by ".dorian" November 5, 2007
hi everybody,

in the DSP/BIOS settings I defined a heap in the ISRAM memory (right click >
properties) and
gave it a label (_intHeap). I try to allocate some memory on that heap using

MEM_alloc(_intHeap, sizeof(struct bla), 8);

but the compiler can't find the _intHeap label.

Does somebody know what I am missing ?

thanks !
dorian

PS: Dm642 board, CSS 3.1
Dear M. Klemenz,

I tried out what you suggested to do, but I couldn't solve the problem
in that way - I still get the error message :

"encoder.c", line 514: error: identifier "intHeap" is undefined

the error code is :

enc_t *h = MEM_alloc(intHeap, sizeof(enc_t), 8 );

I defined _intHeap at

*.cdb file > Memory Section Manager > ISRAM > heap identifier label

regards
dorian
-----Original Message-----
From: Adolf Klemenz [mailto:a...@dsignt.de]
Sent: Monday, November 05, 2007 10:18 PM
To: .dorian; c...
Subject: Re: [c6x] MEM_alloc( ) - unidentified item

Hi Dorian,

by convention assembly level labels start with an underscore, in "C"
these lables are referenced without the leading underscore. Please change
your call to MEM_alloc(intHeap, sizeof(struct bla), 8);

Regards,
Adolf Klemenz, D.SignT

At 17:57 05.11.2007 +0800, .dorian wrote:

>hi everybody,
>
>in the DSP/BIOS settings I defined a heap in the ISRAM memory (right click
>
>properties) and
>gave it a label (_intHeap). I try to allocate some memory on that heap
using
>
>MEM_alloc(_intHeap, sizeof(struct bla), 8);
>
>but the compiler can't find the _intHeap label.
>
>Does somebody know what I am missing ?
>
>thanks !
>dorian
>
>PS: Dm642 board, CSS 3.1
Dear Dorian,

sorry, I forgot an important point:
You must declare the Heap segment identifier as external in your C program:

in .cdb, heap identifier label:
_intHeap

in .c:
extern int intHeap;
...
MEM_alloc (intHeap, ...)
Best Regards,
Adolf Klemenz, D.SignT

At 23:12 05.11.2007 +0800, .dorian wrote:
>Dear M. Klemenz,
>
>I tried out what you suggested to do, but I couldn't solve the problem
>in that way - I still get the error message :
>
>"encoder.c", line 514: error: identifier "intHeap" is undefined
>
>the error code is :
>
>enc_t *h = MEM_alloc(intHeap, sizeof(enc_t), 8 );
>
>I defined _intHeap at
>
>*.cdb file > Memory Section Manager > ISRAM > heap identifier label
>
>regards
>dorian
>-----Original Message-----
>From: Adolf Klemenz [mailto:a...@dsignt.de]
>Sent: Monday, November 05, 2007 10:18 PM
>To: .dorian; c...
>Subject: Re: [c6x] MEM_alloc( ) - unidentified item
>
>Hi Dorian,
>
> by convention assembly level labels start with an underscore, in "C"
>these lables are referenced without the leading underscore. Please change
>your call to MEM_alloc(intHeap, sizeof(struct bla), 8);
>
> Regards,
> Adolf Klemenz, D.SignT
>
>At 17:57 05.11.2007 +0800, .dorian wrote:
>
> >hi everybody,
> >
> >in the DSP/BIOS settings I defined a heap in the ISRAM memory (right click
> >
> >properties) and
> >gave it a label (_intHeap). I try to allocate some memory on that heap
>using
> >
> >MEM_alloc(_intHeap, sizeof(struct bla), 8);
> >
> >but the compiler can't find the _intHeap label.
> >
> >Does somebody know what I am missing ?
> >
> >thanks !
> >dorian
> >
> >PS: Dm642 board, CSS 3.1
> >
> >
Hi Dorian,

by convention assembly level labels start with an underscore, in "C"
these lables are referenced without the leading underscore. Please change
your call to MEM_alloc(intHeap, sizeof(struct bla), 8);

Regards,
Adolf Klemenz, D.SignT

At 17:57 05.11.2007 +0800, .dorian wrote:

>hi everybody,
>
>in the DSP/BIOS settings I defined a heap in the ISRAM memory (right click >
>properties) and
>gave it a label (_intHeap). I try to allocate some memory on that heap using
>
>MEM_alloc(_intHeap, sizeof(struct bla), 8);
>
>but the compiler can't find the _intHeap label.
>
>Does somebody know what I am missing ?
>
>thanks !
>dorian
>
>PS: Dm642 board, CSS 3.1