cancel
Showing results for 
Search instead for 
Did you mean: 

Can't ping IPv6 in stm32f769I discovery

KP.1132
Associate II

I am using LWIP 2.1.2 in stm32f769I discovery board.

I can ping IPv4 from my PC.

But i can't ping IPv6.

I have enabled the Autoconfig(Stateless).

As per my understanding the IP address will be created based on the MAC.

My MAC is 00:80:e1:00:00:00

Link local address  is fe80::280:e1ff:fe00:0000

I tried to ping this address from my PC.

But host is unreachable.

IPv4 is working but IPv6 is not working.

I have attached my code below.

Please tell me how to solve this issue.

Thanks in advance.

///////////////////////////////////////////////////////////////////////////////////////////////

void MX_LWIP_Init(void)

{

 /* IP addresses initialization */

 IP_ADDRESS[0] = 192;

 IP_ADDRESS[1] = 168;

 IP_ADDRESS[2] = 0;

 IP_ADDRESS[3] = 102;

 NETMASK_ADDRESS[0] = 255;

 NETMASK_ADDRESS[1] = 255;

 NETMASK_ADDRESS[2] = 255;

 NETMASK_ADDRESS[3] = 0;

 GATEWAY_ADDRESS[0] = 0;

 GATEWAY_ADDRESS[1] = 0;

 GATEWAY_ADDRESS[2] = 0;

 GATEWAY_ADDRESS[3] = 0;

  

 /* Initilialize the LwIP stack with RTOS */

 tcpip_init( NULL, NULL );

 /* IP addresses initialization without DHCP (IPv4) */

 IP4_ADDR(&ipaddr, IP_ADDRESS[0], IP_ADDRESS[1], IP_ADDRESS[2], IP_ADDRESS[3]);

 IP4_ADDR(&netmask, NETMASK_ADDRESS[0], NETMASK_ADDRESS[1] , NETMASK_ADDRESS[2], NETMASK_ADDRESS[3]);

 IP4_ADDR(&gw, GATEWAY_ADDRESS[0], GATEWAY_ADDRESS[1], GATEWAY_ADDRESS[2], GATEWAY_ADDRESS[3]);

 /* add the network interface (IPv4/IPv6) with RTOS */

 netif_add(&gnetif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &tcpip_input);

 /* Create IPv6 local address */

 netif_create_ip6_linklocal_address(&gnetif, 1);

 netif_ip6_addr_set_state(&gnetif, 0, IP6_ADDR_VALID);

 gnetif.ip6_autoconfig_enabled = 1;

 netif_set_default(&gnetif);

 if (netif_is_link_up(&gnetif))

 {

  /* When the netif is fully configured this function must be called */

  netif_set_up(&gnetif);

 }

 else

 {

  /* When the netif link is down this function must be called */

  netif_set_down(&gnetif);

 }

///////////////////////////////////////////////////////////////////////////////////////////////

0 REPLIES 0