stm32duino / STM32Ethernet

Arduino library to support Ethernet for STM32 based board
163 stars 44 forks source link

Problem with FreeRTOS when reconnecting the ethernet cable #65

Closed mattia424 closed 2 years ago

mattia424 commented 2 years ago

I uploaded the example (https://github.com/stm32duino/STM32Ethernet/commit/7669880d8f1347b45f4bc2749ce9ef3eaf2b40ba) on my STM32F429ZI board and the program works correctly but in some cases it gives me problems. In the example program (examples / WebClientFreeRTOS / WebClientFreeRTOS.ino) I have commented out line 78 so that when I get the response from google on the serial monitor I am printing "disconnecting." in loop. Specifically, if I always leave the network cable connected on the serial monitor I find myself in a "disconnecting" loop. while if I try to disconnect and reconnect the cable the program crashes. In short, when I connect the network cable to the card powered on the serial monitor I no longer find the word "disconnecting" in loop. Sorry for the grammar but unfortunately English is not my language.

MCU: STM32F429ZI STM32duino core: v2.2.0 STM32duinoFreeRTOS: v10.3.1 STM32Ethernet: 1.3.0 STM32duino LwIP: 2.1.2

ABOSTM commented 2 years ago

Hi @mattia424, Thanks for reporting this issue, I reproduced it, and it appears that in case of FreeRTOS the relative priorities between Ethernet Timer and Systick are properly set. 2 fixes to solve this issue: