Out of ROM space. End address does not match code size

  • Marc Leroux

    Marc Leroux - 2013-10-25

    When I try to compile my code I get an error message saying that there is Insufficient ROM space

    ?ASlink-Error-Insufficient ROM/EPROM/FLASH memory.

    This is .mem output:

    Name Start End Size Max
    ---------------- -------- -------- ------- - --------
    PAGED EXT. RAM 0 256
    EXTERNAL RAM 0x7600 0x76fe 255 288
    ROM/EPROM/FLASH 0x0000 0x6ee0 30216 30208

    My code space is defined as 0x0000 to 0x7600 or 30,208 bytes.
    The compiler says the last address is 0x6ee0 which is 28,384 bytes.
    If I look in .map there are no code or variables after address 0x6ee0

    Why is the size reported 30,216? It seems I am missing ~2K bytes. Where do they go?

    .map reports CSEG as 28,248 bytes.

    BSEG 0000 0002 = 2. bits (REL,CON,BIT)
    DSEG 0000 0076 = 118. bytes (REL,CON)
    ISEG 0000 00AD = 173. bytes (REL,CON)
    SSEG 00D1 002C = 44. bytes (REL,OVR)
    XSEG 7600 00FF = 255. bytes (REL,CON,XDATA)
    CSEG 0089 6E58 = 28248. bytes (REL,CON,CODE)
    XSEG = 0x7600
    PSEG = 0x7600
    ISEG = 0x0024
    BSEG = 0x0000

    This is the .lnk file

    -a 0x0100
    -A 0x2c
    -v 0x0120
    -w 0x7600
    -b HOME = 0x0000
    -b XSEG = 0x7600
    -b PSEG = 0x7600
    -b ISEG = 0x0024
    -b BSEG = 0x0000
    -k sw/bin/../share/sdcc/lib/large
    -k /usr/local/share/sdcc/lib/large
    -l mcs51
    -l libsdcc
    -l libint
    -l liblong
    -l libfloat

    Thank you for your help

    Last edit: Marc Leroux 2013-10-25
  • Maarten Brock

    Maarten Brock - 2013-11-16

    Hello Marc,

    I guess the only explanation can be that there are somehow overlapping areas in your code. This keeps the End address below the Max but the sum of all area sizes (Size) is still bigger than Max.



Log in to post a comment.