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.

Implementing non-blocking SRIO DIO socket with multi-thread

I use C6670 TI DSP.(TMS320C6670). CCS version 5.5.0.00077 and SYSBIOS version 6.37.2.27

I want to program to output  periodic data via SRIO.

I designed two task.

        -One 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 SRIO is output to external device)

But the dummy task does not print any character.

What is wrong?

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);
    }

}

#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);
   }

}

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;
}

===============================