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.

TMS320F28388D: TMS320F28388D : TCP/IP EXAMPLE

Part Number: TMS320F28388D


Hello dear expert, I am new to Ethernet and TI components. I am looking for a TC/IP sample from TI. I found and ran the UDP sample but I can't find any TCP sample code or guide.

I found the enet_lwip example that works with the webserver application, I think this code uses TCP, how can I convert the TCP in this code into a code that only exchanges data over TCP by removing the Webserver part.
Could you please show me some to help me make a TCP example?
Can someone give me some guidance? Thanks a lot!!!

  • Hi,

    For TCP, you can refer the file tcp.c located at <C2000WareInstallDir>\libraries\communications\Ethernet\third_party\lwip\lwip-2.1.2\src\core\tcp.c . The file header of this file provides instructions for TCP implementation. 
    There is no such example (without webserver) provided 

    Best Regards

    Siddharth

  • Hi dear expert, Is there a document on how to use it step by step, so will I initiate tcp communication by myself using the tcp.c code? 

  • Hi,

    The file header provides the APIs and the order in which to be called.  You can refer to the UDP example and implement the tcp example accorrdingly.

    Have copied the file header here for easy reference.


    * TCP connection setup
    * --------------------
    * The functions used for setting up connections is similar to that of
    * the sequential API and of the BSD socket API. A new TCP connection
    * identifier (i.e., a protocol control block - PCB) is created with the
    * tcp_new() function. This PCB can then be either set to listen for new
    * incoming connections or be explicitly connected to another host.
    * - tcp_new()
    * - tcp_bind()
    * - tcp_listen() and tcp_listen_with_backlog()
    * - tcp_accept()
    * - tcp_connect()
    *
    * Sending TCP data
    * ----------------
    * TCP data is sent by enqueueing the data with a call to tcp_write() and
    * triggering to send by calling tcp_output(). When the data is successfully
    * transmitted to the remote host, the application will be notified with a
    * call to a specified callback function.
    * - tcp_write()
    * - tcp_output()
    * - tcp_sent()
    *
    * Receiving TCP data
    * ------------------
    * TCP data reception is callback based - an application specified
    * callback function is called when new data arrives. When the
    * application has taken the data, it has to call the tcp_recved()
    * function to indicate that TCP can advertise increase the receive
    * window.
    * - tcp_recv()
    * - tcp_recved()
    *
    * Application polling
    * -------------------
    * When a connection is idle (i.e., no data is either transmitted or
    * received), lwIP will repeatedly poll the application by calling a
    * specified callback function. This can be used either as a watchdog
    * timer for killing connections that have stayed idle for too long, or
    * as a method of waiting for memory to become available. For instance,
    * if a call to tcp_write() has failed because memory wasn't available,
    * the application may use the polling functionality to call tcp_write()
    * again when the connection has been idle for a while.
    * - tcp_poll()
    *
    * Closing and aborting connections
    * --------------------------------
    * - tcp_close()
    * - tcp_abort()
    * - tcp_err()
    *

    Best Regards

    Siddharth