eduardo1966 wrote on Thursday, May 02, 2019:
Hi
I’m using FreeRTOS+IP on an ATMEL SAME70.
The code below is used as an handler for when the Network goes UP printing IP addresses info.
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
events are only received if implemented in the MAC driver. */
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
{
uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress;
char cBuffer[ 16 ];
printf ( "vApplicationIPNetworkEventHook: event %ld"EOL, eNetworkEvent );
/* If the network has just come up...*/
if( eNetworkEvent == eNetworkUp )
{
printf ("Network is UP"EOL);
/* Print out the network configuration, which may have come from a DHCP server. */
FreeRTOS_GetAddressConfiguration( &ulIPAddress, &ulNetMask, &ulGatewayAddress, &ulDNSServerAddress );
FreeRTOS_inet_ntoa( ulIPAddress, cBuffer ); printf( "IP Address: %s"EOL, cBuffer );
FreeRTOS_inet_ntoa( ulNetMask, cBuffer ); printf( "Subnet Mask: %s"EOL, cBuffer );
FreeRTOS_inet_ntoa( ulGatewayAddress, cBuffer ); printf( "Gateway Address: %s"EOL, cBuffer );
FreeRTOS_inet_ntoa( ulDNSServerAddress, cBuffer ); printf( "DNS Server Address: %s"EOL, cBuffer );
}
}
On the network I have the FreRTOS system connected to a network with a Hirschmann Octopus POE switcher. The switcher is also providing a DHCP service.
At the beginning the switcher gives a DHCP address to the FreeRTOS system but no long after (2 or 3 minutes) it seems that the network goes DOWN and immediately UP with the same address.
I would like to know what event makes the FreeRTOS IP stack to consider the network going DOWN and UP? This could be I guess a bad/incomplete configuration of the switcher…
We have other switchers from Westermo and I don’t see these causing the same problem.
Usually the output of the vApplicationIPNetworkEventHook() function above is:
vApplicationIPNetworkEventHook: event 0
Network is UP
IP Address: 10.183.200.51
Subnet Mask: 255.240.0.0
Gateway Address: 0.0.0.0
DNS Server Address: 0.0.0.0
But once I got an address equal to 0.0.0.0 although the subnet mask was as expected!!!
vApplicationIPNetworkEventHook: event 0
Network is UP
IP Address: 0.0.0.0
Subnet Mask: 255.240.0.0
Gateway Address: 0.0.0.0
DNS Server Address: 0.0.0.0
Any ideas how an address 0.0.0.0 can be given/accepted?
thanks