2025-04-30 4:50 AM
Hello guys.
I've bought Riverdi 12.1” board that mounts STM32H757XIH6.
I developed graphic part and I use uSD, and USB Mass-Storage without any problems.
I use FreeRTOS and FatFS.
Now it's time to use Ethernet, so I bought PoE - Riverdi, enabled LWIP library following instructions on the video How to use Ethernet on Riverdi STM32 Embedded Displays || PoE Add-on.
I set MX in this way:
The linker script
ethernetif.c
I compiled and I connect ethernet cable and it seems work poperly because if I ping I obtain right answer,
but! sometimes processor goes to HardFault
I've writed simple TCP server that accept connection on port 100 and send "Hello" every second.
When I try to connect with TERA TERM it goes immediately on HardFault.
Here the code of ethernet_input
Can someone Help me ?
Thankyou in advance
2025-05-05 6:14 AM - edited 2025-05-05 7:25 AM
Today it goes to HardFault from __ISB or __DSB:
Stack for __DSB
And stack for __ISB
If could be helpful the CFRS is IMPRECISERR
2025-05-12 2:57 AM - edited 2025-05-12 3:00 AM
I observe that memp_memory_RX_POOL_base is at 0x30000400 and its size is 18,38KB, so memp_memory_RX_POOL_base spans in 0x30000400..30004BCC.
Starting from this I set LWIP_RAM_HEAP_POINTER to 0x30005000 because I suspect that memp_memory_RX_POOL_base overlaps LWIP_RAM_HEAP_POINTER.
Then I go to MPU and increase MPU Region 1 Size from 16K to 64K because it started from 0x30000400 and its size is 0x30005000-0x30000400+14KB
Subsequently I increase INTERFACE_THREAD_STACK_SIZE from 350 to 1KB ..
And I increase that stack of Server thread from 1KB to 10KB (even if I want to undersand how to reduce it to a minimum necessary size)
With this change the Server works without MCU crash... I observed one/two crashes and I'm still investigating.
I notice that when I send packets from PC to MCU sometimes MCU crashes