29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Ethernet (ETH): media access control (MAC) with DMA controller<br />

RM0008<br />

indicates the last buffer of the frame. After the last buffer of the frame has been transmitted,<br />

the DMA writes back the final status information to the transmit descriptor 0 (TDES0) word<br />

of the descriptor that has the last segment set in transmit descriptor 0 (TDES0[29]). At this<br />

time, if Interrupt on Completion (TDES0[30]) is set, Transmit Interrupt (in ETH_DMASR<br />

register [0]) is set, the next descriptor is fetched, <strong>and</strong> the process repeats. Actual frame<br />

transmission begins after the Transmit FIFO has reached either a programmable transmit<br />

threshold (ETH_DMAOMR register[16:14]), or a full frame is contained in the FIFO. There is<br />

also an option for the Store <strong>and</strong> forward mode (ETH_DMAOMR register[21]). Descriptors<br />

are released (OWN bit TDES0[31] is cleared) when the DMA finishes transferring the frame.<br />

Transmit polling suspended<br />

Transmit polling can be suspended by either of the following conditions:<br />

●<br />

●<br />

The DMA detects a descriptor owned by the CPU (TDES0[31]=0) <strong>and</strong> the Transmit<br />

buffer unavailable flag is set (ETH_DMASR register[2]). To resume, the driver must give<br />

descriptor ownership to the DMA <strong>and</strong> then issue a Poll Dem<strong>and</strong> comm<strong>and</strong>.<br />

A frame transmission is aborted when a transmit error due to underflow is detected.<br />

The appropriate Transmit Descriptor 0 (TDES0) bit is set. If the second condition<br />

occurs, both the Abnormal Interrupt Summary (in ETH_DMASR register [15]) <strong>and</strong><br />

Transmit Underflow bits (in ETH_DMASR register[5]) are set, <strong>and</strong> the information is<br />

written to Transmit Descriptor 0, causing the suspension. If the DMA goes into Suspend<br />

state due to the first condition, then both the Normal Interrupt Summary (ETH_DMASR<br />

register [16]) <strong>and</strong> Transmit Buffer Unavailable (ETH_DMASR register[2]) bits are set. In<br />

both cases, the position in the transmit list is retained. The retained position is that of<br />

the descriptor following the last descriptor closed by the DMA. The driver must explicitly<br />

issue a Transmit Poll Dem<strong>and</strong> comm<strong>and</strong> after rectifying the suspension cause.<br />

Tx DMA descriptors<br />

The descriptor structure consists of four 32-bit words as shown in Figure 313. The bit<br />

descriptions of TDES0, TDES1, TDES2 <strong>and</strong> TDES3 are given below.<br />

Figure 313. Transmit descriptor<br />

31 0<br />

TDES 0<br />

O<br />

W<br />

N<br />

Ctrl<br />

[30:26]<br />

T<br />

T<br />

S<br />

E<br />

Res.<br />

24<br />

Ctrl<br />

[23:20]<br />

Reserved<br />

[19:18]<br />

T<br />

T<br />

S<br />

S<br />

Status [16:0]<br />

TDES 1<br />

Reserved<br />

[31:29]<br />

Buffer 2 byte count<br />

[28:16]<br />

Reserved<br />

[15:13]<br />

Buffer 1 byte count<br />

[12:0]<br />

TDES 2<br />

Buffer 1 address [31:0] / Time stamp low [31:0]<br />

TDES 3<br />

Buffer 2 address [31:0] or Next descriptor address [31:0] / Time stamp high [31:0]<br />

ai15642b<br />

886/995 Doc ID 13902 Rev 9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!