2022-01-07 01:39 PM
I have a H745 Nucleo board running LwIP. I have implemented a simple udp echo server. I receive all of the data for the udp messages being sent to the board but the data I am sending back never makes it out on the wire (verified with Wireshark). I have stepped all the way down to HAL_ETH_Transmit() and everything looks fine at that point. The correct number of bytes get transmitted, just the wrong data (mostly zeros).
I'm assuming this is a memory/cache/dma configuration issue but I can not seem to locate the problem. I've tried doubling the task stack size but that did not help. I've also been through numerous HowTo's including this one: https://community.st.com/s/article/How-to-create-project-for-STM32H7-with-Ethernet-and-LwIP-stack-working
Any help is appreciated. My entire project is attached, including the ioc for CubeMX. All the relevant code is in main.c: functions myudpInit() and mydupEcho().
2022-01-07 02:17 PM
Disable data cache and try it. If that solves it, you are likely not handling cache appropriately. Clean before sending, invalidate before reading. Buffers must be cache aligned.
2022-01-12 07:30 PM
> invalidate before reading
Invalidating before reading is too late. It has to be invalidated before starting the reception - therefore before passing it to DMA. The reason is cache eviction, which can happen at any time.
https://community.st.com/s/question/0D50X0000C9hGoz/weird-cache-writeback-behavior-for-stm32f7508
2024-08-27 12:24 PM
Hi. I faced the same problem.
The problem is that the send buffer is located in cached memory. When using the lwip_send socket API, the transfer data buffer is stored as a reference by netbuf_ref. Then this buffer will be sent by DMA.
Ways to solve the problem: