arch/arm/src/stm32h7/stm32_ethernet.c: Correct memory corruption error. The Ethernet driver initialization incorrectly wrote to DMACRXCR instead of DMACSR when trying to clear the stopped flags. This caused invalid buffer length in the DMACRXCR, causing DMA to overflow the RX buffers when large packets are sent to the device.

This commit is contained in:
Jukka Laitinen 2019-08-28 08:42:41 -06:00 committed by Gregory Nutt
parent cf5c02aa4e
commit 938e8b4ce7

View file

@ -4219,9 +4219,9 @@ static int stm32_macenable(struct stm32_ethmac_s *priv)
/* Clear Tx and Rx process stopped flags */
regval = stm32_getreg(STM32_ETH_DMACRXCR);
regval = stm32_getreg(STM32_ETH_DMACSR);
regval |= (ETH_DMACSR_TPS | ETH_DMACSR_RPS);
stm32_putreg(regval, STM32_ETH_DMACRXCR);
stm32_putreg(regval, STM32_ETH_DMACSR);
return OK;
}