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.

TCP/IP on TIVA XM4C129

Hi all,

I am using XM4C 129xENCPDTI (since TM4C is not available in the market) for serial to ethernet application.I have successfully developed code for serial to ethernet (one way communication) from TivaWare_C_Series-2.0.1.11577 libraries .

Now I facing following issues:

> While sending characters from ethernet side to serial i am only able to send one character at a time.I mean after sending a character , the communication disconnects and I have to connect every time after a character.

How to send a large chunck file containing multiple characters

characters 'h' 't' ''d' 'c' 'o'and 'p' are not working in the first try.

I am using hyperterminal for sending data from pc to controller.

 

  • Dhanush,

    If you want to send a block of data, you will need to first save all the serial data to a buffer and then pass theentire buffer to Ethernet. Based on the requirement of your application, you can decide when to pass the buffer.

    Thanks and regards, 

    Zhaohong

  • Zhaohong,

    Thank you for your suggestion.But I wish to  transfer file from ethernet to serial .Serial to ethernet part is already completed.

    I wish to transfer data in both directions.The problem I am facing is :

    > After complete transfer of data from serial to ethernet , I have to reset the connection in the  ethernet side to transfer data from ethernet to serial .

    > Only 18 bytes of data can be transferred at once.Which buffer size is causing this problem.

    PS: I am using Hyper Terminal for this example

    Regards,

    Dhanush

  •   From your writing...

    Dhanush Nair said:
    Serial to ethernet part is already completed.

     and this confuse more what is after:

    Dhanush Nair said:

    > After complete transfer of data from serial to ethernet , I have to reset the connection in the  ethernet side to transfer data from ethernet to serial .

    > Only 18 bytes of data can be transferred at once.Which buffer size is causing this problem.

    Hi please can you explain what this means? Why 18 char? Is your client/server side receiving buffer on TIVA so small? Did you checked for buffer overflow?

     Hyperterminal is a simple telnet, what happen if you use command line telnet IP?

      Ethernet side what this means, you need reset TIVA, reestablish connection from HYP or ..??? please be more clear about.

     

  •  Romano ,

    Let me explain to you in detail.

    Serial to eternet tranfers data bytes in both direction (half duplex). I have done one side (serial to ethernet part) completely.Since I am new to TCP/IP I am not able to interpret as to how to receive data via ethernet.Using sample code from stellaris , I have some how coded to receive data bytes from ethernet and transmit to serial end.I use hyper terminal at both ends to check data.

    When I transmit text file ( in Hyper terminal Transfer->Send Text File ) only first 18 bytes can be transmitted.

    Please help,

    Regards,

    Dhanush

     

     

  • Dhanush,

    It seems that you want to the follwoing.

    PC <-> Ethernet <-> TIVA <->UART <-> PC.

    I would suggest you to verify the Ethernet and and UART links separately as the first step. I consider them as independent communication links. For the Ethernet link, you can use the DK example enet_lwip as reference. For the UART link, you can use DK example uart_echo as reference. Then you can combine them together for your application. There is an issue with enet initialization. Please see the following post for solution.

    http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/p/331006/1161463.aspx#1161463

    Thansk and regards,

    Zhaohong

     

  • Hi Zhaohong ,

    You guessed it right.I am using the same.I am not understanding as of why I am receiving only 18 bytes at a time.When I send some text file with 80 bytes,I receive only 18 bytes.Which buffer size is causing this problem.

     I am using upnp.c from stellaris ware.

    Regards,

    Dhanush

  •  Hi Dhanush, I got an eye to example you got for startup... From that and telnet test I assume you wish use tcp and not UDP.

     That example is a complete and complex web server and I suppose you got some part of main protocol where data is first received after listening connection.

     This is a good start point but if you lack experience of tcp programming this can result in a wrong stack and socket management and connection lose data or close up.

     You need reestablish the waiting for packet reading buffer both way, so I propose you to try before all to do a working echo server, from that try a telnet version responding to some some char sent, then insert serial communication.

     Another good way is to use UIP instead, there is a complete telnetd working out of the box, this can help you understand how protocol work then patch for serializing of buffers and if lwip is better have the understanding of how to port communication.

     I remember my friend screwed up a simple http server on msp430, code for http was good, the telned suffered same trouble you report. Some time after I got again that software to do a telnet to build an I2C bus analyzer and I noticed tcp poll where removed from loop, so tcp never responded to icmp and connection dropped after few transmitted or received character.

     Both LWIP, UIP and the application was on MSP430 where developed By Adam Dunkels, LWIP appear more complete and supported with TCP and UDP and control ICM packet. Also UIP can support all but on forum i got idea LWIP is better.

     To get more help you need post the TCP segment you screwed up otherwise is very difficult to give you half a bit of help!