09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

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 <strong>RM0090</strong><br />

addressed buffers, instead of two contiguous buffers in memory. A data buffer resides in the<br />

Host’s physical memory space, and consists of an entire frame or part of a frame, but cannot<br />

exceed a single frame. Buffers contain only data. The buffer status is maintained in the<br />

descriptor. Data chaining refers to frames that span multiple data buffers. However, a single<br />

descriptor cannot span multiple frames. The DMA skips to the next frame buffer when the<br />

end of frame is detected. Data chaining can be enabled or disabled. The descriptor ring and<br />

chain structure is shown in Figure 346.<br />

Figure 346. Descriptor ring and chain structure<br />

Descriptor 0<br />

Descriptor 1<br />

Descriptor 2<br />

Descriptor n<br />

29.6.1 Initialization of a transfer using DMA<br />

Initialization for the MAC is as follows:<br />

1. Write to ETH_DMABMR to set STM32F4xx bus access parameters.<br />

2. Write to the ETH_DMAIER register to mask unnecessary interrupt causes.<br />

3. The software driver creates the transmit and receive descriptor lists. Then it writes to<br />

both the ETH_DMARDLAR and ETH_DMATDLAR registers, providing the DMA with<br />

the start address of each list.<br />

4. Write to MAC Registers 1, 2, and 3 to choose the desired filtering options.<br />

5. Write to the MAC ETH_MACCR register to configure and enable the transmit and<br />

receive operating modes. The PS and DM bits are set based on the auto-negotiation<br />

result (read from the PHY).<br />

6. Write to the ETH_DMAOMR register to set bits 13 and 1 and start transmission and<br />

reception.<br />

7. The transmit and receive engines enter the running state and attempt to acquire<br />

descriptors from the respective descriptor lists. The receive and transmit engines then<br />

begin processing receive and transmit operations. The transmit and receive processes<br />

are independent of each other and can be started or stopped separately.<br />

29.6.2 Host bus burst access<br />

The DMA attempts to execute fixed-length burst transfers on the AHB master interface if<br />

configured to do so (FB bit in ETH_DMABMR). The maximum burst length is indicated and<br />

limited by the PBL field (ETH_DMABMR [13:8]). The receive and transmit descriptors are<br />

941/1416 Doc ID 018909 Rev 3<br />

Ring structure Chain structure<br />

Buffer 1<br />

Buffer 2<br />

Buffer 1<br />

Buffer 2<br />

Buffer 1<br />

Buffer 2<br />

Buffer 1<br />

Buffer 2<br />

Descriptor 0<br />

Descriptor 1<br />

Descriptor 2<br />

Next descriptor<br />

Buffer 1<br />

Buffer 1<br />

Buffer 1<br />

ai15638

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

Saved successfully!

Ooh no, something went wrong!