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/TDA2PXEVM: Inserting data to MessageQ results in application to hang or unrecovery state.

Part Number: TDA2PXEVM
Other Parts Discussed in Thread: TDA2

Tool/software: TI-RTOS

Hello Everyone,

Using MessageQ_put makes my application to hangs and results in unrecovery state.

Created a MessageQ with below configurations in NetworkCtrl Module which is part of NDK which runs of A15.

Changes in NetworkCtrl module...
My structure being..

typedef struct MyMsg {
    MessageQ_MsgHeader header;
    uint32_t datasize;
} MyMsg;

#define HEAP_NAME   "myHeapBuf"
#define HEAPID      1
#define NUMLOOPS    10

MessageQ_Handle   messageQ;
MessageQ_Params   messageQParams;
SyncSem_Handle    syncSemHandle;
HeapBufMP_Handle  heapHandle;
HeapBufMP_Params  heapBufParams;
MyMsg *my_msg;

 syncSemHandle = SyncSem_create(NULL, NULL);
    MessageQ_Params_init(&messageQParams);
    messageQParams.synchronizer = SyncSem_Handle_upCast(syncSemHandle);
    HeapBufMP_Params_init(&heapBufParams);
    heapBufParams.regionId       = 0;
    heapBufParams.name           = HEAP_NAME;
    heapBufParams.numBlocks      = 1;
    heapBufParams.blockSize      = sizeof(MyMsg);
    heapHandle = HeapBufMP_create(&heapBufParams);
    if (heapHandle == NULL) {
        Vps_printf("HeapBufMP_create failed\n" );
    }
     /* Register this heap with MessageQ */
    MessageQ_registerHeap((IHeap_Handle)heapHandle, HEAPID);

    messageQ = MessageQ_create(MESSAGEQNAME, &messageQParams);

Creation of MessageQ was successfull and the same MessageQ ID is being generated/obtained during Open call.


Chages in my own module which is been compiled for IPU1-0 core.

        MessageQ_Msg  msgQ = NULL;
        Vps_printf("Opening the Heap memory \n");
        do {
                status = HeapBufMP_open(HEAP_NAME, &heapHandle);
                        if (status < 0) {
                       Task_sleep(1);
                    }
        } while (status < 0);
        Vps_printf(" Registering the Heap with HeapID \n ");
        MessageQ_registerHeap((IHeap_Handle)heapHandle, HEAPID);
        do {
             status = MessageQ_open(MESSAGEQNAME, &remoteQueueId);
                   Task_sleep(10);
                }while (status < 0);

        Vps_printf("MessagQ ID obtained through Init %d !!!!! \n",remoteQueueId);
        msgQ = MessageQ_alloc(HEAPID, sizeof(MessageQ_MsgHeader));
        if (msgQ == NULL) {
           Vps_printf("MessageQ_alloc failed\n" );
        }
    //Intializing the MyMsg Structure memebers
     ((MyMsg*)msgQ)->datasize = msg.datasize + msg.headersize-sizeof(StorageHeader);
     Vps_printf(" Mymsg data size is %d !!!!!!!!\n",((MyMsg*)msgQ)->datasize);
    
     It works fine till this part post to which I use MessageQ_Put to insert data to MessagQ which makes my application to hangs/crash.
    
     /*status = MessageQ_put(remoteQueueId,msgQ);
        if (status < 0)
        {
               Vps_printf("MessageQ_put was not successful with ID being %d!!!!!n", status);
        }*/


.cfg file changes
source/vision/platform/ti/tda2/links_fw/src/rtos/bios_app_common/tda2px/ipu1_0/Ipu1_0.cfg and
source/vision/platform/ti/tda2/links_fw/src/rtos/bios_app_common/tda2px/a15_0/a15_0.cfg

var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
var HeapBufMP   = xdc.useModule('ti.sdo.ipc.heaps.HeapBufMP');
// Maximum length of MessageQ names
MessageQ.maxNameLen = 32;

Can you guys let me know what would be problem and what makes application to hang or unrecovery state.
Please let me know if any further information is needed.


  • Does the core go into a hang state such that you cannot connect to CCS or do you get an exception or abort?

    Thanks and Regards,
    Piyali
  • I believe the core went in to hang state, but I haven't tried out with CCS, I didn't get exception but the only to come out is to do hard reset(Restart)
  • Can you please connect via CCS and run the code? If there is an exception due to a bad access, you would see some logs on the CCS console output which would give more clues for the issue.

    Thanks and Regards,
    Piyali
  • I think it may take time for me, as I don't have the setup handy right now, and I would like to mention that inserting the data to MessageQ in the Networkctrl module were the MessageQ creation was happened was successful. Inserting the data from other core was not successful.

    I was suspecting issue with my TransPortProxy setting for MessageQ in .cfg file. But having these TransportMsg configuration in .cfg file results in linker issues.

    a_15.cfg and IPU1_0.cfg file

    var VirtioSetup = xdc.useModule('ti.ipc.transports.TransportRpmsgSetup');
    var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
    MessageQ.SetupTransportProxy = VirtioSetup;

    These are the errors reported..
    ------------------------
    /opt/vision_sdk/FFC/FFC_WORKSPACE/sdk/ti/PROCESSOR_SDK_VISION_03_03_00_00/ti_components/os_tools/ipc_3_45_00_00/packages/ti/ipc/rpmsg/RPMessage.c:112:2: error: #error unknown processor!
    #error unknown processor!
    ^
    /opt/vision_sdk/FFC/FFC_WORKSPACE/sdk/ti/PROCESSOR_SDK_VISION_03_03_00_00/ti_components/os_tools/ipc_3_45_00_00/packages/ti/ipc/rpmsg/RPMessage.c:166:5: error: unknown type name 'VirtQueue_Handle'
    VirtQueue_Handle virtQueue_toHost;
    ^
    /opt/vision_sdk/FFC/FFC_WORKSPACE/sdk/ti/PROCESSOR_SDK_VISION_03_03_00_00/ti_components/os_tools/ipc_3_45_00_00/packages/ti/ipc/rpmsg/RPMessage.c:167:5: error: unknown type name 'VirtQueue_Handle'
    VirtQueue_Handle virtQueue_fromHost;
    ^
  • This may be because the macro VAYU is not defined as per the makefiles. Can you please try adding this to the makefile defines -DVAYU and then give the build a try.

    Did you get a chance to connect to the core via CCS to see which core is crashing and what is the status of the crash?

    THanks and Regards,
    Piyali