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.

RTOS/TMS320C6678: MessageQ_create() blocked and do not return

Part Number: TMS320C6678

Tool/software: TI-RTOS

Hi,

I have asked the question in my previous post but when I thought it's solved, it happened again.

I'm using evmc6678, bios_6_52_00_12 , ipc_3_47_01_00.

My .cfg is as below:

var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');

var TransportQmss = xdc.useModule('ti.transport.ipc.c66.qmss.TransportQmss');

My application runs on 8 cores of c6678. And at the begining , I have called MessageQ_create() on all cores for a manager task.And during runtime, I'll create new task which needs to use MessageQ too.

So I call messageQ_create() to return a new handle for my new task. But my task blocked in MessageQ_create() and do not return.

In my previous post,  Judah have told me that MessageQ_create() will enters gate which may cause task blocked.

But I cannot see detail information about that from source code in MessageQ.c. I' don't know what may cause blocked at gate and how to pass it.

Thanks for help.

  • Hi,

    When I watch rov, I see something below:

    I'm using transportqmss. And rov indicates that my core7' s gatemp is entered by core0, which causes it blocked in messageq_create().

    My core0 may recieve msg from or send msg to core7, and core7 may recieve and send too.

    In my case ,how can I create msgQ successfully when using transportqmss during runtime?

    Thanks.

  • The Memory Browser shows the gate address is within heapMem:

    What I have found from the init code about this is :

            /* Create the heap that will be used to allocate messages. */
            GateMP_Params_init(&gateMpParams);
            gateMpParams.localProtect = GateMP_LocalProtect_INTERRUPT;
            gateMpHandle = GateMP_create(&gateMpParams);
    
            HeapBufMP_Params_init(&heapBufParams);
            heapBufParams.regionId  = 0;
            heapBufParams.name      = QMSS_MSGQ_HEAP_NAME;
            heapBufParams.numBlocks = HOST_DESC_NUM;
            heapBufParams.blockSize = QMSS_MTU_SIZE_BYTES;
            /* GateMP so allocation can take place within QMSS rx interrupt
             * context */
            heapBufParams.gate      = gateMpHandle;
            heapHandle = HeapBufMP_create(&heapBufParams);

    what will gateMp_localprotect_interrupt behave?

    My core0 receives msgs from all other cores and then process thenm and finally send back.

    what may cause it enter the gate and do not leave?

  • Hello,

    Can you try increasing this to 40 instead of 32?

    MessageQ.maxRuntimeEntries = 40;

    Also, can you please check ROV to see if you are running out of heap (HeapMem, HeapBuf) or stack?

    Does messageq_create return successfully on the other cores?
  • Hi,

    I try add MessageQ.maxRuntimeEntries = 40 in my .cfg files, but it didn't work.

    Other cores can't return successfully either.

    Below is what I see from rov, there are some errors report by bios.

  • Hello,

    We have an IPC example ex11_ping that creates a messageQ for each core just as you are trying to do. Have you referred to this already?

    Additionally, have you referred to the IPC documentation? There may be a step you missed, please refer to the API call flow for IPC and MessageQ.
    processors.wiki.ti.com/.../Ipc_Module
    processors.wiki.ti.com/.../MessageQ_Module

    Some other things to check for:

    Make sure you are using the correct version of XDCtools as listed in the Release Notes.
    software-dl.ti.com/.../Release_Specific.html

    Make sure all of the cores have attached using Ipc_attach() before trying to setup MessageQ as the attach will setup access to the SharedRegion, MessageQ transports, GateMP, etc. You can check the IPC module in ROV to verify this.

    Check this wiki page for any missing requirements/steps with using TransportQMSS:
    processors.wiki.ti.com/.../MCSDK_UG_Chapter_Developing_Transports

    Hope this helps.
  • Hi,

    I have read ex11_ping and found it's a bit different from my application.The difference between them is that my application call messageQ_create() when there are many other cores who are calling message_put() and message_get(). That is , my application( in a special core) will call messageQ_create() when there is a high concurrency situation (many other cores who works like the ex11_ping sending msg).

    Below are some example codes to show how my application works:

    core1 - core3:

    while(TRUE){
         MessageQ_get(localHandle, &msg);
         processMsg(msg);
         MessageQ_put(CORE0_queue, msg);    //send msg to core0
    }

    core0:

    while(TRUE){
         MessageQ_get(localHandle, &msg);       //recieve msg from other cores
         processMsg(msg);
         MessageQ_put(MessageQ_getReplyQueue(msg), msg);
    }

    And at sometime during runtime:

    core4:

    MessageQ_create(msgQueueName, NULL);

    In this point ,core4 will be blocked.

    However, when I change core1~3's code to 

    while(TRUE){
         MessageQ_get(localHandle, &msg);
         processMsg(msg);
         MessageQ_put(CORE0_queue, msg);    //send msg to core0
    
         for(i = 0; i < 1000; i++)
            for(j = 0; j < 1000; j++);
    }

    core4 can return from messageQ_create() successfully.

    However, I don't want to add some code like meaningless "for" loop. And I don't know how to adjust  i and j 's value to get it not blocked exactly.

    Can I check whether messageQ_create() will be blocked or not before I really call it? and How can I do to make messageQ_create() not blocked when there is a high concurrency situation?

    Thanks for your reply.

  • HI,

    I find that core4 has created a msgQ with name I give.

    Below is what I see from rov:

    taskExecutor_CORE4 is the name I pass to messageQ_create() which block my task.

    Why the msgQ is created successfully and it still does not return?

    Thanks for your help.

  • Hello,

    The MessageQ drivers can be found in ipc\packages\ti\sdo\ipc if you need more information on the underlying implementations.

    If you are still having issues, I recommend starting with the working example and adding one messageQ at a time. Otherwise, there are too many variables to pinpoint where the problem lies.