cancel
Showing results for 
Search instead for 
Did you mean: 

Ethernet DMA error - how to handle it?

_AdamNtrx
Associate III

Hello!

I am writing a program for STM32F769I-DISCO board that uses FreeRTOS and LwIP to communicate with the server and send data to it. It generally works, but unplugging and plugging Ethernet cable (especially doing it several times within a few seconds) usually causes Ethernet DMA errors which make program stop calling HAL_ETH_IRQHandler and thus board can't even try to reconnect to server. I don't know how I should handle those errors and where to look for information that could offer a solution to my problem.

Any kind of help, whether a direct response or a link to helpful resources, is appreciated.

 

Ethernet DMASR registerEthernet DMASR registerheth error codeheth error code

MPU and Ethernet descriptorsMPU and Ethernet descriptors

 

EDIT 1: Added ethernetif.c and lwip.c files to attachments and screenshot of MPU configuration.

 

2 REPLIES 2
Vidar
Associate III

Can you share your lwip.c implementation as well as ethernetif.c? Also how often per second do you plug it out?

It could be possible that something in the ethernet thread is silently failing or a mutex is internally overflowing. Maybe you could internally in the thread implement a logging mechanism and track it, or you accept that it is maybe out of scope XD

I added files to attachments. In short, I didn't really change those files, only added attributes to semaphores and inserted some uint8_t variables to check them in debugger. The biggest changes are in lwipopts.h file where I decided to turn off some features without regenerating code with CubeMX.