cancel
Showing results for 
Search instead for 
Did you mean: 

DCache is not cleared in ethernetif low_level_output function

MWKIN
Associate

Hi,

I'm using a STM32f767ZIT with FreeRTOS and LWIP on a custom board.
After running into some weird UDP transmission issues, I discoverd that in the generated ethernetif.c file, the DCache is not cleaned in the low_level_output function.

Adding this at line 414 ( after Txbuffer[i].len = q->len; ) in low_level_output() fixed my issues.

SCB_CleanDCache_by_Addr(
    (uint32_t *)((uint32_t)(Txbuffer[i].buffer) & ~0x1F),
    Txbuffer[i].len + ((uint32_t)(Txbuffer[i].buffer) & 0x1F)
);

In the HAL_ETH_RxLinkCallback, the SCB_InvalidateDCache_by_Addr is used, so this seems like an oversight?

1 REPLY 1
STackPointer64
ST Employee

Hello @MWKIN, and welcome to the community!

Could you please provide more details about the UDP transmission issue? For example, are packets being dropped, is the dropping random, or are there CRC calculation errors? If possible, sharing a minimal project that reproduces the issue would be very helpful for analysis.

Best regards,

To improve visibility of answered topics, please click 'Accept as Solution' on the reply that resolved your issue or answered your question.