29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

RM0008<br />

frame is being transmitted. As soon as the first frame has been transferred <strong>and</strong> the<br />

status is received from the MAC, it is pushed to the DMA. If the DMA has already<br />

completed sending the second packet to the FIFO, the second transmission must wait<br />

for the status of the first packet before proceeding to the next frame.<br />

Retransmission during collision<br />

While a frame is being transferred to the MAC, a collision event may occur on the MAC line<br />

interface in Half-duplex mode. The MAC would then indicate a retry attempt by giving the<br />

status even before the end of frame is received. Then the retransmission is enabled <strong>and</strong> the<br />

frame is popped out again from the FIFO. After more than 96 bytes have been popped<br />

towards the MAC core, the FIFO controller frees up that space <strong>and</strong> makes it available to the<br />

DMA to push in more data. This means that the retransmission is not possible after this<br />

threshold is crossed or when the MAC core indicates a late collision event.<br />

Transmit FIFO flush operation<br />

The MAC provides a control to the software to flush the Transmit FIFO through the use of Bit<br />

20 in the Operation mode register. The Flush operation is immediate <strong>and</strong> the Tx FIFO <strong>and</strong><br />

the corresponding pointers are cleared to the initial state even if the Tx FIFO is in the middle<br />

of transferring a frame to the MAC Core. This results in an underflow event in the MAC<br />

Transmitter, <strong>and</strong> the frame transmission is aborted. The status of such a frame is marked<br />

with both underflow <strong>and</strong> frame flush events (TDES0 bits 13 <strong>and</strong> 1). No data are coming to<br />

the FIFO from the application (DMA) during the Flush operation. Transfer transmit status<br />

words are transferred to the application for the number of frames that is flushed (including<br />

partial frames). Frames that are completely flushed have the Frame flush status bit (TDES0<br />

13) set. The Flush operation is completed when the application (DMA) has accepted all of<br />

the Status words for the frames that were flushed. The Transmit FIFO Flush control register<br />

bit is then cleared. At this point, new frames from the application (DMA) are accepted. All<br />

data presented for transmission after a Flush operation are discarded unless they start with<br />

an SOF marker.<br />

Transmit status word<br />

At the end of the Ethernet frame transfer to the MAC core <strong>and</strong> after the core has completed<br />

the transmission of the frame, the transmit status is given to the application. The detailed<br />

description of the Transmit Status is the same as for bits [23:0] in TDES0. If IEEE 1588 time<br />

stamping is enabled, a specific frames’ 64-bit time stamp is returned, along with the transmit<br />

status.<br />

Transmit checksum offload<br />

Communication protocols such as TCP <strong>and</strong> UDP implement checksum fields, which helps<br />

determine the integrity of data transmitted over a network. Because the most widespread<br />

use of Ethernet is to encapsulate TCP <strong>and</strong> UDP over IP datagrams, the Ethernet controller<br />

has a transmit checksum offload feature that supports checksum calculation <strong>and</strong> insertion in<br />

the transmit path, <strong>and</strong> error detection in the receive path. This section explains the operation<br />

of the checksum offload feature for transmitted frames.<br />

Note: 1 The checksum for TCP, UDP or ICMP is calculated over a complete frame, then inserted into<br />

its corresponding header field. Due to this requirement, this function is enabled only when<br />

the Transmit FIFO is configured for Store-<strong>and</strong>-forward mode (that is, when the TSF bit is set<br />

in the ETH_ETH_DMAOMR register). If the core is configured for Threshold (cut-through)<br />

mode, the Transmit checksum offload is bypassed.<br />

856/995 Doc ID 13902 Rev 9

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

Saved successfully!

Ooh no, something went wrong!