cancel
Showing results for 
Search instead for 
Did you mean: 

Assertion Failed: "mem_free: illegal memory: non-linked: double free" in LwIP on STM32H723 with KSZ8863 Ethernet Switc

wsrrasel
Associate

Hi ST Community,

I am working on a project using the STM32H723 MCU and the KSZ8863 Ethernet switch. I initially encountered issues while using a modified TCP echo server example, but after reverting to the unmodified example, the same issue persists. Communication is functional, but the system eventually crashes with the following assertion:

Assertion "mem_free: illegal memory: non-linked: double free" failed at line 661 in ../Middlewares/Third_Party/LwIP/src/core/mem.c

System Details:

  1. MCU: STM32H723
  2. Switch: KSZ8863 (connected via RMII for Ethernet data and SPI for control)
  3. Middleware: LwIP (as provided in STM32Cube firmware package)
  4. Example Used: Modified tcpecho server example from LwIP.
  5. Peripheral Interface:
    • RMII for Ethernet data.
    • SPI for KSZ8863 switch configuration.
    • SMI is not used.

Observed Behavior:

  • The application works correctly for some time, and the TCP echo functionality responds as expected.
  • Under moderate network load or over time, the system crashes with the above assertion in LwIP’s mem_free function.

Here are the configurations:

Cortex M7:

cortexM7.png

 

Ethernet:

eth.png

 

LwIP:

lwip_1.png

 

lwip_2.png

 

lwip_3.png

 

Thanks in advance for any guidance!

Best regards,

Russel Mahmud

0 REPLIES 0