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.

Linux/AM5728: IPC MessageQ configuration details

Part Number: AM5728

Tool/software: Linux

Hi All,

I am using MessageQ to interrupt DSP core from A15, when DSP is not under heavy load MegQ is working fine but when DSP under heavy load, at A15 end when I am trying to put msg using  MessageQ_put() I am getting following errors, is there any MessageQ related configuration I have to do to increases MessageQ  length or any other configuration to avoid tx buffer error/rpmsg_send failed .

Logs:

rpmsg_proto virtio0.rpmsg-proto.-1.61: timeout waiting for a tx buffer

rpmsg_sock_sendmsg: rpmsg_send failed: -512
TransportRpmsg_put: send failed: 512 (Unknown error 512)

 [t=0x00000019:513e78fa] xdc.runtime.Memory: ERROR: line 52: out of memory: heap=0x951e6928, size=64
 xdc.runtime.Memory: line 52: out of memory: heap=0x951e6928, size=64
[t=0x00000019:514054f6] ti.sdo.ipc.MessageQ: ERROR: line 503: assertion failure: A_invalidMsg: Invalid message

This application code is similar to ex02_messageq IPC example. I am using AM57xx EVM.

Regards,

Snehal

  • Hi, Snehal,

    The debug print shows the DSP is out of memory. Have you look into it? It seems to me that the messageQ and your other application are competing memory usage. I'll have DSP expert to work on this issue with you.

    Rex
  • Hi Snehal,

    Adding to Rex's comment, you can increase your heap in the Dsp1.cfg file. The error message indicates that there was a request for a block size of 64. Please try this first and let us know how it goes.

    Also, not sure if this is related to your issue but just an FYI, the max messageQ size (bound by Rpmsg) is 512 bytes.
  • Hi Rex and Sahin,

    Thanks for the help.

    Now I have increased the heap size and there is no error related to heap memory.

    There is still error related to MessageQ_put(), the following is the log, is there any way to check/configure this MessageQ length (max numbers of messages we can have in one queue)?

    [ 908.653046] rpmsg_proto virtio0.rpmsg-proto.-1.61: timeout waiting for a tx buffer
    [ 908.662156] rpmsg_sock_sendmsg: rpmsg_send failed: -512
    TransportRpmsg_put: send failed: 512 (Unknown error 512)

    Regards,

    Snehal

  • Hi, Snehal,

    I think this is foundamental problem not be solved by increasing queue length. It looks to me that the messageQ on DSP side doesn't get a chance to consume the messages during heavy load. Only when the message is consumed, then it gets released back to the pool. This is why the linux showing out of tx buffers. They are not consumed by slave. My opinion is that you should design your DSP application to consume the MessageQ messages first.

    Rex
  • Hi Rex,

    Will check on releasing queue at dsp to avoid tx buffer overflow.
    One last question: I have gone through IPC user guide and ex0_2messageq IPC example but did not any detail on size of MessageQ, either hostQ or slaveQ (localQ/remoteQ).

    Regards,
    Snehal
  • Hi Snehal,

    The size of the MessageQ is dynamically allocated based on the size of the message, which is defined in ex02_messageq\shared\AppCommon.h.

    If you need anymore details, please let us know.
  • Hi Sahin,

    I have gone through this header file but did not get detail on messageQ length, 

    Could you please point out where in ex02_messageq\shared\AppCommon .h?

    Regards,

    Snehal

  • Hello,

    The message is defined in the following code snippet:

    typedef struct {
        MessageQ_MsgHeader  reserved;
        UInt32              cmd;
    } App_Msg;