Forum : 8051
Original Post
Post Information | Post |
---|---|
October 11, 2007 - 3:27pm
|
Hello, I am facing this error when I try to build my project. "Total INTERNAL RAM storage requirement: 0065H.5 (101.5)" So its not possible that its using the 256 bytes!!! In the begining of the program I am using: "SP = 0xF0;" In the project options, in the LX51 >> Linker I set the RAM size to 256!!! So why this error is happening? The full error line is: "ERROR 107 : ADDRESS SPACE OVERFLOW -SEGMENT: _DGROUP00(PROJ)" I am making it on C language. regards |
Hello,
in the case of an error, the linker only makes appear what it actually could locate in the memory space. So it is normal that the RAM storage requirement shown by the linker map file is less than 256. It will never be greater.
As an additional note, if the linker generates a FATAL ERROR, the linker map is NOT generated. The map file you open may be an old one from a previous successful build.
You should check the "data" requirement on a per-object basis, i.e. look at the source files on your project tree and the "data" property that is appended to them. You may find that one of your source files requires a lot of data memory, and that file is probably called PROJ.C (according to the error).
regards,
Lionel
What??? :D
I was using struct, and decleared 3 objects from it, now I removed them and the error desapeared.
With the 3 objects the error appears again, when I remove them, it desapears!
So I looked the ram used:
"Total INTERNAL RAM storage requirement: 005FH.5 (95.5)"
And lets calc the ram used by the 3 objects from the structure:
1 object may use: 1+1+1+2+2+2 = 9 bytes (am I right? :D)
So 3 of them will use: 9*3 = 27
The final calc: 100+27 = 127
Seems that the linker is thinking that I have only 128 bytes, but in the project properties, I set it to 256!
regards
Xero
Strictly speaking, your data memory space is separated into 2 parts:
128 bytes (lower part) can be directly or indirectly addressed
128 bytes (higher part) can be indirectly addressed only.
Unless you can modify your code so that your structs are addressed indirectly and can be put in idata, you should better consider that you only have 128 bytes of ram available. The Philips 80C51 family architecture documentation is a good reference if you want more information about the 8051 architecture and addressing modes.
Lionel
I am using the 8952, with 256 RAM size :/
How can I solve this problem? (Without an extern memory)
Xero
use IDATA for enough of your variables to make the error disappear.
IDATA is a bit (not a lot) alower than DATA so try to use it for stuff (such as structs/arrays) that are addressed indirectly anyhow. NOTE: the linker does not automatically place such in IDATA, that is YOUR job.
Erik