2024-11-20 04:32 AM
Hello everyone.
What is the proper procedure when restarting the entire ethernet?
Im using LWIP and FreeRTOS and im not sure if im restarting everything correctly...
These are the steps im using.
netif_set_down(&gnetif);
netif_remove(&gnetif);
netconn_delete(Connection);
osThreadTerminate(ThreadID);
HAL_ETH_Stop(&heth);
HAL_ETH_DeInit(&heth);
HAL_ETH_Init(&heth);
HAL_ETH_Start(&heth);
netif_set_ipaddr(&gnetif, ip);
netif_set_up(&gnetif);
ThreadID = osThreadNew(TCP_Thread, NULL, &TCP_Thread_attributes);
What steps am i missing?
Thanks for any replies :)
2024-11-20 07:22 AM
Hello @XD ,
Restarting Lwip and Ethernet are not the same think as Lwip is a software set of function using ethernet to implement the rest of TCP/IP model and Ethernet is a peripheral integrated in the STM32 so doing a Dinit and Init to Ethernet is able to make it restart regarding Lwip it is up to you to know how to handle it and implement proper callback to recover when the Ethernet peripheral is uninitialized .
Regards