System gets stuck in hardfault handler when 64Kbytes data is transmitted

i am able to transmit the complete data but sometimes system gets stuck in Hard Fault Handler during start, i think there is some issue in “pxPortInitialiseStack() at port.c:214 0x8011334”-
Hard Fault Stack-

cam_bsnet Debug [STM32 C/C++ Application]

cam_bsnet.elf [cores: 0]

Thread #1 [main] 1 [core: 0] (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)

HardFault_Handler() at stm32h7xx_it.c:112 0x8001e2c

() at 0xfffffffd

ethernet_input() at ethernet.c:113 0x8021bb4

tcpip_thread_handle_msg() at tcpip.c:174 0x80159d6

tcpip_thread() at tcpip.c:148 0x801598a

pxPortInitialiseStack() at port.c:214 0x8011334

arm-none-eabi-gdb (13.2.90.20230627)

ST-LINK (ST-LINK GDB server)

Need help resolving this.

No, the issue is likely in your ethernet_input() function. Check the implementation of this function to see if this might be causing some memory corruption.

I agree with @aggarg here. Is your ethernet function somehow relying upon the stack for transmission? Or does the function require more than the configured stack size?