Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/31/02 14:27
Read: times


 
#26560 - RE: PDATA page size
I tried to define an array of 256 bytes in external ram as pdata as:

unsigned char pdata PDat[256];
main(){ }

But I am getting the following message by KEIL and RIDE Linker:

ERROR L134: SEGMENT DOES NOT FIT IN PDATA PAGE
SPACE: XDATA
SEGMENT: ?PD?T1
LENGTH: 0100 H

if I chane it to PDat[255] then there is no error.

.
.
.


Yep, 0 to 256 = 257 (100H) addresses. 0 to 255 = 256(0FFH) addresses.

A page is 256 bytes.



Your variable declaration is not the problem.

unsigned char pdata PDat[256]; 


Declares an array named PDat with 256 unsigned char elements. And, that's the exact size of the PDATA page. So, that's OK.

If you had created an array that was too large, you would have received a compiler error.

Since you received a linker error, the LINKER is what decided that there was too much stuff to go into PDATA. So, I bet that you have another C module that declares one or more PDATA variables. To find out, take a look in the linker MAP file under XDATA Memory. You will find that you have 2 PDATA segments that are included in the memory map. PDATA segments are created with the INPAGE attribute (meaning they must fit within one 256-byte page). For example:

            * * * * * * *  X D A T A   M E M O R Y  * * * * * * *
            XDATA   0000H     0001H     INPAGE       ?PD?JUNK
                    0001H     00FFH                  *** GAP ***
            XDATA   0100H     0100H     INPAGE       ?PD?MAIN


In my test program, I have a 1-byte PDATA segment (?PD?JUNK) which comes from JUNK.C and a 256-byte PDATA segment (?PD?MAIN) which comes from MAIN.C.

These segments together comprise 257 bytes of memory (which is larger than a 256-byte PDATA page) and I get the following linker error:

*** WARNING L18: SEGMENT DOES NOT FIT IN PDATA PAGE
    SPACE:   XDATA   
    SEGMENT: ?PD?MAIN
    LENGTH:  0100H


To solve this problem, remove all other PDATA variables from the other source files in your project.

Jon

List of 11 messages in thread
TopicAuthorDate
PDATA page size            01/01/70 00:00      
RE: PDATA page size            01/01/70 00:00      
RE: can you explain a little further ??            01/01/70 00:00      
RE: PDATA page size            01/01/70 00:00      
RE: PDATA page size            01/01/70 00:00      
RE: PDATA page size ps            01/01/70 00:00      
RE: PDATA page size ps            01/01/70 00:00      
RE: PDATA page size            01/01/70 00:00      
RE: PDATA page size            01/01/70 00:00      
RE: PDATA page size - RIDE            01/01/70 00:00      
RE: PDATA page size            01/01/70 00:00      

Back to Subject List