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: lwIP TCP keep-alive (in non-TI RTOS environment)

Part Number: TMS320F28388D

Dear support team,

I am currently experiencing with the F28388D device using the enet_lwip demo application.

I am about to write my own application for the CM which shall handle the TCP/IP communication.
Due to restricted access to variables, I allow only 1 connection at a time.
(I implemented this connection restriction by my own because it looks like it's not possible to limit the maximum number of connections per listening port by the TI implementation.)

I would like to add TCP keep-alives to detect broken connections.
(without this mechanism, the TI will not be reachable anymore after e.g. a network cable disconnection, client crashes without closing TCP connection etc.)

I have set:

#define LWIP_TCP_KEEPALIVE              1

and have added this code in the connect/accept callback:

    pcb->so_options |= SOF_KEEPALIVE;
    pcb->keep_intvl = 5000;

IMHO I'd expect keep-alive packets every 5 seconds but nothing happens during an idle connection.

Is the keep-alive feature supported in your lwIP implementation?
Did I miss anything?

Thank you,
Markus

  • Hi,

    I would like to add TCP keep-alives to detect broken connections.
    (without this mechanism, the TI will not be reachable anymore after e.g. a network cable disconnection, client crashes without closing TCP connection etc.)

    When the network connections gets broken, can you check the lwip.stats values in the expression window or the state of the F28388 device like if it is calling generic ISR or if the code gets stuck in fault ISR.

    We can understand why the connection is lost.

    We have not used TCP keep-alive feature of lwIP for F28388.

    Regards,

    Yashwant

  • Hi,

    thank you for the information.

    I currently use a workaround for this issue.
    In the accept callback, I've added a mechanism which detects, if a previous connection is active.
    If this is the case, the previous connection is terminated by the 'abort' function (which sends a TCP RST to the client) and the new connection is accepted.

    Not a clean solution (can be exploited for DoS kind attacks) but the device is used in P2P or at least a 'safe' network and it ensures the device is always reachable, even if a previous connection was not properly closed.

    The lwIP demo/implementaion is nice but IMHO it's a pity that it lacks some basic network functions like DHCP.
    Would you suggest to use the TI RTOS instead?

    Thanks,
    Markus