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.

TMDXIDK5718: RTOS load and run placement of .data section

Part Number: TMDXIDK5718
Other Parts Discussed in Thread: SYSBIOS

Hi

I'm using CCS7.3 with SYSBIOS V6.46.5.55 and GNU Compiler V6.3.1 to build an application for the A15 processor on IDK5718.

Accroding to

processors.wiki.ti.com/.../BIOS_with_GCC_(CortexA)

I tried to put the .data section into different memory segments for load und run time.
So I added the following to my config script:

Program.sectMap[".data"] = new Program.SectionSpec();
Program.sectMap[".data"].loadSegment = "DATA_INIT";
Program.sectMap[".data"].runSegment = "EXT_RAM";

DATA_INIT and EXT_RAM are defined by my own platform file.

In the automatically created linker command file (..\Debug\configPkg\linker.cmd) I can see that the memory segments are correctly defined (only relevant parts displayed):

MEMORY
{
    EXT_RAM (RWX) : org = 0x84000000, len = 0x3c000000
    DATA_INIT (RW) : org = 0x82000000, len = 0x2000000
}

In the same linker command file the .data section is defined as:

.data : {*(.data)}  > EXT_RAM AT> DATA_INIT

...

.data : {
        __data_load__ = LOADADDR (.data);
        __data_start__ = .;
        *(.got.plt)
        *(.got)
        *(.shdata)
        KEEP (*(.data))
        KEEP (*(.data*))
        *(.gnu.linkonce.d.*)
        . = ALIGN (4);
        __data_end__ = .;
} > REGION_DATA AT> REGION_TEXT


When I have a look at the created map file only the run address of the .data section is used (0x84000000 within EXT_RAM).
The load address is not used at all (__data_load__ sould be 0x82000000).

                0x84000000                __data_load__ = LOADADDR (.data)
                0x84000000                __data_start__ = .

How can I tell the linker to place the load adress of the .data section to a different address than the run address?

Regards,
Markus

  • The RTOS team have been notified. They will respond here.
  • Any update on this issue?

    Regards,
    Markus
  • Hi,

    Sorry, I missed this thread. In our Processor SDK RTOS driver example, we have similar case for VPS loopback. In the configuration file:

      Program.sectMap[".bss:frameBuffer"].loadSegment           = "APP_CACHED_DATA_BLK1_MEM";

    In the map file:

    APP_CACHED_DATA_BLK1_MEM 0x80c00000         0x0f400000

    .bss:frameBuffer
                    0x80c00000  0xf400000
     *(.bss:frameBuffer)
     .bss:frameBuffer
                    0x80c00000  0xf400000 C:\ti\pdk_am57xx_1_0_4\packages\ti\drv\vps\lib\am572x\a15\release\vps_examples_utility.aa15fg(bsputils_mem_default.oa15fg)
                    0x80c00000                gBspUtils_heapMemFrame

    So, I don't see a problem if you define a loadSegment and put data there.

    Regards, Eric

  • Hi Eric

    As it stil did not work I made some experiments.
    Then I found out that it perfectly works with sections which I defined on my own.
    e.g.:

    __attribute__((section(".mysection")))
    void TestFunction(void) {}

    Program.sectMap[".mysection"] = new Program.SectionSpec();
    Program.sectMap[".mysection"].loadSegment = "DATA_LOAD";
    Program.sectMap[".mysection"].runSegment = "DATA_TUN";

    Everything I put in that section occurs in the right place in the map file.

    But when I try to put build-in sections (like .text, .data, .bss, ...) to a different place it is completely ignored.
    Any ideas?

    Regards,
    Markus