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.

RM0008<br />

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

27.5.2 MAC frame transmission<br />

The DMA controls all transactions for the transmit path. Ethernet frames read from the<br />

system memory are pushed into the FIFO by the DMA. The frames are then popped out <strong>and</strong><br />

transferred to the MAC core. When the end-of-frame is transferred, the status of the<br />

transmission is taken from the MAC core <strong>and</strong> transferred back to the DMA. The Transmit<br />

FIFO has a depth of 2 Kbyte. FIFO-fill level is indicated to the DMA so that it can initiate a<br />

data fetch in required bursts from the system memory, using the AHB interface. The data<br />

from the AHB Master interface is pushed into the FIFO.<br />

When the SOF is detected, the MAC accepts the data <strong>and</strong> begins transmitting to the MII.<br />

The time required to transmit the frame data to the MII after the application initiates<br />

transmission is variable, depending on delay factors like IFG delay, time to transmit<br />

preamble/SFD, <strong>and</strong> any back-off delays for Half-duplex mode. After the EOF is transferred to<br />

the MAC core, the core completes normal transmission <strong>and</strong> then gives the status of<br />

transmission back to the DMA. If a normal collision (in Half-duplex mode) occurs during<br />

transmission, the MAC core makes the transmit status valid, then accepts <strong>and</strong> drops all<br />

further data until the next SOF is received. The same frame should be retransmitted from<br />

SOF on observing a Retry request (in the Status) from the MAC. The MAC issues an<br />

underflow status if the data are not provided continuously during the transmission. During<br />

the normal transfer of a frame, if the MAC receives an SOF without getting an EOF for the<br />

previous frame, then the SOF is ignored <strong>and</strong> the new frame is considered as the<br />

continuation of the previous frame.<br />

There are two modes of operation for popping data towards the MAC core:<br />

● In Threshold mode, as soon as the number of bytes in the FIFO crosses the configured<br />

threshold level (or when the end-of-frame is written before the threshold is crossed),<br />

the data is ready to be popped out <strong>and</strong> forwarded to the MAC core. The threshold level<br />

is configured using the TTC bits of ETH_DMABMR.<br />

● In Store-<strong>and</strong>-forward mode, only after a complete frame is stored in the FIFO, the frame<br />

is popped towards the MAC core. If the Tx FIFO size is smaller than the Ethernet frame<br />

to be transmitted, then the frame is popped towards the MAC core when the Tx FIFO<br />

becomes almost full.<br />

The application can flush the Transmit FIFO of all contents by setting the FTF<br />

(ETH_DMAOMR register [20]) bit. This bit is self-clearing <strong>and</strong> initializes the FIFO pointers to<br />

the default state. If the FTF bit is set during a frame transfer to the MAC core, then transfer is<br />

stopped as the FIFO is considered to be empty. Hence an underflow event occurs at the<br />

MAC transmitter <strong>and</strong> the corresponding Status word is forwarded to the DMA.<br />

Automatic CRC <strong>and</strong> pad generation<br />

When the number of bytes received from the application falls below 60 (DA+SA+LT+Data),<br />

zeros are appended to the transmitting frame to make the data length exactly 46 bytes to<br />

meet the minimum data field requirement of IEEE 802.3. The MAC can be programmed not<br />

to append any padding. The cyclic redundancy check (CRC) for the frame check sequence<br />

(FCS) field is calculated <strong>and</strong> appended to the data being transmitted. When the MAC is<br />

programmed to not append the CRC value to the end of Ethernet frames, the computed<br />

CRC is not transmitted. An exception to this rule is that when the MAC is programmed to<br />

append pads for frames (DA+SA+LT+Data) less than 60 bytes, CRC will be appended at the<br />

end of the padded frames.<br />

Doc ID 13902 Rev 9 853/995

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

Saved successfully!

Ooh no, something went wrong!