LWIP IPV6 UDP STM32f746

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

LWIP IPV6 UDP STM32f746

ajnlwip
This post was updated on .
Hi,
I have a STM32F746 that I am able to send/receive IPV4 UDP messages and it
working just fine.

Now I try to move from IPV4 to IPV6. I am using CubeMx to
configure my STM32F746.

test_ipv6.zip

The first step is to ping the device but I cannot reach the STM32F746.

According to the print out in MX_LWIP_Init() the IPV6 address is
FE80::8000:0:0:E1

So I tried the the following but failed:

C:\Users\ajn>ping FE80::8000:0:0:E1

Pinging fe80::8000:0:0:e1 with 32 bytes of data:

Destination host unreachable.

The ip address of the PC is:  

Connection-specific DNS Suffix  . :  
Link-local IPv6 Address . . . . . :fe80::b034:7349:9aec:332e%5  
IPv4 Address. . . . . . . . . . . : 192.168.0.101  
Subnet Mask . . . . . . . . . . . : 255.255.255.0  
Default Gateway . . . . . . . . . : 192.168.0.1

I am little bit lost when it comes to this IPV6 addresses, so maybe I am not using the correct ones.
Do you have any suggestion how I can solve this problem?    

I have following code in:
int *main*(void)
{  
   ...  
    MX_LWIP_Init();

 ...  
    while (1)  
   {    
      /* Read a received packet from the Ethernet buffers and send it to the lwIP for handling */        
      ethernetif_input(&m_gnetif);

      // Checks if Ethernet link is up or down
      ethernetif_set_link(&m_gnetif);

      /* Handle timeouts */
      sys_check_timeouts();  
   }  
}


void *MX_LWIP_Init*(void)
{  
   /* Initilialize the LwIP stack without RTOS */  
   lwip_init();  

   /* add the network interface(IPv6) without RTOS */
   netif_add(&gnetif, NULL, ðernetif_init,ðernet_input);  

   /* Create IPv6 local address */
   netif_create_ip6_linklocal_address(&gnetif, 0);

   netif_ip6_addr_set_state(&gnetif, 0, IP6_ADDR_VALID);
   gnetif.ip6_autoconfig_enabled = 1;  

   my_printf("%s: ", ip6addr_ntoa(netif_ip6_addr(&gnetif, 0)));  

   /* Registers the default network interface */  
   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);  
      }
 
   /* Set the link callback function, this function is called on change of link status*/
   netif_set_link_callback(&gnetif, ethernetif_update_config);  

   /* Create the Ethernet link handler thread */

   /* USER CODE BEGIN 3 */
   /* USER CODE END 3 */
}



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users