Keil Logo

BL51: ERROR 107 (ADDRESS SPACE OVERFLOW)


Information in this article applies to:

  • C51 Version 5.50
  • C51 Version 6.00 Beta
  • C51 Version 6.00 or later

SYMPTOMS

I receive the following linker error when I compile and link my program:

*** ERROR L107: ADDRESS SPACE OVERFLOW
    SPACE:   DATA
    SEGMENT: _DATA_GROUP_
    LENGTH:  0014H

CAUSE

This error message is generated when there isn't enough memory available for all the code and/or data segments in your program. The following sample program generates this error (when compiled and linked).

unsigned char data buffer2 [101];

void main (void)
{
long a, b, c, d, f;

a = b = c = d = f = 0;  // Avoid Compiler Warnings
}

RESOLUTION

The best way to resolve this type of problem is to find out what's consuming all the memory. Look in the map (*.M51) file and locate the link map. It appears as follows:

LINK MAP OF MODULE:  C:\TEMP\ASDF (ASDFASDF)

            TYPE    BASE      LENGTH    RELOCATION   SEGMENT NAME
            -----------------------------------------------------

            * * * * * * *   D A T A   M E M O R Y   * * * * * * *
            REG     0000H     0008H     ABSOLUTE     "REG BANK 0"
            DATA    0008H     0065H     UNIT         ?DT?ASDFASDF
            IDATA   006DH     0001H     UNIT         ?STACK

The error message...

*** ERROR 107: ADDRESS SPACE OVERFLOW
    SPACE:   DATA
    SEGMENT: _DATA_GROUP_
    LENGTH:  0014H

specifies that a 14h byte long segment named _DATA_GROUP_ can't fit in the remaining DATA space. Referring to the link map, the DATA space starts at 8h and has a single segment ?DT?ASDFASDF that occupies 65h bytes. Since the DATA space is 80h bytes max., we can calculate the space remaining as 80h - (8h+65h) = 80h - 6Dh = 13h. So, there are only 13h bytes left in the DATA space. Since the _DATA_GROUP_ is 14h bytes long, it can't fit in the remaining 13h bytes.

If the memory space is DATA, you should look for the largest DATA segments. If they are static or global buffers, you may want to consider moving them to XDATA memory to conserve the DATA space.

MORE INFORMATION

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Friday, May 28, 2010


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.