Reply by Maughan, Thomas October 29, 20032003-10-29
The recommendation is to use the thread safe MEM_alloc() that is included
with BIOS instead of malloc(). You would then remove the -heap0xA... and
define your heap in the config tool.

As for the message on .args, this is strange - there should be no errors.
By any chance are you editing the generated linker command file or doing
something in a compound linker command file ahead of the BIOS linker command
file (compound being one linker command file including another).

Thom

-----Original Message-----
From: Yeo Han Kwang [mailto:]
Sent: Wednesday, October 29, 2003 2:49 AM
To:
Subject: [c6x] DSP/BIOS and Heap

Hi,

I had an application running properly on the c6416 TEB (with CCS 2.1)
without using DSP/BIOS. I then tried to bring DSP/BIOS in for some of
the useful tools. There was not much problem except for 2 issues:

1) Under "Memory Section Manager Properties -> General" of the
DSP/BIOS configuration tool, there is a configuration called "Segment
For malloc() / free()".

CCS help describes it as "The memory segment from which space is
allocated when a program calls malloc and from which space is freed
when a program calls free..." I took this to mean the heap and
happily assigned the segment to SDRAM which was configured to have a
heap of size 0x0A00000.

The resulting executable was not able to allocate even 1 byte of
dynamic memory!

I then assigned the above mentioned segment to ISRAM (where only a
small heap of 0x8000 is configured), removed the heap configuration
from SDRAM and added the "-heap0xA00000" linker option. My program
works again! Problem is, I used malloc to allocate more than "0x8000"
of memory. This means the calls could not be allocating from the heap
configured in ISRAM. So its definitely the linker option thats
helping.

Question is: What is that "Segment For malloc() / free()" for?

2) The cmd file generated by DSP/BIOS produces this WARNING message
during linking:

"programcfg.cmd, line 203: warning: (.args) not found"

The corresponding code is:

.args: fill=0 {
*(.args)
. += 0x4;
} > ISRAM

Since this is a generated file, I do not expect warnings. I feel
uncomfortable as some warnings really do point to big problems!
Anybody has any idea?

Thanks A Million
Yeo Han Kwang
_____________________________________
Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you
want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join: Send an email to

To Post: Send an email to

To Leave: Send an email to

Archives: http://www.yahoogroups.com/group/c6x

Other Groups: http://www.dsprelated.com ">http://docs.yahoo.com/info/terms/


Reply by Yeo Han Kwang October 29, 20032003-10-29
Hi,

I had an application running properly on the c6416 TEB (with CCS 2.1)
without using DSP/BIOS. I then tried to bring DSP/BIOS in for some of
the useful tools. There was not much problem except for 2 issues:

1) Under "Memory Section Manager Properties -> General" of the
DSP/BIOS configuration tool, there is a configuration called "Segment
For malloc() / free()".

CCS help describes it as "The memory segment from which space is
allocated when a program calls malloc and from which space is freed
when a program calls free..." I took this to mean the heap and
happily assigned the segment to SDRAM which was configured to have a
heap of size 0x0A00000.

The resulting executable was not able to allocate even 1 byte of
dynamic memory!

I then assigned the above mentioned segment to ISRAM (where only a
small heap of 0x8000 is configured), removed the heap configuration
from SDRAM and added the "-heap0xA00000" linker option. My program
works again! Problem is, I used malloc to allocate more than "0x8000"
of memory. This means the calls could not be allocating from the heap
configured in ISRAM. So its definitely the linker option thats
helping.

Question is: What is that "Segment For malloc() / free()" for?

2) The cmd file generated by DSP/BIOS produces this WARNING message
during linking:

"programcfg.cmd, line 203: warning: (.args) not found"

The corresponding code is:

.args: fill=0 {
*(.args)
. += 0x4;
} > ISRAM

Since this is a generated file, I do not expect warnings. I feel
uncomfortable as some warnings really do point to big problems!
Anybody has any idea?

Thanks A Million
Yeo Han Kwang