cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-F767ZI Ethernet LWIP Ping causes crash

darkmaterial
Associate II

Hello,

I just started my experience with STM32 MCUs with a NUCLEO-F767ZI board. I tried to utilize the Ethernet Port of the Nucleo Board. I created a small test Firmware to get known to LWIP and FREERTOS, since i want to use both in my later Firmware. DHCP and IP Address allocation now finally works and I am able to ping the device. I use the automatically created thread to blink the led. The problem is that the device stops after some time to answer to the pings. Also the LED stops blinking. In debugger something is happening, but it doesnt seem like the thread function is called anymore. Even if I dont ping the device it stops after some time blinking. Only if I disconnect the cable it runs like charm.

I have uploaded my whole code to github, maybe somebody can tell me where my problem is.

Also, is ther a way to debug the FREERTOS with the STM32CubeIDE?

Help is very appreciated.

Thanks

https://github.com/darkmaterial/Nucleo-FZ767ZI_Ethernet_Test

6 REPLIES 6
darkmaterial
Associate II

I had time to do further investigation:

If i do a 400ms ping interval i will crash within 1000pings.

If i do a 200ms ping inverval it will crash within 200 pings.

if i do a 1000byte sized ping it will crash faster

if i do a 5000byte ping it will crash within 1 ping.

if i do a ping every second it works fine...

i now ordered a segger jlink to do further debugging in freertos. Is there a good software to do this with stlink?

>>Is there a good software to do this with stlink?

Always found Keil's debugger pretty robust.

Would recommend outputting diagnostic/telemetry via a UART or SWV.

Have effective Hard Fault Handler that can output actionable information.

Determine where it "stops" or "crashes" via the debugger.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you very much :) But currently i am a student and Keil is out of my financial reach ��

darkmaterial
Associate II

0693W000003Pob4QAC.png0693W000003PoaGQAS.pngI started debugging now with Ozone. My Led task is not visible anymore after the device crashes, and the mcu seems to cycle in this function:

void ethernetif_input(void* argument)
{
  struct pbuf *p;
  struct netif *netif = (struct netif *) argument;
  
  for( ;; )
  {
    if (osSemaphoreAcquire(s_xSemaphore, TIME_WAITING_FOR_INPUT) == osOK)
    {
      do
      {   
        LOCK_TCPIP_CORE();
        p = low_level_input( netif );
        if   (p != NULL)
        {
          if (netif->input( p, netif) != ERR_OK )
          {
            pbuf_free(p);
          }
        }
        UNLOCK_TCPIP_CORE();
      } while(p!=NULL);
    }
  }
}

it stays within the for( ;; ) . The only tasks left in the taskview are idle and tmr svc.

Wai Siang
Associate III

Hi, 

How did u get f767zi to ping at the first place? I cant do that yet.
which reference did u use and what should I pay more attention at?