Question
STM32F746 Ethernet DMA Transmit problem
Posted on August 11, 2016 at 11:57
Hi,
I am developing Ethernet driver on STM32F7-DISCO board. I set buffer address, buffer size in Tx descriptor. Then I set control bits in TDES0 of Tx descriptor and write DMATPDR register to send the frame. However the frame is not sent out. If I try to transit a new frame both the previous one and the new one are sent together after each other. If I do some delay between setting OWN bit in TDES0 and writing DMATPDR register the frame will be sent immediately. I found similar behavior with the STM32 FW (STM32Cube_FW_F7_V1.4.0) delivered with STM32F7-DISCO board. I changed Ethernet HAL driver so that I exchanged code lines with setting next descriptor address and setting OWN bit, and the frame is not transmitted. I simply did this: original code order in stm32f7xx_hal_eth.c fn: HAL_ETH_TransmitFrame(): /* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */ heth->TxDesc->Status |= ETH_DMATXDESC_OWN; /* Point to next descriptor */ heth->TxDesc= (ETH_DMADescTypeDef *)(heth->TxDesc->Buffer2NextDescAddr); after changing the code order: /* Point to next descriptor */ heth->TxDesc= (ETH_DMADescTypeDef *)(heth->TxDesc->Buffer2NextDescAddr); /* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */ heth->TxDesc->Status |= ETH_DMATXDESC_OWN; Can anyone help me to overcome this problem? Thanks! Zoli #dma #ethernet #stm32f