ASlink ERROR?? What is that??
Sun Sep 14 2008, 03:17 am
when i am trying to compile my code with sdcc, i get this error mssg...
ASlink-Error-Could not get 59 consecutive bytes in internal RAM for area DSEG...
The answer to solve this problem i get from a web sounds like this...
You are using all your direct memory.Try either moving your variables into xdata or compile with --model-large.
what does he mean?
ASlink-Error-Could not get 59 consecutive bytes in internal RAM for area DSEG...
The answer to solve this problem i get from a web sounds like this...
You are using all your direct memory.Try either moving your variables into xdata or compile with --model-large.
what does he mean?
Sun Sep 14 2008, 10:28 am
@nismo,
the error indicates that the compiler is not finding enough data memory space to translate ur code because u have defined too many variables in the data space.
note that if u define a array like:
char array[59]; OR
char array[]= {"this text will be stored in data memory. Please store it incode memory")
the compiler has to compulsory reserve this data to the data memory.So try to avoid large arrays while deciding on the variables.
If the array is constant i.e. if the data in the array is fixed like a message, then use the 'code' or 'constant' directive so that the compiler can store it in the program memory. e.g.
also check if the compiler options are set to use the extended data memory (128 to 256byte memory).
another good practice is to use local variables as far as posible instead of global variables as the same memory can be used for different local variables in different functions.
another method to reduce usage of data RAM is to avoid usage of nested functions ( calling functions within functions) as far as possible in the code.
the error indicates that the compiler is not finding enough data memory space to translate ur code because u have defined too many variables in the data space.
note that if u define a array like:
char array[59]; OR
char array[]= {"this text will be stored in data memory. Please store it incode memory")
the compiler has to compulsory reserve this data to the data memory.So try to avoid large arrays while deciding on the variables.
If the array is constant i.e. if the data in the array is fixed like a message, then use the 'code' or 'constant' directive so that the compiler can store it in the program memory. e.g.
const char array[]={"this text will be stored in program memory"};
also check if the compiler options are set to use the extended data memory (128 to 256byte memory).
another good practice is to use local variables as far as posible instead of global variables as the same memory can be used for different local variables in different functions.
another method to reduce usage of data RAM is to avoid usage of nested functions ( calling functions within functions) as far as possible in the code.
[ Edited Sun Sep 14 2008, 10:38 am ]
Sun Sep 14 2008, 11:07 am
In that case you need to use a variant with extra ram....like the P89V51RD2 from NXP with 1k data ram.
Or use external ram with the standard 8051.
Or use external ram with the standard 8051.
[ Edited Sun Sep 14 2008, 11:23 am ]
Sun Sep 14 2008, 11:21 am
It means 59 consecutive bytes of the direct addressable ram ie 00h-7Fh,is not available for an array.
It means,now you have to push your variables/arrays into the SFR part ie 80h-FFh.This area when addressed directly,results in access to the SFRs.For using it to store user variables,you must use the idata keyword when declaring your variables.
Plz post the .map file here.sashijoseph
you mean i have to rename my array as idata[512] ??Excuse me, i don't see any map file here.
Sun Sep 14 2008, 11:26 am
oops sorry,I posted that before I read your post about the 512 byte array.Plz read the edited followup.
Sun Sep 14 2008, 11:30 am
the external ram you mentioned is external memory...sorry to ask stupid questions i can not use other microcontroller. That is the term and condition of the project
[ Edited Sun Sep 14 2008, 11:33 am ]
Sun Sep 14 2008, 06:34 pm
@nismo,
can u give the details of the project?
i just want to confirm whether u really need the external data memory......
many a times i have experienced that by 'twisting' the logic of my code a bit i could restrict the code within the 128 data RAM space. so thought if we could give an ideas in ur case....
:-)
can u give the details of the project?
i just want to confirm whether u really need the external data memory......
many a times i have experienced that by 'twisting' the logic of my code a bit i could restrict the code within the 128 data RAM space. so thought if we could give an ideas in ur case....
:-)
Powered by e107 Forum System