On 27 Oct 2004 08:30:33 -0700, mariorossi69@email.it (MarioRossi)
wrote in comp.dsp:
> In my test project using ccs i want to read a file, using this sample code:
>
> double a=0.0;
> FILE *f1;
> f1 = fopen("test.dat","r");
> fscanf(f1,"%lf",&a);
> fclose(f1);
>
> where debug
>
> > error: can't allocate .text, size 00013560 (page 0) in PMEM (avail:
> 0000fe00)
> >> error: errors in input - ./Debug/Test.out not built
>
> >> Compilation failure
>
> i try to set build option-> advanced-> memory models -> Far Aggregate Data (-m10)
> but nothing
>
> I dont know what else to try, can anyone make suggestions?
allnor@tele.ntnu.no (Rune Allnor) wrote in message news:<f56893ae.0410280117.152d98a@posting.google.com>...
> mariorossi69@email.it (MarioRossi) wrote in message news:<88529a72.0410270730.26559b14@posting.google.com>...
> > In my test project using ccs i want to read a file, using this sample code:
> >
> > double a=0.0;
> > FILE *f1;
> > f1 = fopen("test.dat","r");
> > fscanf(f1,"%lf",&a);
> > fclose(f1);
> >
> > where debug
> >
> > > error: can't allocate .text, size 00013560 (page 0) in PMEM (avail:
> 0000fe00)
> > >> error: errors in input - ./Debug/Test.out not built
>
> > >> Compilation failure
> >
> > i try to set build option-> advanced-> memory models -> Far Aggregate Data (-m10)
> > but nothing
> >
> > I dont know what else to try, can anyone make suggestions?
>
> Try to change the declaration of 'a' to
>
> double a;
>
> With some bad luck, the "a=0.0" declaration tricks the compiler
> to think that 'a' is a constant number, never to be changed, and
> not a variable.
>
> Other than that, it might be smart to check that the file was actually
> opened, before attempting to read from it. Try some statement like
>
> if ((f1 = fopen("test.dat","r"))==NULL)
> {
> fprintf(stderr,"Could not open file 'test.dat'\n");
> exit(-1);
> }
>
> Rune
In the section .text, the executable program code is stored. In your
case, your program is simply too big for the memory that is available
for the section .text.
Your program occupies 0x13560 Bytes of memory, but you have only
0xfe00 available in the section PMEM.
either
*) decrease the size of your program
*) put the .text into another memory range
*) put some other section that is linked to PMEM to another memory
section
there is a lot of useful information available in spru186.pdf and
spru187.pdf (available at www.ti.com)
best regards,
Thomas
Reply by MarioRossi●October 28, 20042004-10-28
allnor@tele.ntnu.no (Rune Allnor) wrote in message
>
> Try to change the declaration of 'a' to
>
> double a;
>
> With some bad luck, the "a=0.0" declaration tricks the compiler
> to think that 'a' is a constant number, never to be changed, and
> not a variable.
>
> Other than that, it might be smart to check that the file was actually
> opened, before attempting to read from it. Try some statement like
>
> if ((f1 = fopen("test.dat","r"))==NULL)
> {
> fprintf(stderr,"Could not open file 'test.dat'\n");
> exit(-1);
> }
>
> Rune
hi Rune
tnx for the answer
the problem is in the fscanf command
not in fopen command
the debug doesn't start and it says me always the same:
">> error: can't allocate .text, size 00013620 (page 0) in PMEM (avail: 0000fe00"
Anybody have an idea?
Reply by Rune Allnor●October 28, 20042004-10-28
mariorossi69@email.it (MarioRossi) wrote in message news:<88529a72.0410270730.26559b14@posting.google.com>...
> In my test project using ccs i want to read a file, using this sample code:
>
> double a=0.0;
> FILE *f1;
> f1 = fopen("test.dat","r");
> fscanf(f1,"%lf",&a);
> fclose(f1);
>
> where debug
>
> > error: can't allocate .text, size 00013560 (page 0) in PMEM (avail:
> 0000fe00)
> >> error: errors in input - ./Debug/Test.out not built
>
> >> Compilation failure
>
> i try to set build option-> advanced-> memory models -> Far Aggregate Data (-m10)
> but nothing
>
> I dont know what else to try, can anyone make suggestions?
Try to change the declaration of 'a' to
double a;
With some bad luck, the "a=0.0" declaration tricks the compiler
to think that 'a' is a constant number, never to be changed, and
not a variable.
Other than that, it might be smart to check that the file was actually
opened, before attempting to read from it. Try some statement like
if ((f1 = fopen("test.dat","r"))==NULL)
{
fprintf(stderr,"Could not open file 'test.dat'\n");
exit(-1);
}
Rune
Reply by MarioRossi●October 27, 20042004-10-27
In my test project using ccs i want to read a file, using this sample code:
double a=0.0;
FILE *f1;
f1 = fopen("test.dat","r");
fscanf(f1,"%lf",&a);
fclose(f1);
where debug
>> error: errors in input - ./Debug/Test.out not built
>> Compilation failure
i try to set build option-> advanced-> memory models -> Far Aggregate Data (-m10)
but nothing
I dont know what else to try, can anyone make suggestions?