Post Go back to editing

regarding visual dsp ++ 5.0

hi,

i am using visual dsp ++ 5.0 on the adsp 21062 platform. i am using c language for source coding. after building the project i saw the message

Out of memory in output section 'seg_dmda' in processor 'p0'
        Total of 0x20100 word(s) were not mapped.
For more details, see 'linker_log.xml' in the output directory.

but in the ldf file i saw a part of memory that was unused. how to debug this problem.

thanks and regards,

phani tej

  • Hi Phani Tej,

    The error message is reporting a very large amount of data that cannot be mapped - 0x20100 words is around 128K words of memory - more than the whole internal memory space of the 21062.

    Checking the linker_log.xml file will help you determine where the data is coming from (the error will list the problem data something like "0x4 words required for a.doj(seg_dmda):0x0". That means the data is coming from a source file "a" (a.c, a.cpp, a.asm, etc). Are you allocating any very large static arrays in this object?

    Does your target have external memory on board that it can use? If so, you may need to modify your LDF to overflow (or specifically place) this data in external memory. I can give you more information on doing so, if you do have external memory and need any more assistance.

    The help is quite detailed on the underlying cause and fixes for the li1040 error, if you search within the 'Help: Index'.

    Regards,

    Craig.

  • Hi Phani Tej,

    Unfortunately this cannot be done with the 21062 Simulator. The large static arrays you are trying to define exceed the capacity of internal memory, and the 21062 Simulator does not simulate the External Port - therefore there is no simulation of external memory.

    For details of the supported simulator peripherals, please see the table, here:

    FAQ: Which peripherals are supported by the SHARC simulator?

    On hardware, with a similar situation, there would be a couple of options, both include first making sure you have an LDF in your project. If you don't, go to 'Tools: Expert Linker: Create LDF'. Go through the wizard, and when it completes the Expert Linker will open, and your project will have a *.ldf file in the 'Linker Files' folder. Close the Expert Linker (you won't need it).

    Open the LDF by right-clicking and choosing "Open with source window". Scroll right down to the bottom and you'll see this 'Output Section':

            seg_sram
            {
                INPUT_SECTIONS($OBJECTS(seg_sram) $LIBRARIES(seg_sram))
            } > seg_sram
    

    This is what maps code to External Memory (search for the MEMORY{...} block about mid-way up the LDF to see how the memory blocks are defined).

    If you open that linker_log.xml file that the error message mentions, you will see something like this:

         0x20100 words required for .\Debug\BigArray21062.doj(seg_dmda):0x0

    Notice this mentions "seg_dmda", but the INPUT_SECTIONS command above only mentions "seg_sram". Here is Option 1 for a solution:

    Go to your source file, where you define the array(s), and use the section pragma to force the array into "seg_sram". Something like:

    #pragma input_section("seg_sram")
    int BigArray[20000000];
    

    This will make the linker place your data in seg_sram, and the project should link.

    Option 2 involves editing the LDF. Find the output section I mentioned above, and just add another INPUT_SECTIONS command to map "seg_dmda" into it. I think this is a better solution, as this means that SDRAM will act as an overflow for ALL seg_dmda data that cannot fit in internal memory:

            seg_sram
            {
                INPUT_SECTIONS($OBJECTS(seg_sram) $LIBRARIES(seg_sram))
                INPUT_SECTIONS($OBJECTS(seg_dmda) $LIBRARIES(seg_dmda))
            } > seg_sram
    

    Hope that helps.

    Regards,

    Craig.

  • hi craig,

    i am using very large static arrays . i dont use evaluation board . i am just verifying the program with the simulator ..

    any help would be appreciated

    regards,

    phani tej