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.
I use C6670 TI DSP.(TMS320C6670). CCS version 5.5.0.00077 and SYSBIOS version 6.37.2.27
I programmed to send periodic data to external device via SRIO.(I used SRIO DIO socket.)
I designed two task.
-One(Major task) sends data (via SRIO) periodically.(test main task): send 8KB data every 100ms
-The other just print at idle time. (test dummy task): print some character during main task is sending data
The source code for the two task is shown below.
When I execute this code, main task seems to be worked.(periodic data is transmitted to external device)
But the dummy task does not print any character.
I expected
- When main task calls srio socket API(to send data) and waits SRIO Tx done interrupt,
- Dummy task is executed and print some character until SRIO Tx done.
What is wrong? What do I mistake for using SRIO DIO socket?
I use DIO socket(blockingsocket option of Srio_sockOpen() is "FALSE").
Please let me know, if you need more information.
===============================
U8 gTestChar='0';
S32 gTestCnt=0;
VOID Test_DummyTASK_Fxn(UArg a0, UArg a1)
{
while(1){
if(gTestChar!='0')
{
System_printf("%c", gTestChar+gTestCnt);
gTestCnt++;
}
else
Task_sleep(1);//sleep 10ms
}
}
#define TEST_BUFF_SIZE 8192
U8 gTestBuff[TEST_BUFF_SIZE];
VOID Test_MainTASK_Fxn(UArg a0, UArg a1)
{
S32 i, data_len;
data_len = TEST_BUFF_SIZE;
for(i=0; i<TEST_BUFF_SIZE; i++)
gTestBuff[i] = i;
while(1){
if(gTestChar=='A')
gTestChar = 'a';
else
gTestChar = 'A';
gTestCnt = 0;
SRIO_Write((U8 *)gTestBuff, 0x40000000, data_len);
gTestChar = '0';
System_printf("<Tx done>\r\n");
Task_sleep(10);//sleep 100ms
}
}
VOID Task_Start()
{
Task_Params taskParams;
Task_Handle task_a, task_b;
Task_Params_init(&taskParams);
taskParams.instance->name = "TestDummy";
taskParams.priority = 6;
taskParams.stackSize = 1024;
task_b = Task_create(Test_DummyTASK_Fxn, &taskParams, NULL);
System_printf ("[] %s task created pri:%d\n", taskParams.instance->name, taskParams.priority);
Task_Params_init(&taskParams);
taskParams.instance->name = "TestMain";
taskParams.priority = 9;
taskParams.stackSize = 1024;
task_b = Task_create(Test_MainTASK_Fxn, &taskParams, NULL);
System_printf ("[] %s task created pri:%d\n", taskParams.instance->name, taskParams.priority);
}
Srio_SockAddrInfo gSRIO_Addrinfo_Write;
S32 SRIO_Write(U8 *pBuff, U32 remote_addr, S32 data_len)
{
S32 result;
Srio_DrvBuffer srio_buf;
gSRIO_Addrinfo_Write.dio.rapidIOMSB = 0x00;
gSRIO_Addrinfo_Write.dio.dstID = DEVICE_ID_FPGA_8BIT;
gSRIO_Addrinfo_Write.dio.ttype = Srio_Ttype_Write_NWRITE;
gSRIO_Addrinfo_Write.dio.ftype = Srio_Ftype_WRITE;
gSRIO_Addrinfo_Write.dio.rapidIOLSB = (U32)remote_addr;
/* Writeback the contents of the cache. */
CACHE_wbL1d (pBuff, data_len, CACHE_FENCE_WAIT);
/* Initiate the transfer. */
srio_buf = (Srio_DrvBuffer)l2_global_address((U32)pBuff);
result = Srio_sockSend (SRIO_Socket_Data, srio_buf, data_len, &gSRIO_Addrinfo_Write);
if(result < 0)
{
System_printf ("Error: Unable to send payload over DIO socket\n");
return -1;
}
return data_len;
}
===============================
Hi,
Have you configured the DIO transfer Completion interrupt on your test code? I did not find interrupt related function on your above post. Better to use Srio_sockSend_DIO() for DIO type SRIO transfer.
Interrupt based SRIO DIO example code is available in MCSDK package, please refer this example and configure the tx completion interrupt to your test code.
MCSDK Path: \ti\pdk_C6670_1_1_2_6\packages\ti\drv\exampleProjects\SRIO_LoopbackDioIsrexampleproject
Thanks,