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.

Ethernet communication between 2 TIVA boards

Other Parts Discussed in Thread: EK-TM4C1294XL

Hello,


I am trying to communicate 2 TIVA Boards EK-TM4C1294XL & DK-TM4C129X via ethernet but failing to do so.

When I run program of serial to ethernet conversion Individually Both of them works fine, But When I configure one board as server and another as client they do communicate with each other.

Can anyone help me on this topic or suggest any code or Document to look for.

Regards
Akshay Joshi

  • akshay joshi said:
    When I configure one board as server and another as client they do communicate with each other.

    Your first two sentences are in conflict.

    Might it make sense to attempt Ethernet communication between each of your boards (individually) and a "known good" Ethernet equipped device (such as your PC?)

    One suspects that code examples exist to assist that more normal/customary connection...    The knowledge & settings gleaned from that effort should enhance your attempt to achieve "TM4C to TM4C" connection...

  • Hello cb1,

    Sorry. That was my typographic mistake, They are not communicating to each other.

    I need some tutorial of how to configure any TIVA board as Server or Client. Can you please suggest me that.

    Regards

    Akshay

  • Hello Akshay,

    You may have to check the lwIP site. They have examples for both server and client implementations. Note that to communicate between two boards you do not need a server client model. 2 Clients may speak with each other if they know each others MAC and/or IP address. This is handled by the DHCP server and ARP protocol.

    Regards
    Amit
  • Hi akshay,

    Few other things for ideas. The Ethernet cable has to be crossover type, not a standard cable PC to switch. One way to get around that is a hub with 2 straight through cables and assign static IP's to each client.

    Client: A=192.168.10.1, B=192.168.10.2, both mask 255.255.255.0 both gateway 0.0.0.0 .

    Like Amit suggests you also need a LWIP TCP stack on each TM4C to get them talking.
  • Hi BP101, I'm trying to implement the PTP 1588 protocol using two TM4C1294 Boards.  I'm running the LWip example code on both the boards, the boards are connected via a crossover ethernet cable,  both the boards connected to the laptop using usb cables.

    I have the following queries:

    1)How do I confirm that timestamped message packets are being sent from the master to the slave?

    2)Also How do i differentiate as to which is the master among the two?

    3)And finally how do I view the latency of the algorithm?

    Thanks.

  • Vandan good to hear some new update on your project.

    These do present a few challenges. Mostly the Ethernet is a closed wire session so no other peer can join in the fun unless.....

    Perhaps you launch a CCS debug session and review the EMAC registers of one board at a time based on the ICDI settings. Now if you were using OS2 you could launch two completely separate CCS debug sessions in their own virtual memory space but IBM dropped the ball on that OS2 project.

    You can try to give one client a higher TCP priority over the other in the Ethernet client accept connection call back listings.

    err_t
    UIEthernetAccept(void *arg, struct tcp_pcb *pcb, err_t err)
    {
    // Setup the TCP connection priority.
    tcp_setprio(pcb, TCP_PRIO_MAX);
    
    }

  • Hello BP101 & Amit,


    Thank you for your suggestions, both of the boards are communicating to each other, but after doing some exercise on the HTML page associated with the board. I want to communicate them without accessing the HTML page.

    For that I have tried to make IP address of both the boards static, making one as server and another as client. Also I have commented macro "LWIP_AUTOIP" in lwipopts.h file and defined IP address, gateway and subnet mask.

    but still not possible to give static IP address to the board.

    Would you please help me on this.

    Regards

    Akshay

  • Hello Akshay, I'm stuck in making the two boards communicate with each other. Could you please provide the code you have used on both boards or provide the steps you followed to achieve communication between the boards. 
    Thanks.


    Regards,

    Vandan

  • > Also I have commented macro "LWIP_AUTOIP" in lwipopts.h file and defined IP address, gateway and subnet mask.

    Perhaps may need to change macro to IPADDR_USE_STATIC and change the default static IP at top of each EthClient.c

  • Hello Vandan,

    You can download s2e_enet project from TI's website and program both of your boards according to that, This will help you.

    here is the link.

    www.ti.com/.../spma072

  • Hello Akshay,

    I have written a small code which uses UDP on arbitrary port for 2 boards to communicate with each other. The enet_lwip example has a locator function which shows how UDP can be used to create a port for communication between 2 boards without the need to have a server,

    Regards
    Amit
  • Hello BP101,

    I am able to make IP of server static, but when I tried making IP of client static, the communication between server and client fails. Also when I make server IP Static and client IP to detect automaically, they communicate successfully. I am not understanding what mistake I am doing in writing code at client side.

    Regards

    Akshay Joshi

  • Hi again,
    You could use a small Ethernet hub to test if the static IP was actually being assigned each board. Test each board one at a time, ping it from a PC also set static IP in network address same range 192.168.254.x or 10.1.x.x. The subnet mask can sometimes be an issue in class C 192 or B 10 network address ranges. Perhaps post what you are assigning each boards address, mask, gateway. Gateway address can also give similar trouble in cross over connections. Not sure what LWIP expects in any case but why not try 255.255.255.255 or 0.0.0.0 and see if that helps.
  • Hi,
    How did you make the conversion serial-ethernet? I would like to communicate my EK-TM4C1294XL with a computer to send and receive data, strings or bytes. Please, Could you help me?
  • Hi BP101,

    Thank you for your valuable suggestion, I will try this and get back to you with response.

    I am assigning Static IP and other settings as follows:

    For Server:

    • Static IP: 192.168.100.211
    • Subnet mask: 255.255.255.0
    • Gateway: 0.0.0.0
    • Local Telent port: 23

    For Client:

    • Static IP: 192.168.100.212
    • Subnet Mask: 255.255.255.0
    • Gateway: 0.0.0.0
    • Local Telent port: 23
    • server IP: 192.168.100.211
    • Server telent port: 23

    I have tried modifying

    AUTOIP_NET 192.168.0.0, 

    AUTOIP_RANGE_START:192.168.100.1 & 

    AUTOIP_RANGE_END:192.168.100.255 range in autoip.c, but the IP allocated automatically was: 192.168.103.129.

  • Hi,

    Here is the link for serial-ethernet example
    www.ti.com/.../spma072
  • Noticed this uses FreeRTOS and not familiar how LWIP threads are effected by upper application layer.

    Autoip_Net was assigning both boards the very same IP address even though it had 254 addresses to choose from. What are the odds of that occurring more than a few POR cycles? Autoip_Net should first do a ping to see if the IP responds prior to random address assignment.