Hi,
I'm working with microcontroller TM4C129ENCPDT and my problem is that the interface ethernet after some hours stop responding all commands TCP/IP (including command PING).
I'm using the library "lwip". For initialize this interface (following the examples supplied by Texas), I do:
********************************************************************************************
FlashUserGet(&ui32User0, &ui32User1);
if((ui32User0 != 0xffffffff) && (ui32User1 != 0xffffffff))
{
// Convert the 24/24 split MAC address from NV ram into a 32/16 split MAC
// address needed to program the hardware registers, then program the MAC
// address into the Ethernet Controller registers.
//
pui8MACAddr[0] = ((ui32User0 >> 0) & 0xff);
pui8MACAddr[1] = ((ui32User0 >> 8) & 0xff);
pui8MACAddr[2] = ((ui32User0 >> 16) & 0xff);
pui8MACAddr[3] = ((ui32User1 >> 0) & 0xff);
pui8MACAddr[4] = ((ui32User1 >> 8) & 0xff);
pui8MACAddr[5] = ((ui32User1 >> 16) & 0xff);
lwIPInit(SysClock, pui8MACAddr, 0, 0, 0, IPADDR_USE_AUTOIP);
ROM_IntPrioritySet(INT_EMAC0, ETHERNET_INT_PRIORITY);
ROM_IntPrioritySet(FAULT_SYSTICK, SYSTICK_INT_PRIORITY);
}
***********************************************************************************
After this the microcontroler works well, responding all the commands PING, creating sockets, accepts conexions and recive/send message, etc... But in some hours apparently falls this interface. Externally I can't do even a "PING". Debugging the code appear that all is normal (including calls to subroutines lwIPInterruptTask or lwIPEthernetIntHandler).Seems as if the PHY to stop working....
The config file "lwipopts" that I'm using is:
************************************************************************************
#ifndef __LWIPOPTS_H__
#define __LWIPOPTS_H__
//*****************************************************************************
//
// ---------- Platform specific locking ----------
//
//*****************************************************************************
#define NO_SYS 0
#define SYS_LIGHTWEIGHT_PROT 1
//*****************************************************************************
//
// ---------- Stellaris / lwIP Port Options ----------
//
//*****************************************************************************
#define HOST_TMR_INTERVAL 100
#define DHCP_EXPIRE_TIMER_MSECS (60 * 1000)
#define LWIP_HTTPD_SSI 1
#define LWIP_HTTPD_CGI 1
#define LWIP_HTTPD_DYNAMIC_HEADERS 1
#define EMAC_PHY_CONFIG (EMAC_PHY_TYPE_INTERNAL | EMAC_PHY_INT_MDIX_EN | \
EMAC_PHY_AN_100B_T_FULL_DUPLEX)
#define PHY_PHYS_ADDR 0
#define NUM_TX_DESCRIPTORS 24
#define NUM_RX_DESCRIPTORS 8
//*****************************************************************************
//
// ---------- Memory options ----------
//
//*****************************************************************************
#define MEM_ALIGNMENT 4
#define MEM_SIZE 1600
//*****************************************************************************
//
// ---------- Internal Memory Pool Sizes ----------
//
//*****************************************************************************
#define MEMP_NUM_PBUF 16
#define MEMP_NUM_TCP_PCB 5
#define MEMP_NUM_SYS_TIMEOUT 8
#define PBUF_POOL_SIZE 32
//*****************************************************************************
//
// ---------- IP options ----------
//
//*****************************************************************************
#define IP_REASSEMBLY 0
#define IP_FRAG 0
//*****************************************************************************
//
// ---------- RAW options ----------
//
//*****************************************************************************
#define LWIP_RAW 1
#define RAW_TTL (IP_DEFAULT_TTL)
//*****************************************************************************
//
// ---------- DHCP options ----------
//
//*****************************************************************************
#define LWIP_DHCP 1
//*****************************************************************************
//
// ---------- AUTOIP options ----------
//
//*****************************************************************************
#define LWIP_AUTOIP 1
#define LWIP_DHCP_AUTOIP_COOP ((LWIP_DHCP) && (LWIP_AUTOIP))
#define LWIP_DHCP_AUTOIP_COOP_TRIES 5
//*****************************************************************************
//
// ---------- TCP options ----------
//
//*****************************************************************************
#define LWIP_TCP 1
#define TCP_TTL (IP_DEFAULT_TTL)
#define TCP_WND 4096
#define TCP_MAXRTX 12
#define TCP_SYNMAXRTX 6
#define TCP_QUEUE_OOSEQ 1
#define TCP_MSS 1500
#define TCP_CALCULATE_EFF_SEND_MSS 1
#define TCP_SND_BUF (4 * TCP_MSS)
#define TCP_SND_QUEUELEN (4 * (TCP_SND_BUF/TCP_MSS))
#define TCP_SNDLOWAT (TCP_SND_BUF/2)
#define TCP_LISTEN_BACKLOG 0
#define TCP_DEFAULT_LISTEN_BACKLOG 0xff
//*****************************************************************************
//
// ---------- API options ----------
//
//*****************************************************************************
#define LWIP_EVENT_API 0
#define LWIP_CALLBACK_API 1
//*****************************************************************************
//
// ---------- Pbuf options ----------
//
//*****************************************************************************
#define PBUF_LINK_HLEN 16
#define PBUF_POOL_BUFSIZE 512
// default is LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN)
#define ETH_PAD_SIZE 0
//*****************************************************************************
//
// ---------- Network Interfaces options ----------
//
//*****************************************************************************
#define LWIP_NETIF_HOSTNAME 0
#define LWIP_NETIF_API 1
#define LWIP_NETIF_STATUS_CALLBACK 1
#define LWIP_NETIF_LINK_CALLBACK 1
#define LWIP_NETIF_HWADDRHINT 0
//*****************************************************************************
//
// ---------- LOOPIF options ----------
//
//*****************************************************************************
#define LWIP_HAVE_LOOPIF 0
#define LWIP_LOOPIF_MULTITHREADING 1
//*****************************************************************************
//
// ---------- Thread options ----------
//
//*****************************************************************************
#define TCPIP_THREAD_NAME "tcpip_thread"
#define TCPIP_THREAD_STACKSIZE 1024
#define TCPIP_THREAD_PRIO 1
#define TCPIP_MBOX_SIZE 100
#define SLIPIF_THREAD_NAME "slipif_loop"
#define SLIPIF_THREAD_STACKSIZE 1024
#define SLIPIF_THREAD_PRIO 1
#define PPP_THREAD_NAME "pppMain"
#define PPP_THREAD_STACKSIZE 1024
#define PPP_THREAD_PRIO 1
#define DEFAULT_THREAD_NAME "lwIP"
#define DEFAULT_THREAD_STACKSIZE 1024
#define DEFAULT_THREAD_PRIO 1
#define DEFAULT_RAW_RECVMBOX_SIZE 100
#define DEFAULT_UDP_RECVMBOX_SIZE 100
#define DEFAULT_TCP_RECVMBOX_SIZE 100
#define DEFAULT_ACCEPTMBOX_SIZE 100
//*****************************************************************************
//
// ---------- Sequential layer options ----------
//
//*****************************************************************************
#define LWIP_NETCONN 1
//*****************************************************************************
//
// ---------- Socket Options ----------
//
//*****************************************************************************
#define LWIP_SOCKET 1
#define LWIP_COMPAT_SOCKETS 0
#define LWIP_POSIX_SOCKETS_IO_NAMES 0
#define LWIP_TCP_KEEPALIVE 1
#define LWIP_SO_RCVTIMEO 1
#define LWIP_SO_RCVBUF 1
#define RECV_BUFSIZE_DEFAULT 100
#define SO_REUSE 1
#endif /* __LWIPOPTS_H__ */
*******************************************************************************
Do you have any idea why this interface goes down?
Thanks you.