Hi
We have a system built around NUCLEO_F767ZI. When ethernet cable is unplugged, if we repeatedly reboot system and then run the following ethernet initialization code:
eth.set_blocking(true);
//int ret = eth.disconnect();
nrTimer.reset();
if(ethernetSettings.enabled == 0) {
char ipStr[17] = {0}, nmStr[17] = {0}, ngStr[17] = {0};
sprintf(ipStr, "%d.%d.%d.%d", ethernetSettings.ip[0], ethernetSettings.ip[1], ethernetSettings.ip[2], ethernetSettings.ip[3]);
sprintf(nmStr, "%d.%d.%d.%d", ethernetSettings.mask[0], ethernetSettings.mask[1], ethernetSettings.mask[2], ethernetSettings.mask[3]);
sprintf(ngStr, "%d.%d.%d.%d", ethernetSettings.gateway[0], ethernetSettings.gateway[1], ethernetSettings.gateway[2], ethernetSettings.gateway[3]);
eth.set_dhcp(false);
eth.set_network(ipStr, nmStr, ngStr);
}
int ret = eth.connect();
The interval between each reboot starts at 3 minutes then doubles every time system reboots, 6, 12, 24, 48, 96 minutes then stays at 96 minutes. After a few hours, two of our test units in a row can no longer connect to our ethernet router when ethernet cable is plugged back in. Even after a power cycle.
In theory the damage can be caused by ESD when ethernet cable is plugged back in. But this never happened when we briefly unplug and plug the cable back in. So I tend to think there might be something in the code that caused the damage.
Mbed OS version is 5.15.
Can anyone offer some pointers?