Quantcast
Channel: Processors
Viewing all articles
Browse latest Browse all 123889

Forum Post: RE: IPC between 2 cores gives invalid region

$
0
0

Jim,

I think you're creating two heaps, both with region ID zero.  This is causing the invalid ID error.

When you initialize the SharedRegion in the .cfg you're creating a default heap with region ID 0.  Then in your source you attempt to reuse the default shared region heap to create a heapBufMP, again with ID 0.  When you register the heap with MessageQ it fails during allocate because it doesn't know which heap to use.

If you look at some of the PDK multi-core examples using IPC you'll notice that in some you can register the SharedRegion default heap with MessageQ directly in the following manner:

#define HEAP_ID 0

MessageQ_registerHeap((IHeap_Handle)SharedRegion_getHeap(0), HEAP_ID);

I'm not sure which PDK you're using but a good example is in pdk/packages/ti/transport/ipc/examples/qmssIpcBenchmark

in bench_qmss.cfg the SharedRegion is configured:

var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
SharedRegion.translate = false;
SharedRegion.setEntryMeta(0,
    { base: Program.global.shmBase,
      len: Program.global.shmSize,
      ownerProcId: 0,
      isValid: true,
      cacheEnable: cacheEnabled,
      cacheLineSize: cacheLineSize,  /* Aligns allocated messages to a cache line */
      name: "internal_shared_mem",
    });


In the source, bench_qmss.c, the following process is performed:

In main():

  1. attachAll() - Ipc_start() called and all cores attached via Ipc_attach()
  2. Every core creates its local queue via MessageQ_create()
  3. BIOS_start() -> tsk0 runs

In tsk0:

  1. SharedRegion default heap registered with MessageQ -> MessageQ_registerHeap((IHeap_Handle)SharedRegion_getHeap(0), HEAP_ID);
  2. Each core opens a remote MessageQ
  3. Tests cases executed (Include calles to MessageQ_alloc/put/get/free()

So again, trying removing the heapBufMP init code and registering the SharedRegion default heap with MessageQ directly.

Justin



Viewing all articles
Browse latest Browse all 123889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>