DSPRelated.com
Forums

Cannot allocate .bss, .const and .sysmem

Started by lamk...@yahoo.com April 7, 2009
Good day,

I've a problem in linking the program and need for help. I am using TI TMS320C31 board. I wrote a program in C, named dspfinal.c. I compiled the program and it shows not error. However, when I link the program into .cmd, it shows error.

These are the errors:
>>cannot allocate .text in RAM0 < page 0 >
>>can't allocate .bss, size 000005d3 < page 0>
>>can't allocate .const, size 00000309 < page 0>
>>can't allocate .sysmem,size 00000400 < page 0>
>>errors in input - dspfinal.out not built

I was using the command "lnk30 dspfinal.cmd" in command prompt. Below is my dspfinal.cmd file.

-c /*using C convention */
-stack 0x100 /*256 words stack */
matrixc.obj /*object file */
-O matrixc.out /*executable output file */
-l rts30.lib /*run-time library support*/
MEMORY
{
RAMS: org=0x809800, len=0x2 /*boot stack */
RAM0: org=0x809802, len=0x3FE /*internal block 0*/
RAM1: org=0x809C00, len=0x3C0 /*internal block 1*/
}
SECTIONS
{
.text: {} > RAM0 /*code */
.cinit: {} > RAM0 /*initialization tables*/
.stack: {} > RAM1 /*system stack */
}

_____________________________________
Dear lamkhengeu,

There are some problems with your command file. Firstly, you only seem
to have 0x3FE words in RAM0, yet you are placing your .text and .cinit
functions there, and .text doesn't fit. (.text is your code, by the
way).

Also, your command file does not specify where .bss, .const, or .sysmem
sections are located. (.sysmem is the heap section. You should specify
its size in the command file.)

Take a look at the map file; it will give you a hint as to where things
are being placed. I would say though, unless you have some external ram
in-circuit you're in trouble.

Regards,
Bill

> -----Original Message-----
> From: c... [mailto:c...] On
> Behalf Of l...@yahoo.com
> Sent: Tuesday, April 07, 2009 12:23 PM
> To: c...
> Subject: [c3x] Cannot allocate .bss, .const and .sysmem
>
> Good day,
>
> I've a problem in linking the program and need for help. I am
> using TI TMS320C31 board. I wrote a program in C, named
> dspfinal.c. I compiled the program and it shows not error.
> However, when I link the program into .cmd, it shows error.
>
> These are the errors:
> >>cannot allocate .text in RAM0 < page 0 >
> >>can't allocate .bss, size 000005d3 < page 0>
> >>can't allocate .const, size 00000309 < page 0>
> >>can't allocate .sysmem,size 00000400 < page 0>
> >>errors in input - dspfinal.out not built
>
> I was using the command "lnk30 dspfinal.cmd" in command
> prompt. Below is my dspfinal.cmd file.
>
> -c /*using C convention */
> -stack 0x100 /*256 words stack */
> matrixc.obj /*object file */
> -O matrixc.out /*executable output file */
> -l rts30.lib /*run-time library support*/
> MEMORY
> {
> RAMS: org=0x809800, len=0x2 /*boot stack */
> RAM0: org=0x809802, len=0x3FE /*internal block 0*/
> RAM1: org=0x809C00, len=0x3C0 /*internal block 1*/
> }
> SECTIONS
> {
> .text: {} > RAM0 /*code */
> .cinit: {} > RAM0 /*initialization tables*/
> .stack: {} > RAM1 /*system stack */
> }

_____________________________________