GD32F20x User Manual
811
to be large enough to store the whole frame, the FSG and the LSG bit are set in the same
descriptor. The actual frame length FRML can be read from RDES0. So application can
calculate the left unused buffer space. The RxDMA always uses a new descriptor to receive
the start of next frame.
Arbitration for TxDMA and RxDMA controller
There are two types of arbitration method designed for improving the efficiency of DMA
controller between transmission and reception: fixed-priority and round-robin. When DAB bit
in ENET_DMA_BCTL register is reset, arbiter selects round-robin method. The arbiter
allocates the data bus in the ratio set by the RTPR bits in ENET_DMA_BCTL, when both of
TxDMA and RxDMA controller request access simultaneously. When DAB bit in
ENET_DMA_BCTL register is set, arbiter selects fixed-priority, and the RxDMA controller
always has higher priority over the TxDMA.
Error response to DMA controller
During the operation of the DMA controller, when a response error presents on the bus, the
DMA controller considers a fatal error occurs and stops operating at once with error flags
written to the DMA status register (ENET_DMA_STAT). After such fatal error (response error)
occurs, application must reset the Ethernet module and reinitialize the DMA controller.
DMA controller initialization for transmission and reception
Before using the DMA controller, the initialization must be done as follow steps:
1.
Set the bus access parameters by writing the ENET_DMA_BCTL register
2.
Mask unnecessary interrupt source by configuring the ENET_DMA_INTEN register
3.
Program the Tx and Rx descriptor table start address by writing the
ENET_DMA_TDTADDR register and the ENET_DMA_RDTADDR register
4.
Configure filter option by writing related registers
5.
According to the auto-negotiation result with external PHY, set the SPD bit and DPM bit
for selecting the communication mode (Half-duplex/Full-duplex) and the communication
speed (10Mbit/s or 100Mbit/s). Set the TEN and REN bit in ENET_MAC_CFG register
to enable MAC transmit and receive operations.
6.
Set STE bit and SRE bit in ENET_DMA_CTL register to enable TxDMA controller and
RxDMA controller
Note:
If the HCLK frequency is too much low, application can enable RxDMA before set REN
bit in ENET_MAC_CFG register to avoid RxFIFO overflow at start time.
Summary of Contents for GD32F20 Series
Page 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Page 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Page 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Page 385: ...GD32F20x User Manual 385 ...
Page 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...