One additional comment: I shouldn't have said "repeat the data" as
that's not
accurate. What's being duplicated in the case of static .bss arrays is
memory space
required -- once in .bss, again in .cinit section to initialize the arrays at
run-time. By allocating arrays in .const section, the idea is to avoid mem
space
duplication.
-Jeff
-------- Original Message --------
Subject: Re: [c55x] memory allocation problem
Date: Thu, 29 Mar 2007 10:32:26 -0600
From: Jeff Brower
Organization: Signalogic, Inc
To: Vikas
CC: c...
Vikas-
> i have written mfcc code for some speech
application.
> now, i need to port my code on TI320c5510 dsk.
> To avoid excess dynamic memory allocation, i have written some
> essential data in arrays in some .h files & am including those .h
> files with the main program.
> while building the program on ccs 2.21, it given following build error:
> >> error: can't allocate .cinit (sz: 0001ac6a page: 0) in PROG
(avail:
> 000010d4)
> >> error: can't allocate .bss (sz: 0001b5f6 page: 0) in DATA (avail:
> 00007fff)
> >> error: errors in input - ./Debug/mfcccalc.out not built
>
> can somebody suggest me, so that i can allocate the memory as required
> by the application.
It appears that you're adding a lot of data as global (static) arrays that
need to be
initialized at run-time, and you have linker set for run-time
autoinitialization.
That would cause the .cinit section to be repeat the data, in order to
initialize
your arrays in the .bss section before C code runs (you can look for function
c_init
in TI documentation).
You might try allocating the arrays as .const, for example:
int const BigData[0, 1, 2, 3, ....];
I think that may avoid c_init() initialization and cause the data to not be
duplicated.
-Jeff
Reply by Jeff Brower●March 29, 20072007-03-29
Vikas-
> i have written mfcc code for some speech
application.
> now, i need to port my code on TI320c5510 dsk.
> To avoid excess dynamic memory allocation, i have written some
> essential data in arrays in some .h files & am including those .h
> files with the main program.
> while building the program on ccs 2.21, it given following build error:
> >> error: can't allocate .cinit (sz: 0001ac6a page: 0) in PROG
(avail:
> 000010d4)
> >> error: can't allocate .bss (sz: 0001b5f6 page: 0) in DATA (avail:
> 00007fff)
> >> error: errors in input - ./Debug/mfcccalc.out not built
>
> can somebody suggest me, so that i can allocate the memory as required
> by the application.
It appears that you're adding a lot of data as global (static) arrays that
need to be
initialized at run-time, and you have linker set for run-time
autoinitialization.
That would cause the .cinit section to be repeat the data, in order to
initialize
your arrays in the .bss section before C code runs (you can look for function
c_init
in TI documentation).
You might try allocating the arrays as .const, for example:
int const BigData[0, 1, 2, 3, ....];
I think that may avoid c_init() initialization and cause the data to not be
duplicated.
-Jeff
Reply by vikas_538●March 29, 20072007-03-29
i have written mfcc code for some speech application.
now, i need to port my code on TI320c5510 dsk.
To avoid excess dynamic memory allocation, i have written some
essential data in arrays in some .h files & am including those .h
files with the main program.
while building the program on ccs 2.21, it given following build error: >> error: can't allocate .cinit (sz: 0001ac6a
page: 0) in PROG (avail: 000010d4) >> error: can't allocate .bss (sz: 0001b5f6
page: 0) in DATA (avail: 00007fff) >> error: errors in input - ./Debug/mfcccalc.out not
built can somebody suggest me, so that i can allocate the memory as required
by the application.
thnx & regds,
Vikas