Max ROM size supported by the latest SDCC ?

Tony Zhang
2007-07-06
2013-03-12
  • Tony Zhang

    Tony Zhang - 2007-07-06

    Hi,all
      There are two questions.
      (1)
       I just want to know the max code size SDCC supported. It must be the size of the file hex. The following is my memory map from SDCC. The max size is 65536, Is there any options that can get rid of this limitation.
      (2)
      "ERROR: Couldn't get 147 bytes allocated in internal RAM for area DSEG."
      In fact, the whole RAM is 256 Bytes. how could this happen? why does the SP start from 0x72?

    Internal RAM layout:
          0 1 2 3 4 5 6 7 8 9 A B C D E F
    0x00:|0|0|0|0|0|0|0|0|a|a|b|b|b|b|b|b|
    0x10:|b|b|b|b|b|b|b|c|c|c|c|d|e|f|j| |
    0x20:|B|B|B|B|T|g|g|g|g|g|g|g|g|g|g|g|
    0x30:|g|g|g|g|h|h|h|h|h|h|h|h|h|h|h|h|
    0x40:|h|h|h|h|h|h|h|h|h|i|i|i|i|i|i|i|
    0x50:|i|i|i|i|i|i|i|i|i|i|i|i|i|i|i|i|
    0x60:|i|i|k|k|k|Q|Q|Q|Q|Q|Q|Q|Q|Q|Q|Q|
    0x70:|Q|Q|S|S|S|S|S|S|S|S|S|S|S|S|S|S|
    0x80:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|
    0x90:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|
    0xa0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|
    0xb0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|
    0xc0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|
    0xd0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|
    0xe0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|
    0xf0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|
    0-3:Reg Banks, T:Bit regs, a-z:Data, B:Bits, Q:Overlay, I:iData, S:Stack, A:Absolute

    ERROR: Couldn't get 147 bytes allocated in internal RAM for area DSEG.
    Stack starts at: 0x72 (sp set to 0x71) with 142 bytes available.

    Other memory:
       Name             Start    End      Size     Max    
       ---------------- -------- -------- -------- --------
       PAGED EXT. RAM                         0      256  
       EXTERNAL RAM     0x0000   0x001f      32    65536  
       ROM/EPROM/FLASH  0x0000   0x101cb  65996    65536  
    *** ERROR: Insufficient ROM/EPROM/FLASH memory.

     
    • Maarten Brock

      Maarten Brock - 2007-07-09

      1) The max code memory SDCC can easily address is 64 kB. There are cumbersome ways to use more.

      2) No 8051 has more than 128 bytes data memory. You will have to move something to idata/pdata/xdata.

      Maarten

       
    • Tony Zhang

      Tony Zhang - 2007-07-09

      Any body here?

       
    • Tony Zhang

      Tony Zhang - 2007-07-09

      Any body here?

       
    • Tony Zhang

      Tony Zhang - 2007-07-09

      Sorry for the reply I posted twice. There are something wrong with my IE.

      Thanks for your attention,

      (1)What's the cumbersome ways? It's very kind of you to give me some clues on this.

      (2)you'r right, there're only 128 bytes data memory. Actually, Only four globle varibles can be set to idata/xdata/pdata areas in my project. I believe the other needed data memory is required for the overlaying. Well how can I do some changes in this situation? Some guys suggested that doing the overlay manually, I don't think It's the best way.

      (3)Do code banking supported by SDCC?

       
    • Maarten Brock

      Maarten Brock - 2007-07-09

      1,3) Cumbersome is bank switching. You will have to declare some functions as "banked" and you will have to put the objects in named code segments using a pragma or command line switch (codeseg). Then you can tell the linker to put those named segments at addresses above 0x10000.

      2) Which options are you using? Sometimes --stack-auto gives better results than --model-medium or --model-large when it comes to memory usage.

       

Log in to post a comment.