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.