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.

CCS/AM5718: Move the allocation of progam/data and stack to internal L3 OCMC_RAM

Part Number: AM5718


Tool/software: Code Composer Studio

Hi

AM5718

Let say that we want to place the code,data and stack in OCMC_RAM, after creating a Project, is manipulation of the linker.cmd file the only way of moving an applications memory location?

It is possible to move ceartain sections around, for example like adding thsi to the app.cfg file

  
Program.sectMap[".c_int00"] = new Program.SectionSpec();
Program.sectMap[".c_int00"].loadAddress = 0x40300000;
Program.sectMap[".c_int00"].runAddress = 0x40300000;

 

But that is just one section, do we need to move all sections around like this?

Regards

  • Stefan,

    You can do this with all the sections in two ways

    Approach 1:  Use Program.sectMap[]  in the configuration script.

    Approach 2: Add a second linker command file to the project. The platform memory sections are pre-defined so in the second linker command file use normal syntax only to place certain code sections. To do this effectively, open the .map file (In Debug folder in the project) and see the sections generated and identify the sections that are not placed as expected and then create the custom linker command file to force the sections to different memory section

    For example if you have a custom .benchmark_buffer section in your code defined using __attributes__ and you want to place it in shared onchip memory then open the .map file and locate the Memory configuration as shown below:

    Memory Configuration

    Name             Origin             Length             Attributes

    SRAM             0x402f0000         0x00010000         xrw

    OCMC_RAM1        0x40300000         0x00080000

    OCMC_RAM2        0x40400000         0x00100000

    OCMC_RAM3        0x40500000         0x00100000

    EXT_RAM          0x80000000         0x80000000

    *default*        0x00000000         0xffffffff

    Create a linker command file  as shown below in your project

    SECTIONS {

    .benchmark_buffer : ALIGN (32) {

       } > OCMC_RAM2

    }

    Regards,

    Rahul