AnsweredAssumed Answered

ADSP-218x LDF file that supports overlays

Question asked by goldscott on Dec 1, 2011
Latest reply on Jan 16, 2012 by goldscott

Hello,

 

I'm trying to create a linker file that supports overlays, specifically data memory overlays.

 

I'm using the ADSP-2188 which has internal data memory in pages 0, 4, 5, 6, 7, and 8.

 

When I try to create a linker file I get the following error:

 

[Error li1078] ".\ADSP-2188.ldf":150 Run memory is the same as live memory for overlay 'dmpage0.ovl'.

 

dmpage0.ovl is in the overlay section of memory, 0x0000 to 0x1FFF.

 

If I try to create a new page

 

mem_dmpage0 { TYPE(DM RAM) START(0x000000) END(0x001fff) WIDTH(16)   }

 

I get the following error:


[Error el2013]  Memory 'mem_dmovly' overlaps with 'mem_dmpage0'

 

How can I get the linker to accept all overlays (including page 0) in the overlay space of 0x0000 to 0x1FFF without error?

 

 

To add an even further complication, I need to create two sections in overlay 0:

 

seg_data0  { TYPE(DM RAM) START(0x00000) END(0x0002F) WIDTH(16) }
seg_msg1   { TYPE(DM RAM) START(0x00030) END(0x0012F) WIDTH(16) }

 

 

How can I add these without the linker complaining?

 

Thank you!

 

 

 

Relevent part of the file posted below:

 

 

MEMORY
{
    //*** Program Memory ***
    seg_inttab { TYPE(PM RAM) START(0x00000) END(0x0002f) WIDTH(24)     }
   
    //must match start of DM seg_msg1 section!
    seg_pmda   { TYPE(PM RAM) START(0x00030) END(0x0012f) WIDTH(24)     }


    seg_code   { TYPE(PM RAM) START(0x00130) END(0x03fbf) WIDTH(24)     }
    seg_code2  { TYPE(PM RAM) START(0x03fc0) END(0x03fff) WIDTH(24)     }
   
   
    //*** Data Memory ***
   
    //Internal DM Overlay Segment ("Live" address).
    mem_dmovly  { TYPE(DM RAM) START(0x000000) END(0x001fff) WIDTH(16)   }
   
    //Internal DM Overlay Segments ("Run" addresses).
          
    mem_dmpage4 { TYPE(DM RAM) START(0x040000) END(0x041fff) WIDTH(16)   }
    mem_dmpage5 { TYPE(DM RAM) START(0x050000) END(0x051fff) WIDTH(16)   }
    mem_dmpage6 { TYPE(DM RAM) START(0x060000) END(0x061fff) WIDTH(16)   }
    mem_dmpage7 { TYPE(DM RAM) START(0x070000) END(0x071fff) WIDTH(16)   }
    mem_dmpage8 { TYPE(DM RAM) START(0x080000) END(0x081fff) WIDTH(16)   }
   
    //Internal shared memory (non-overlay).
    seg_shared  { TYPE(DM RAM) START(0x002000) END(0x003fdf) WIDTH(16)   }
   
    //slarson - don't need heap & stack.
    //seg_heap    { TYPE(DM RAM) START(0x03D00) END(0x03DFF) WIDTH(16) }
    //seg_stack   { TYPE(DM RAM) START(0x03E00) END(0x03FDF) WIDTH(16) }
         
         
}


PROCESSOR p0
{
    LINK_AGAINST( $COMMAND_LINE_LINK_AGAINST)
    OUTPUT( $COMMAND_LINE_OUTPUT_FILE )


    SECTIONS
    {
        sec_inttab
        {
            INPUT_SECTIONS( $OBJECTS(interrupts) )
        } >seg_inttab


        sec_code
        {
            INPUT_SECTIONS( $OBJECTS(program) )
        } >seg_code


        sec_code2
        {
            INPUT_SECTIONS( $OBJECTS(cal_vals) )
        } >seg_code2


        sec_shared
        {
            INPUT_SECTIONS( $OBJECTS(shared) )
        } >seg_shared



        seg_pmda
        {
            INPUT_SECTIONS( $OBJECTS(pm_da) )
        } >seg_pmda


        // support for initialization, including C++
        sec_ctor
        {
            INPUT_SECTIONS( $OBJECTS(ctor) )
        } >seg_shared
       
        sec_dmpage
        {                             
           
            PAGE_INPUT
            {
                ALGORITHM(ALL_FIT)
                PAGE_OUTPUT(dmpage4.ovl)
                INPUT_SECTIONS( $DMPAGE_OBJ_4(data1) )
            } > mem_dmpage4
           
            PAGE_INPUT
            {
                ALGORITHM(ALL_FIT)
                PAGE_OUTPUT(dmpage5.ovl)
                INPUT_SECTIONS( $DMPAGE_OBJ_5(data1) )
            } > mem_dmpage5
           
            PAGE_INPUT
            {
                ALGORITHM(ALL_FIT)
                PAGE_OUTPUT(dmpage6.ovl)
                INPUT_SECTIONS( $DMPAGE_OBJ_6(data1) )
            } > mem_dmpage6
           
            PAGE_INPUT
            {
                ALGORITHM(ALL_FIT)
                PAGE_OUTPUT(dmpage7.ovl)
                INPUT_SECTIONS( $DMPAGE_OBJ_7(data1) )
            } > mem_dmpage7
           
            PAGE_INPUT
            {
                ALGORITHM(ALL_FIT)
                PAGE_OUTPUT(dmpage8.ovl)
                INPUT_SECTIONS( $DMPAGE_OBJ_8(data1) )
            } > mem_dmpage8
           
            OVERLAY_INPUT
            {
                ALGORITHM(ALL_FIT)
                OVERLAY_OUTPUT(dmpage0.ovl)
                INPUT_SECTIONS( $DMPAGE_OBJ_0(data1) )
           
            }>mem_dmovly
           
        } > mem_dmovly
       
    }
}

Outcomes