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.

Need Help with Shared Region in C6472.

I want to use the Shared_region of IPC module, and dynamical allocate Memory in the shared_region,as mentioned in the "IPC_Users_Guide.pdf 3.8.3 Using Memory in a Shared Region, PP3-45",but when I used the function memory_alloc() such as the previous email, I found the address and value of return pointer is not in the shared_region_0, that is the pointer is not point to certain address belong to the shared_region_0. When I assign another sharedregion as Shared_region_1 located in the DDR2 by .cfg file, the probem is similar.

The address can be found in the *.map files.

in the cfg file setup as below:
var sharedMem         = 0x00200000;
var sharedMemSize = 0x00040000;
var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
SharedRegion.setEntryMeta(0,
    { base: sharedMem,
      len: sharedMemSize,
      ownerProcId: 0,
      isValid: true,
      cacheLineSize: cacheLineSize,
      createHeap: true,
      name: "SHARED_RAM",
    });

in the C file:

Ptr volatile buf;
#pragma DATA_SECTION(buf, "SHARED_RAM:SL2RAM");

buf = Memory_alloc((IHeap_Handle)SharedRegion_getHeap(0),10, 64, NULL);

So I think the buf address should locate in SHARED_RAM( 0x00200000-0x0023FFFF). and it should point to a address in SHARED_RAM.

but in the .Map file, I found the buf address(0x00240000) is out of SHARED_RAM,and when the code is running, it's value is not in the SHARED_RAM. ( the volatile is not Affect the results) .

In the .map file, SHARED_RAM address is different with the .CFG file.
ti.sdo.ipc.SharedRegion_0
*         0     00200000     00040000     NOLOAD SECTION
                       00200000     00040000     --HOLE--

SHARED_RAM
*         0     00240000     00000004     UNINITIALIZED
                       00240000     00000004     notify_multicore.obj (SHARED_RAM:SL2RAM)

Looking for your reply.

[ed for viewable format.]

  • You have defined the SHARED_RAM section in the .cfg file, and that name does show up in the .map file. But the address for this section in the .map file is not the same as the address you defined in the .cfg file. I am not knowledgeable about SYS/BIOS or the new build tools, but it would appear that the "ti.sdo.ipc.SharedRegion_0" was already defined at that address and your newly defined section was moved down to the next available address.

    Was there a warning message in the build process about overlapping or conflicting memory?

    Is there a .cmd file that gets created for the linker? It would likely show that the sections are being defined as shown in the .map file.