cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 Ethernet Big Data

gokhannsahin
Associate II

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

7 REPLIES 7
Pavel A.
Evangelist III

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).

gokhannsahin
Associate II

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?

Perhaps root-cause what specifically is hard faulting. Perhaps check alignment and cache management.

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

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.

> 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?

@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/

@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)