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.

image processing OpenMP

Hi

I ran the "image_processing_omp" on EVMC6678, Now I want modify the project. I want that DSP recieve data from LAN port under TCP protocol(DSP works as client).

what should I do? please,guide me.

regards

  • Hi dariush karami,

    You may need to add ethernet stuff on OMP code, you can refer to the following NDK example where TCP/UDP protocol is implemented.

    C:\ti\mcsdk_2_01_02_06\examples\ndk\helloWorld\evmc6678l

    --------------------

  • hi

    "C:\ti\mcsdk_2_01_02_06\examples\ndk\helloWorld\evmc6678l" project is UDP. I want to have TCP connection and DSP works as client, it means that DSP starts the connection.

    I tested "C:\Program Files\Texas Instruments\mcsdk_2_01_02_05\examples\ndk\client\evmc6678l" project. That project was TCP but worked in sever mode only!!

    what should I do?

    regards

  • Hi,

    The following modification will do the loop back of TCP data.

    Change the following line in client.c file.
    From
    hEcho = DaemonNew( SOCK_STREAMNC, 0, 7, dtask_tcp_echo,
    OS_TASKPRINORM, OS_TASKSTKNORM, 0, 3 );
    To
    hEcho = DaemonNew( SOCK_STREAMNC, 0, 7, dtask_tcp_test,
    OS_TASKPRINORM, OS_TASKSTKNORM, 0, 3 );

    Add the following function in client.c file.

    int dtask_tcp_test( SOCKET s, UINT32 unused )
    {
    struct sockaddr_in sin1;
    struct timeval to;
    int i,tmp;
    char *pBuf;
    HANDLE hBuffer;

    (void)unused;

    // Configure our socket timeout to be 3 seconds
    to.tv_sec = 3;
    to.tv_usec = 0;
    setsockopt( s, SOL_SOCKET, SO_SNDTIMEO, &to, sizeof( to ) );
    setsockopt( s, SOL_SOCKET, SO_RCVTIMEO, &to, sizeof( to ) );

    for(;;)
    {
    tmp = sizeof( sin1 );
    i = (int)recvncfrom( s, (void **)&pBuf, 0, (PSA)&sin1, &tmp, &hBuffer );

    // Spit any data back out
    if( i >= 0 )
    {
    sendto( s, pBuf, i, 0, (PSA)&sin1, sizeof(sin1) );
    recvncfree( hBuffer );
    }
    else
    break;
    }

    // Since the socket is still open, return "1"
    // (we need to leave TCP sockets open)
    return(1);
    }

    Please refer to the following TI E2E post.
    e2e.ti.com/.../1602980
    This is for UDP but you can do the same for TCP (just it has different port and type of connection)
  • Hi Titusrathinaraj

    Thanks for your attention, as I mentioned I want DSP starts the TCP connection first, Not other devices start the connection and DSP loop back.

    Today I added a "platform_write" at function "dtask_tcp_echo" in "client.c" file, When I ran the project the function "platform_write" didn't work and nothing printed in console but when I sended data from my PC to DSP the function "platform_write" worked and I saw my sentence in the console! It means the function "dtask_tcp_echo" didn't run!! What did happen?

    Best regards