2022-06-05 05:36 AM
Hi everyone,
I started a new project with STM32H7-DISCO and need to receive 64KB of data via UDP. I tested ST example with FreeRtos but it gives a hard fault above 4KB. I tried many things such as increasing descriptors and MPUs according to these descriptors values but I can't. (by the way when increased the descriptors to 8 then UDP doesn't work). Please help me with how to configure it to receive 64KB.
Tested Code : https://community.st.com/s/article/How-to-create-project-for-STM32H7-with-Ethernet-and-LwIP-stack-working
2022-06-05 01:27 PM
Do you understand that 64KB is much more that the largest L2 packet of the STM32H7 ethernet controller? A packet this long will be fragmented by the IP library (LwIP, FreeRtos+ TCP or whatever else you use). So the IP library configuration chores will add to the numerous ETH driver issues.
You may want to rethink the design, go for smaller UDP messages that fit into one L2 packet (with jumbo option, max. is ~ 10 KB).
2022-06-05 02:04 PM
I understand that fragmentation causes problems in LWIP, right? Also, with this example, I get a hard fault error with over 4KB? Why? How can I configure the jumbo option correctly?
2022-06-05 02:41 PM
Perhaps root-cause what specifically is hard faulting. Perhaps check alignment and cache management.
2022-06-05 03:15 PM
I checked mpu, not allowed to access the memory area of Descriptions and RX Buffer to the cache. Also, I disabled the cache, but it still gives hardfault.
2022-06-05 05:00 PM
> How can I configure the jumbo option correctly?
Ability to use jumbo sizes depends on the PHY and wiring.
Likely there's some problem with memory pool assigned to LwIP, but there are also numerous issues with the ETH driver, so it is hard to tell which of them bugs you.
Have you tried to analyze the hard fault?
2022-06-06 04:58 AM
@gokhannsahin "I get a hard fault ... Why?"
Implement a Hard Fault Handler to answer that question.
https://community.arm.com/support-forums/f/embedded-forum/3257/debugging-a-cortex-m0-hard-fault/
2022-06-06 01:36 PM
@Andrew Neil There's no need to write any code at this step. The debugger of CubeIDE has a tool for this. (and Keil has too, IIRC)