Tool/software: TI-RTOS
Hi,
We are testing IPC.MessageQ between arm_linux and dsp_BIOS on EVMK2H module.Test environment and test codes, modified from the ti-provided image_processing demo, are shown partially as followings. This is a simple test: dsp0 repeatedly sends messages each with 400 bytes of identical-value payload and arm repeatedly receives them.
Test environment:
() Target: EVMK2H Rev40
arm:linux+ipc.MessageQ
dsp:BIOS+ipc.MessageQ
() Emulator: onBoard Emulator XDS2xx
() Host: Windows XP sp3
CCS5.5
mcsdk_3_00_03_15
ipc_3_00_04_29
dsp code episode
---------------------------
#define DATA_LEN 400
typedef struct
{
MessageQ_MsgHeader header;
int core_id;
char data[DATA_LEN];
} SMsgTest;
SMsgTest* pMsgTest;
for(j=0; ;j++)
{
pMsgTest = (SMsgTest*) MessageQ_alloc(0, sizeof(SMsgTest));//HeapId configed in cfg file.
if (!pMsgTest)
return;
x++;
for(i=0;i<DATA_LEN;i++)
pMsgTest->data[i]=x;
if (MessageQ_put(vQueueId, (MessageQ_Msg)pMsgTest) < 0)
printf("MessageQ_put had a failure error\n");
Task_sleep(1);//Task_sleep(1): about 1 millisecond.
}
arm code episode
---------------------------
for(j=0;;j++)
{
if (MessageQ_get(vMsgQHandle, (MessageQ_Msg *)&pMsgTest, MessageQ_FOREVER) < 0)
return 0;
for(i=1;i<DATA_LEN;i++)
if(pMsgTest->data[0]!=pMsgTest->data[i])
{
printf("%d:data[%d]=%x\n",j,i,pMsgTest->data[i]);
break;
}
MessageQ_free((MessageQ_Msg)pMsgTest);
}
Problem:
Everything works well except some of the first hundreds of messages received by arm are not correct, this is to say, not as same as the values sent by dsp. An incorrect message, in which every value should be 20 instead of including some 0s, is shown as following:
20,20,20,20,20,20,20,20,20,20,20,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,20,20,20,20,20,20,20,
20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,
20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,
20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,
20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,
20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,
20,20,20,20,20,20,20,20,20,20,20,20
Here is a bizarre problem and it has eaten a lot of time. Could you please help me to find out what's wrong with my test?
Thanks a lot in advance.