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.

MessageQ communication between Linux host and TI RTOS DSP

Expert 1940 points

I am having some issues with MessageQs to send messages back and forth Linux host and TI RTOS DSP on DRA7xx.

Until recently I was using sample code(with some of my changes) and it worked fine to send rpmsg packet to a messageQ back and forth.

But now I have to send continuous rpmsg packets to different MessageQs and I am seeing that after sending the first message, Message_get() on linux side is returning -20 error code, which I think is something like message destroyed or non existent.

Now I have the following questions:

1. I read in documentation about using heapBuf and registering it before MessageQ_alloc().

how can I do this on Linux side, if I am allocating messageq on host?

2. How do MessageQ memory allocated in sample code(TI IPC example code)? I do not see a MessageQ_registerHeap() call in most of the example files I looked at. Did I miss something here?

3. How did my code work, without me explicitly allocating any Heap memory for MessageQ_alloc? Is there some default option available?

Here are the packages I am using now on DRA7xx with DSP running on TI RTOS and Linux on ARM,

IPC - 3.36.01.11

SYSBIOS - 6.41.03.51

XDC - 3.30.06.67-core

CGT6x - 7.4.4

Thanks.

  • I've moved your thread to the device forum. They are handling IPC questions now.

    Todd
  • Hi, Girish,

    MessageQ_alloc will allocate memory from default areas based on the heap Id. If you want to use a dedicated heap area other than default areas, you call HeapBufMP_create to create the dedicated area and register its HeapID by calling HeapBufMP_registerHeap. However, this only applies to DSP/BIOS side. On Linux, it is only malloc. If you trace the code for MessageQ_alloc down, MessageQ_alloc()->IHeap_alloc()->HeapStd_alloc(), it calls malloc eventually.

    void *HeapStd_alloc(void *handle, size_t size)
    {
        void *block;

        block = malloc(size);
        return (block);
    }

    Rex

  • Hi Rex,
    I initially thought the issue I am seeing in my code might be related to heap allocation for MessageQ.
    But now after debugging more, it looks like remoteproc is crashing and causing MessageQ_get to return -20 which is MessageQ_E_SHUTDOWN.
    I posted another question regarding the issue. Could you take a look at it.
    e2e.ti.com/.../534807

    -Girish