cancel
Showing results for 
Search instead for 
Did you mean: 

packet loss when using STM32F429's Ethernet DMA for data transmission

miniju
Associate

I use lan8742 and stm32f429IGT6 to implement Ethernet communication.The files lan8742.c and lan8742.h are the configuration files that I am using.For the reception of Ethernet data, I adopt the interrupt mode to receive data, and use the interrupt mode to send data as well.

I am currently encountering a phenomenon that I find rather confusing. During the transmission process, there is a problem of packet loss. After sending, when I read the value of the ETH_MMCTGFCR register, I found that the value read was the expected quantity for sending after my processing, but I did not capture the quantity of Ethernet frames recorded in the ETH_MMCTGFCR register using Wireshark. Instead, I only captured the network packets.

Furthermore, through my experiments, I found that if the SR bit is cleared before sending the ETH_DMAOMR and then re-set after the sending is completed, there will be no more loss during transmission, but it will result in loss during reception.

I manage the Ethernet buffer area by using queues for the purpose of management. It is divided into two queues: the idle queue and the ready queue. After receiving Ethernet data, the buffer address is placed in the ready queue. In the main loop, data is retrieved from the ready queue, processed, and then sent out through an interrupt method. After the sending is completed, the buffer is reinserted into the idle queue for the use of the Ethernet descriptor.

0 REPLIES 0