This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DSP C6748; ERROR: placement fails for object ".text"

Other Parts Discussed in Thread: TMS320C6748

I am currently working on an audio encoder and trying to implement it on DSP TMS320C6748. Currently I am facing some memory issues . The following error is displayed while I am trying to build the project in CCS v4.2 :

"../Encoder.cmd", line 35: error: placement fails for object ".text", size
0x49120 (page 0). Available ranges:
L2 size: 0x40000 unused: 0x130c0 max hole: 0x12f80
error: errors encountered during linking; "uart.out" not built

As far as I am able to understand and get already available help from other forums, the error is regarding the amount of memory being consumed by my code.

The DSP board that I am using has no external memory support and only internal memory of the above mentioned DSP is available.

Kindly explain what does the above mentioned error exactly means and how to resolve it ?

Regards, 

  • Hi,
    Attach your .cmd file.
    If possible attach the project too.
  • This forum is not allowing me to upload .cmd file. It only attaches some specified extensions 
    So I have change the the extension. After downloading , change it to cmd 
    Hope it will work for you .

  • Hi,
    I'm not able to find your attachment.
    Could you please attach as *.txt file and I will rename to .cmd.
  • Here is the .txt file 

    Encoder.txt
    // ============================================================================
    // Linker Command File for Linking c674 DSP Programs
    //
    // These linker options are for command line linking only. For IDE linking,
    // you should set your linker options in Project Properties.
    //         -c                    Link Using C Conventions
    //        -stack     0x1000        Software Stack Size
    //        -heap    0x1000        Heap Area Size
    // ===========================================================================
    -stack 0x1000
    -heap 0x1000
    
    // ============================================================================
    //                         Specify the System Memory Map
    // ============================================================================
    MEMORY
    {
        L1P:    o = 0x11E00000        l = 0x00008000
        L1D:    o = 0x11F00000        l = 0x00008000
        L2:     o = 0x11800000        l = 0x00040000
        DDR2:   o = 0xC0000000        l = 0x08000000
    }
    
    // ============================================================================
    //                 Specify the Sections Allocation into Memory
    // ============================================================================
    SECTIONS
    {
        .cinit        >        L2               // Initialization Tables
        .pinit        >        L2               // Constructor Tables
        .init_array   >        L2               // 
        .binit        >        L2               // Boot Tables
        .const        >        L2               // Constant Data
        .switch       >        L2               // Jump Tables
        .text         >        L2               // Executable Code
        .text:_c_int00: align=1024 > L2         // Entrypoint
        
        GROUP (NEARDP_DATA)                       // group near data
        {
           .neardata
           .rodata
           .bss                                   // note: removed fill = 0
        }             >        L2
        .far: fill = 0x0, load > L2             // Far Global & Static Variables
        .fardata      >        L2               // Far RW Data
        .stack        >        L2               // Software System Stack
        .sysmem       >        L2               // Dynamic Memory Allocation Area
        
        .cio          >        L2               // C I/O Buffer
        .vecs         >        L2               // Interrupt Vectors
    }
    

  • Thanks for sharing the file.
    What is your code size ?
    It should not exceed more than 256KiB since L2 RAM size is 256KiB.

    The sounds seem memory is not sufficient to fit into L2 RAM.

    Try to use DSP L1P/D RAM. Configure from cache to RAM.
  • My code size is about 300KB. Since I am using some very large arrays in my code,only these arrays are of 264 KB.
    Now Can I build my project on this DSP or I need some other one ?
    Can you recommend any ?

    Regards,
  • Muhammad,

    In further detail of your error message, it says the amount of memory space needed by your program code (.text section) is 0x49120 bytes. And it says that there is only space available for 0x130c0 bytes after the linker has allocated other sections, perhaps data variable storage space.

    The linker will generate a .map file. You can look in this file to see the size of all of the sections of your application.

    You will need to do one or more of the following:

    1. Reduce the data arrays used in your application. These are most likely the cause of the large space being used even before getting to the program.
    2. Reduce the size of the program code by using compiler optimization switches.
    3. Make use of the 128KB shared memory block on the C6748. Using this may complicate your linker command file. You will need to ask in Compiler forum how to do this, and study the training material for the C6748 such as the C6000 Embedded Processor Workshop.
    4. Make use of L1P and L1D sections instead of using them for cache. This may hurt your performance by reducing cache, and it will make your linker command file more complicated to make use of this space.
    5. Add external memory by modifying your board.

    Regards,
    RandyP
  • After reading your reply and after going through the .map file , I realized that my actual code size is approximately 526 KB.  Still this code is not complete. I have to add some extra peripherals to the board which obviously carry some space. Also I might need to incorporate some SYS BIOS in my system. So memory is a major problem for me.

    I am making a real time application so I can not afford slow processing,hence I can not use external memory. Also I have no expertise in that so, in spite of that I am ready to spend money to get some other processor which can do the work for me but I am not sure which processor will suit me.

    Regards,
    Muhammad Ather

  • Muhammad,

    Since you do not know how much memory your application will need, I will guess that you also do not know how much processing performance your application will need. These two datapoints are critical to choosing a processor, and a lot of analysis must be done by your engineering staff to determine these, depending on the complexity of the application, of course.

    One easy approach would be to get an LCDK6748 board and build your application. Use the external memory and use as much cache as is possible for your application. If you have some small critical functions, place those in L2 SRAM but you can leave many sections of your program and data in external memory. You can at least use this low-cost platform to determine whether you have performance issues or not.

    Another approach would be to move to a much more powerful processor and get an EVM6657. On your own board, you could use a less powerful version, but for development it is always good to have more processor speed and more memory than you will need. The C6657 has 2 1GHz DSP cores that are the next step up from the one in the C6748. And it has 1MB shared SRAM plus 1MB local L2 memory for each core. So even if you use the 1-core C6655 on your own board, you will still have 2MB of internal SRAM.

    In most cases, you will still want to use some of the options I mentioned in my earlier post, especially #2 to get faster performance in addition to the smaller program size.

    Regards,
    RandyP
  • RandyP

    You got it right. I am new to code composer studio and does not know much of it. You talked about the two data points : processing performance and memory. How can I be sure about these parameters.

    I have my code in visual studio and it is working absolutely fine there. What profiling techniques I may use to get the desired parameters ?

    Is there any simulation environment available where I may test whether my application can work on a particular board or not ?

    Regards,

    M. Ather
  • Muhammad,

    If you are looking for engineering design resources, you can look through the TI Design Network. This can be found from TI.com by clicking on Support & community and then clicking on TI Design Network.

    I believe you understand the original problem, which is what Titus and I were helping you with. If you are now interested in profiling and simulators, you will want to start a new thread in the Development Tools part of the E2E forum.

    My top advice is the two boards I mentioned above, or the techniques listed earlier for reducing the problem.

    Regards,
    RandyP