If I use same IP class the Zynq Build fails to respond

Hi,

I may find a solution soon, yet as it’s taken half a day phew :crying_cat_face: 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 :+1:

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

The issue is seen on Linux as well for the Xilinx Zynq

https://support.xilinx.com/s/article/72064?language=en_US

Reading the response on the post above, it seems like expected behavior. Is anything else needed here?

Thanks.

No this post can be closed - many thanks