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.

IPC MessageQ between ARM and DSP on OMAP-L137

Other Parts Discussed in Thread: OMAP-L137, SYSBIOS

Hi,

I want to use IPC MessageQ to communicate between the ARM and DSP on an OMAP-L137 EVM board.  I have created a simple example with a queue reader and queue writer tasks.  If both tasks run on the ARM then everything works fine and the messages get passed across the queue between the tasks. Likewise if I run both tasks on the DSP everything works fine as well.

Now, if I run the reader task on the ARM and the writer on the DSP then nothing happens.  The reader task creates the MessageQ and waits for the writer to add messages to the queue.  However, the writer task is never able to find the queue and returns a status of -5 (item not found) when it tries to open the queue.

I am assuming that there is some setup or configuration that needs to be done to ensure that both CPUs are sharing the MessageQ data structures using the shared RAM at address 0x80000000 (assuming that's how it is supposed to work on an OMAP setup).  I have tried various things like creating a shared region at 0x80000000 to force MessageQ to use that and creating and registering a heap in that common area but nothing seems to make any difference.   However, I might be missing the point totally about how IPC works between ARM and DSP on an OMAP.

Any clues or examples as to where I am going wrong would be very helpful.

Thanks.

  • Hi Mike,

    Could you post the configuration file you're using for the DSP?  Also, what version of IPC are you using?

    Thanks,

        Janet

  • Janet,

    I am using IPC version 3_20_00_06.

    I took the approach of restarting from scratch and building step-by-step.  Firstly ensuring that the two processors had synchronised before adding a simple Notify service and checking that was working correctly.  Then I added the MessageQ interface and tested that.  Everything seems to be working fine now between ARM and DSP.

    I'm not sure what was the problem was but it's a worthwhile lesson to build things up in stages and making sure the basics such as the processor synchronisation are up and running before moving on.

    Mike.

  • I'm having a helluva time getting similar comms to work... Can someone comment about what I should *expect* to work??? Currently using the OMAPL137 EVM from Spectrum Digital, CCS6 on Win, XDC 3.30.5.60, IPC 3.30.2.13, SYSBIOS 6.41.0.26.

    Thanks.

    Steve
  • Hi Steve,

    This is going back a couple of years now so I have to try and remember how it all worked. I do recall it was quite tricky to get it all set up and working, after which it became more obvious!! I still have the projects I used and the OMAP-L137 board but the PCs and tools have moved on so rebuilding my example might be more of a problem but I might have a go out of curiosity.

    So, this was all based on SYS/BIOS on the ARM and DSP; no Linux on the L137. We did move on later to using the same basic methods on an L138 platform with Linux on the ARM. ARM and DSP both did the basic configuration before SYS/BIOS was set running. After that they used message queues to share data both ways.

    The following snippets might help or at least give a few clues. I can't share the files I used directly.

    Regards,
    Mike.

    The SYS/BIOS for both ARM and DSP had the following in the config. The ARM 'owns' the shared area and the DSP maps to it.

    var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
    var Notify = xdc.useModule('ti.sdo.ipc.Notify');
    var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
    var Idle = xdc.useModule('ti.sysbios.knl.Idle');
    var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
    var Load = xdc.useModule('ti.sysbios.utils.Load');

    var SHAREDMEM = 0x80000000;
    var SHAREDMEMSIZE = 0x00010000;
    SharedRegion.setEntryMeta(0,
    { base: SHAREDMEM,
    len: SHAREDMEMSIZE,
    ownerProcId: 0,
    isValid: true,
    cacheEnable: true,
    cacheLineSize: 128,
    createHeap: true,
    name: "internal_shared_mem" });

    /* ARM will get assigned processor id 0. */
    /* DSP will get assigned processor id 1. */
    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
    MultiProc.setConfig("DSP", ["HOST", "DSP"]);

    Ipc.procSync = Ipc.ProcSync_ALL;

    The initialisation part (in main) seemed to be along the following lines. Start IPC, get heap memory and register it with message queues. Create message queues.

    MessageQ_Handle Qu_xyz;
    status = Ipc_start();
    heap = SharedRegion_getHeap(0);
    /* Register shared memory heap with MessageQ */
    status = MessageQ_registerHeap( heap, HEAPID);
    /* Create message queue(s) to receive data*/
    Qu_xyz = CreateMessageQ ("Qu_xyz");
    BIOS_start(); /* does not return */

    Then in SYS/BIOS periodic tasks send and receive over the message queues, e.g. The receiving node creates the message queue and pulls data from it. The sending node opens the remote queue by name and pushes data to it. A queue only operates in the one direction. If both nodes need to send and receive then each must create a separate queue to receive on.

    To send (remote node would have created the queue; we just open it and send to it)...

    /* Open the remote message queue(s) */
    XyzQueueId = OpenMessageQ("Qu_Xyz");

    loop sending data to remote queue...
    status = SendMessageQ(XyzQueueId , HEAPID_LOCAL, &msgId1, &MsgData, sizeof(MsgData));

    To receive (on the queue created at init)...
    loop...
    status is zero if no data received, or has size of data received
    status = ReceiveMessageQ(Qu_Xyz, &Data, sizeof(Data));

  • Mike -


    Thanks for digging in.  You're describing at a high-level exactly how I was going about it. We've decided, though, largely based on how difficult IPC is to get working, to use the MUCH simpler rCSL stuff instead: .
    Steve