ADSP-218x LDF file that supports overlays

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
       
    }
}

  • Hi,

    I would recommend taking a look at EE-100 and EE-249 which cover overlays on the 218x. These can be found via the 'Application Notes' link for 21xx processors from the following page on our website: http://www.analog.com/ee-notes

    regards,

    Colin.

  • Hello,

    I have looked at EE-249 and EE-133.

    I just had a look at EE-100, where I read: "In order to resolve this problem, the newest linker, version 2.3 allows different modules to be linked to the same address. The readme file that comes with the latest linker explains the how the linker is used to have different modules reside at the same address."

    I have no idea where to find that readme.

    I'm using VDSP++ 3.5 and I have the "Linker and Utilities Manual for 16-bit Processors" open, but not finding anything about how to make the linker accept what I am trying to do.

    I believe I have figured out the first part of my problem - mem_dmpage0 happily coexists with mem_dmovly.

    But I still need to figure out how 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) }

  • Hi,

    EE-100 is a pretty old engineer note. While a lot of the information is still relevant, the Linker version 2.3 it refers to was a patch for VisualDSP++ 2.0. The Linker in VisualDSP++ 3.5 October 2006 Update (v3.4.1.5) supports overlays fully.

    Have you taken a look at the overlay examples available for the 218x family? These are available in the VisualDSP++ installation directory at "...\218x\Examples\", and include hardware and software overlays. An additional example is available at "...\218x\EZ-KITs\ADSP-2189M\Examples\Overlay\".

    If the problems persist, I would recommend contacting private support through the link below so that we can get a copy of your project to take a look.

    http://www.analog.com/processors/support

    Regards,

    Craig.

  • Thanks for pointing me to those examples, Craig.

    For an easy fix, I just moved "seg_data0" and "seg_msg1" into the non-overlayed data memory.

    One last question:

    Say I have program space from 0x0000 to 0x3FFF.

    0x0000 to 0x002F is for interrupt vectors, and 0x2000 to 0x20FF is for some data.

    The remainder of that space is for the program (seg_1: 0x0030 to 0x1FFF and seg_2: 0x2100 to 0x3FFF).

    I don't care whether code is placed in seg_1 or seg_2. How can I tell the linker to place code in either of those two sections?

    Thanks!

    Scott

    EDIT: I think I just stumbled upon my answer. Simply create two sections that take the same $OBJECTS.

            sec_code
            {
                INPUT_SECTIONS( $OBJECTS(program) )
            } >seg_1
           
            sec_code2
            {
                INPUT_SECTIONS( $OBJECTS(program) )
            } >seg_2

  • Well, overlays are still not working.

    After building, I get a pop-up warning saying "The file is invalid or damaged"

    dmpage4.ovl is the first overlay. There's nothing even in it.

    Frankly, the linker documentation is terrible.

    Console output:

    Loading: "C:\Documents and Settings\sclars\Desktop\MAC Code\MAC 0.2 10_21_2011\MAC\mac_dsp_code\Debug\mac_dsp.dxe"...
        Loaded: "C:\Documents and Settings\sclars\Desktop\MAC Code\MAC 0.2 10_21_2011\MAC\mac_dsp_code\Debug\dmpage4.ovl"
        The file is invalid or damaged
        Load failed.