Jump to content
43oh

ucohen

Members
  • Content Count

    9
  • Joined

  • Last visited

Posts posted by ucohen

  1. I looked at the code but can not spot anything obvious that would cause this issue. Would it be possible for you to reduce the code to a minimal possible while still showing the issue? That will help me a lot to narrow it down and reproduce it here.

    A thin code is attached.

    There is no command requirement to start.

    I saw that almost the 2nd and 3rd problems are still here.

    The 1st problem is rare, so it possible that it is still here.EthernetProblems.zip

  2. Hello,

    I use EK-TM4C1294XL, and I want to make a stable TCP connection between the microcontroller and a computer.

    I use Energia's example "TelnetClient" to do it, when the microcontroller is the client and the computer is the server using Telnet.

    I succeed to make the connection, but there are a lot of problems with it.

     

    1. Sometimes (I can't diagnose when it happens) the controller enter to infinite loop at tcp_out.c line 937:

    1
    for (; useg->next != NULL; useg = useg->next);

    When it happens, useg == useg->next.

    I try to solve it by change the row to:

    1
    for (; (useg->next != NULL)|(useg->next == useg); useg = useg->next);

    It seems that the problem solved, but I don't know how it affect on other functions.

     

    2. Sometimes, when i close the computer's listener, the function client.connect don't recognize that there is no connection. So, when the listener reurn, the microcontroller don't retry to connect.

     

    3. Sometimes, the software enter to infinite loop at EthernetClient.cpp at line 216 (in EthernetClient::write(const uint8_t *buf, size_t size)).

    i=0, size = 1, and its values don't change in the loop:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    // Attempt to write in 1024-byte increments.
        while (i < size) {
            inc = (size - i) < 1024 ? size - i : 1024;
            err_t err = tcp_write(cpcb, buf + i, inc, TCP_WRITE_FLAG_COPY);
            if (err != ERR_MEM) {
                // Keep enqueueing the lwIP buffer until it's full...
                i += inc;
                stuffed_buffer = false;
            } else {
                if (!stuffed_buffer) {
                    // Buffer full; force output
                    if (cs->mode)
                        tcp_output(cpcb);
                    stuffed_buffer = true;
                } else {
                    delay(1); // else wait a little bit for lwIP to flush its buffers
                }
            }
        }

     

  3. I try to make a TCP connection between EK-TM4C1294XL and Labview.


    The microcontroller is the client, and in Labview  there is a server.


    I use Energia's standard functions (like client.connect())., and success to make connection with Hercules.


    I also success to make connection between Hercules and Labview.


    But I don't success to make the final connection - microcontroller to Labview.


    there is a difference between the Energia's functions and the standard?


×
×
  • Create New...