CCS : 8.3.1
NO_SYS ( Not using RTOS)
We have developed a custom board with TM4C1294NCPDT with Ethernet and have implemented a TCP server using LWIP 1.4.1 by modifying an echo server example.
The Ethernet interrupt is not used and all Ethernet operations are done by calling lwIPEthernetIntHandler(); in the main loop of the program.
The connection to client PC is going through a switch.
The firmware responds to Modbus requests from the client PC.There are more than one such board connected to the switch. The client is a Windows 10 PC running a ModbusPol program.
The speed is forced to 10Mbs in the lwipopt.c .
It works OK for many hours but after a while does not respond to the client . Even ping fails. The only way to come out of this situation is to reset the Microcontroller.
The working scenario is as follows:
The PC running the Modbuspol is connected to the board to check the operation and then disconnected (by pulling out the cable while still running).
After a few hours the cable is connected back and the ModbusPol run again. Most of the time it works OK . But once in a while the Microcontroller does not respond even for ping from PC.
The firmware on the TM4C1294NCPDT continues to run to do the rest of the jobs(like writing to SD card , reading inputs etc).
We have tried a work around as below:
1. Check if the Cable is inserted.
2. If connected, check if there is any data being sent out in the echo_send function.
3. If there is no data being sent in the echo_send function for 30 seconds, do a software reset using SysCtlReset();
This works OK but it is not desirable solution as it disturbs the other features of the program.
I have the following questions:
1. Is it OK to pull out the cable while the program is running?
2. Can we have a work around to restart the server without SysCtlReset() ?
Like calling netif_set_down and netif_set_up functions to recover from the situation?
3. Can we call LwIPInit(... ) function more than once in the same program?
Can some one suggest how to go about debugging the program.
I am new to wireshark but am trying to figure out what is going on the PC side.
Thank you for any help.