[quote userid="96523" url="~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1424402/tm4c1294ncpdt-ethernet-tcp-communication-lost-and-device-hang/5474397#5474397"] is there any way or registers by reading that we can identify that there is some issue with PHY / EMAC so Reset controller. [/quote][quote userid="96523" url="~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1424402/tm4c1294ncpdt-ethernet-tcp-communication-lost-and-device-hang/5474919#5474919"] I was checking different registers , found Remote Fault Bit in EPHYBMSR register and read that bit before Ethernet Initialization and after communication established , getting same value 0x00000040, indicates that , this bit is high ( Verified by disconnecting ethernet cable and Mod Poll connection) one more register EPHYCONFIG1 having TDR and LLR bit. Can DMA or EMAC registers be useful to detect reception or transmission error , can you please suggest exact registers. [/quote] Please note any EMAC status registers or bits that indicate any error can only tell you what is wrong at the EMAC hardware level. If the crashing/hanging is due to software then these EMAC status registers will not help. Your crashing/hanging could be related to the lwIP configuration or your Modbus stack. I don't really have a good hint on how to debug your problem as you mentioned you could not replicate the issue in your lab environment. On the field, how long does the MCU have to run until the problem occurs? Minutes, hours or days? Does the problem only occur from one particular end customer or multiple customers? Since you said you cannot replicate the issue on your lab environment, my below suggestion will not help. But if you can replicate the issue then you can enable lwIP debug options that will provide diagnosis information. This is useful if the issue is at the lwIP level. I don't know about your Modbus stack. Check with your Modbus stack vendor if there is such option for diagnosis. At the device level, you might also want to check your stack and heap size. Is it possible that you don't have enough stack or heap allocated that caused the device to crash/hang. Try increasing them and see if they make a difference. I really don't have other tips to offer since your problem only happens randomly and cannot be replicated on your lab environment. I want to also give you a heads-up. I will be OOO for a week. My response will be very much delayed. //***************************************************************************** // // ---------- Debugging options ---------- // //***************************************************************************** #if 0 // CHANGE THIS TO 1 to ENABLE DEBUG OPTIONS #define U8_F "c" #define S8_F "c" #define X8_F "x" #define U16_F "u" #define S16_F "d" #define X16_F "x" #define U32_F "u" #define S32_F "d" #define X32_F "x" extern void UARTprintf ( const char * pcString , ...); #define LWIP_DEBUG #endif //#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_OFF #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_OFF //#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_WARNING //#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_SERIOUS //#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_SEVERE //#define LWIP_DBG_TYPES_ON LWIP_DBG_ON #define LWIP_DBG_TYPES_ON (LWIP_DBG_ON | LWIP_DBG_TRACE | \ LWIP_DBG_STATE | LWIP_DBG_FRESH) //#define ETHARP_DEBUG LWIP_DBG_ON // default is OFF //#define NETIF_DEBUG LWIP_DBG_ON // default is OFF //#define PBUF_DEBUG LWIP_DBG_OFF //#define API_LIB_DEBUG LWIP_DBG_OFF //#define API_MSG_DEBUG LWIP_DBG_OFF //#define SOCKETS_DEBUG LWIP_DBG_OFF //#define ICMP_DEBUG LWIP_DBG_OFF //#define IGMP_DEBUG LWIP_DBG_OFF //#define INET_DEBUG LWIP_DBG_OFF //#define IP_DEBUG LWIP_DBG_ON // default is OFF //#define IP_REASS_DEBUG LWIP_DBG_OFF //#define RAW_DEBUG LWIP_DBG_OFF //#define MEM_DEBUG LWIP_DBG_OFF //#define MEMP_DEBUG LWIP_DBG_OFF //#define SYS_DEBUG LWIP_DBG_OFF //#define TCP_DEBUG LWIP_DBG_OFF //#define TCP_INPUT_DEBUG LWIP_DBG_OFF //#define TCP_FR_DEBUG LWIP_DBG_OFF //#define TCP_RTO_DEBUG LWIP_DBG_OFF //#define TCP_CWND_DEBUG LWIP_DBG_OFF //#define TCP_WND_DEBUG LWIP_DBG_OFF //#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF //#define TCP_RST_DEBUG LWIP_DBG_OFF //#define TCP_QLEN_DEBUG LWIP_DBG_OFF //#define UDP_DEBUG LWIP_DBG_ON // default is OFF //#define TCPIP_DEBUG LWIP_DBG_OFF //#define PPP_DEBUG LWIP_DBG_OFF //#define SLIP_DEBUG LWIP_DBG_OFF //#define DHCP_DEBUG LWIP_DBG_ON // default is OFF //#define AUTOIP_DEBUG LWIP_DBG_OFF //#define SNMP_MSG_DEBUG LWIP_DBG_OFF //#define SNMP_MIB_DEBUG LWIP_DBG_OFF //#define DNS_DEBUG LWIP_DBG_OFF
↧