原创 BL51: ERROR 107 (ADDRESS SPACE OVERFLOW)

2011-4-7 16:19 4256 7 7 分类: 工程师职场

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

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
EE直播间
更多
我要评论
0
7
关闭 站长推荐上一条 /3 下一条