Hi,
I just upgraded from TCP 3.1.0 to 4.0.0 The purpose of this update is to create multiple endpoints and communicate between them.
In order to be able to run TCP 4.0.0 in the first place, I had to put the declaration of the function pxZynq_FillInterfaceDescriptor in FreeRTOS_IP.h. Because I had to call it from main.cpp. Is it normal?
To enable communication between endpoints, I put the loopback code (below) at the beginning of the xZynqNetworkInterfaceOutput function.
if( xCheckLoopback( pxBuffer, bReleaseAfterSend ) != 0 )
{
usGenerateProtocolChecksum( pxBuffer->pucEthernetBuffer, pxBuffer->xDataLength, pdTRUE );
return pdTRUE;
}
Since none of the endpoints were aware of each other’s arp message, there was no communication. So I create a task that updates arp entries once in a second. The code is below.
while(true){
vTaskDelay(pdMS_TO_TICKS(pdMS_TO_TICKS(1000)));
for(size_t i = 0; i < ipconfigARP_CACHE_ENTRIES; i++){
if(xARPCache[i].ulIPAddress == FreeRTOS_inet_addr("192.168.1.100")){
xARPCache[i].ucAge = 0xff;
xARPCache[i].ucValid = 1;
xARPCache[i].xMACAddress = {0x00, 0x11, 0x22, 0x33, 0x44,0x6E};
}
if(xARPCache[i].ulIPAddress == FreeRTOS_inet_addr("192.168.2.100")){
xARPCache[i].ucAge = 0xff;
xARPCache[i].ucValid = 1;
xARPCache[i].xMACAddress = {0x00, 0x11, 0x22, 0x33, 0x44, 0x64};
}
}
}
Of course, to do this, I removed the static keyword in front of the xARPCache variable.
I think endpoints should be aware of each other’s mac-ip address pair.
Is there a way I can solve this problem without changing the source code?
Happy coding.