2022-05-23 06:37 AM
Hello everyone,
I'm using the STM32H7 and the new fully reworked ethernet driver along with the LWIP and FreeRTOS for sending and receiving the UDP packets.
The issue is first two packets get corrupted when sending. I don't send the UDP packet with zeroes in the payload, but the first sent packet is filled with zeroes.
I've tried placing a delay in case the Ethernet is not properly initialized but that didn't fix anything.
I suspect that the memory gets corrupted, but cannot prove anything.
Does anybody know what could be the potential issue here?
Thanks
Solved! Go to Solution.
2022-05-26 07:50 AM
Hello everyone,
Just an FYI,
I added the clean data cache for the packet buffer which is sent over the UDP right before sending
and that appears to have fixed the issue (for now, at least).
Now, the initial packets and all the others that are sent out are fine.
I think the issue was that the data was updated and placed in the cache and the same buffer wasn't updated in the SRAM which is accessed by the DMA which takes the old values and sends them instead of the new updated ones which haven't been written through to the SRAM.
Thorough testing will follow.
SCB_CleanDCache_by_Addr((uint32_t*)(((uint32_t)packetBuffer) & ~(uint32_t)0x1F), packetSize+32);
sendPacket(packetBuffer, packetSize);