Hi,
I may find a solution soon, yet as it’s taken half a day phew so thought to check out
If I assign the Zynq GEM controllers , i.e.
GEM0 = 199.168.0.200
Subnet - 255.255.255.0
No Gateway
No DNS
GEM1 = 10.10.0.200
Subnet - 255.255.255.0
No Gateway
No DNS
Things work like magic, no issues
However, If I change the avove to the same IP class
GEM0 = 10.10.0.202
Subnet - 255.255.255.0
No Gateway
No DNS
GEM1 = 10.10.0.200
Subnet - 255.255.255.0
No Gateway
No DNS
Then they fail to work.
After rechecking my code I found that there was an issue with Network Interface Initialisation in the NetworkInterface .c
pxMyInterfaces[xEMACIndex] = pxInterface; - I added this else the second interface is NULL
static NetworkInterface_t * pxMyInterfaces[ XPAR_XEMACPS_NUM_INSTANCES ];
NetworkInterface_t * pxZynq_FillInterfaceDescriptor( portBaseType xEMACIndex,
NetworkInterface_t * pxInterface )
{
static char pcNames[ XPAR_XEMACPS_NUM_INSTANCES ][ 8 ];
configASSERT( xEMACIndex >= 0 );
configASSERT( xEMACIndex < XPAR_XEMACPS_NUM_INSTANCES );
/* This function pxZynq_FillInterfaceDescriptor() adds a network-interface.
* Make sure that the object pointed to by 'pxInterface'
* is declared static or global, and that it will remain to exist. */
snprintf( pcNames[ xEMACIndex ], sizeof( pcNames[ xEMACIndex ] ), "eth%ld", xEMACIndex );
memset( pxInterface, '\0', sizeof( *pxInterface ) );
pxInterface->pcName = pcNames[ xEMACIndex ]; /* Just for logging, debugging. */
pxInterface->pvArgument = ( void * ) xEMACIndex; /* Has only meaning for the driver functions. */
pxInterface->pfInitialise = xZynqNetworkInterfaceInitialise;
pxInterface->pfOutput = xZynqNetworkInterfaceOutput;
pxInterface->pfGetPhyLinkStatus = xZynqGetPhyLinkStatus;
FreeRTOS_AddNetworkInterface( pxInterface );
pxMyInterfaces[xEMACIndex] = pxInterface; // I added this else the second interface is NULL
return pxInterface;
}
This addition gave the network interface list a good initialised list, however, it still fails
and with a breakpoint I Found its at
pxBuffer->pxEndPoint = FreeRTOS_MatchingEndpoint( pxInterface, pxBuffer->pucEthernetBuffer );
int emacps_check_rx( xemacpsif_s * xemacpsif,
NetworkInterface_t * pxInterface )
{
NetworkBufferDescriptor_t * pxBuffer, * pxNewBuffer;
int rx_bytes;
volatile int msgCount = 0;
int rxHead = xemacpsif->rxHead;
BaseType_t xEMACIndex = xemacpsif->emacps.Config.DeviceId;
BaseType_t xAccepted;
.......
other code in here .......
........
pxBuffer->pxInterface = pxInterface;
pxBuffer->pxEndPoint = FreeRTOS_MatchingEndpoint( pxInterface, pxBuffer->pucEthernetBuffer );
I also think that the Zynq was tested for one interface only, as I had to get the code a bit modified to make it work