ETH_SetMACConfig and ETH_SetDMAConfig function query
Hello,
Just wondering if anyone knows the reason for the duplicate writes to the following registers in the HAL Ethernet code please?
ETH->MACCR
ETH->MACFCR
ETH->DMAOMR
ETH->DMABMR
In the example shown below (from HAL code) the DMA0MR register is written to, then read back, 1 msec delay and then written to.
I've taken note of the need for the 4 clock cycle delay, however is it necessary to perform the duplicate writes?
Thanks in advance.
Edit: I'm using Cube FW F4 v1.28.
/*----------------------- ETHERNET DMAOMR Configuration --------------------*/
/* Get the ETHERNET DMAOMR value */
tmpreg1 = (heth->Instance)->DMAOMR;
/* Clear xx bits */
tmpreg1 &= ETH_DMAOMR_CLEAR_MASK;
tmpreg1 |= (uint32_t)(((uint32_t)((dmaconf->DropTCPIPChecksumErrorFrame == DISABLE) ? 1U : 0U) << 26U) |
((uint32_t)dmaconf->ReceiveStoreForward << 25U) |
((uint32_t)((dmaconf->FlushRxPacket == DISABLE) ? 1U : 0U) << 20U) |
((uint32_t)dmaconf->TransmitStoreForward << 21U) |
dmaconf->TransmitThresholdControl |
((uint32_t)dmaconf->ForwardErrorFrames << 7U) |
((uint32_t)dmaconf->ForwardUndersizedGoodFrames << 6U) |
dmaconf->ReceiveThresholdControl |
((uint32_t)dmaconf->SecondFrameOperate << 2U));
/* Write to ETHERNET DMAOMR */
(heth->Instance)->DMAOMR = (uint32_t)tmpreg1;
/* Wait until the write operation will be taken into account:
at least four TX_CLK/RX_CLK clock cycles */
tmpreg1 = (heth->Instance)->DMAOMR;
HAL_Delay(ETH_REG_WRITE_DELAY);
(heth->Instance)->DMAOMR = tmpreg1;
