![ARTERY AT32F435 Series Reference Manual Download Page 593](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592593.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 593
Rev 2.03
is captured. The DMA then clears the OWN bit and closes the descriptor. If the time stamping was
not enabled for the frame, the DMA will not alter the contents of TDES2 and TDES3.
6.
If enabled, the transmit interrupt bit is set. The DMA fetches the next descriptor when the status
information is normal, and jumps to Step 3. If the previous transmit status shows an underflow
error, the DMA enters into suspend state and jumps to Step 7.
7.
In suspend state, when the DMA receives a pending status information and time stamp, if the time
stamping is enabled it will write the time stamp to TDES2 and TDES3, and writes the status to
TDES0. It then sets relevant interrupt flag bits and returns to suspend state.
8.
The DMA can exit suspend state and enter run state only after receiving a transmit poll request
(EMAC_DMACTD register).
Transmit frame processing
Ethernet frames stored in the transmit buffer must contain destination address, source address, correct
type/length field and valid data. As for whether to include CRC value, it depends on the transmit
descriptor. If the transmit descriptor requires the EMAC core to disable CRC or pad insertion, the buffer
must contain the CRC.
A frame can be stored in multiple buffers that are linked in chain structure. When the transmission starts,
the TDES0 bit 28 must be set in the first descriptor, and then the data are transferred from the memory
to the TXFIFO. If the TDES0 bit 29 is set, it indicates the last buffer of the frame. After the last buffer of
the data has been completed, the DMA writes back the final status information to the TDES0. If the
transmit complete interrupt bit (TDES0[30]) is set, the transmit interrupt bit (EMAC_DMASTS bit 0) is
set, the next descriptor is fetched, and the above steps are repeated. Actual frame transmission depends
on whether the store-and-forward mode or threshold mode is selected. The descriptor is disabled
(TDES0[31] is cleared) when the DMA finishes frame transmission.
Transmit polling suspend
Transmit polling can be suspended by one of the following conditions:
The DMA detects a descriptor owned by the CPU (TDES0[31]=0), and the DMA enters suspend state.
A frame transmission is aborted when an underflow is detected. The abnormal interrupt summary bit
(EMAC_DMASTS bit 15) and transmit data underflow bit (EMAC_DMASTS bit 5) are set, and the
appropriate error bit is set in the TDES0.
TXDMA descriptors
The descriptor structure consists of four 32-bit words. The bit definitions of TDES0, TDES1, TDES2 and
TDES3 are as shown below:
Figure 26-12 Transmit descriptors
O
W
N
Control
[30:26]
T
T
S
E
Rers.
[24]
Control
[23:20]
Rers.
[19:18]
T
T
S
S
Status [16:0]
Rers.
[31:29]
Buffer 2 byte count [28:16]
Rers.
[15:13]
Buffer 1 byte count
[12:0]
Buffer 1 address [31:0]/time stamp low [31:0]
Buffer 2 address [31:0] or next descriptor address [31:0]/time stamp high[31:0]
TDES0
TDES1
TDES2
TDES3
31
0
TDES0: Transmit descriptor word0
The software must configure the control bits [30: 26]+ [23: 20] and the OWN bit during descriptor
initialization. When the DMA updates or writes the descriptor, it clears all the control bits and OWN bit,
and report only the status bits.
Bit
Name
Type
Description
Bit 31
OWN
rw
Own bit
0: The descriptor is owned by the CPU
1: The descriptor is owned by the DMA
This bit is cleared by the DMA when the DMA completes the frame transmission or