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 />

PTP pulse-per-second output signal<br />

This PTP pulse output is used to check the synchronization between all nodes in the<br />

network. To be able to test the difference between the local slave clock <strong>and</strong> the master<br />

reference clock, both clocks were given a pulse-per-second (PPS) output signal that may be<br />

connected to an oscilloscope if necessary. The deviation between the two signals can<br />

therefore be measured. The pulse width of the PPS output is 125 ms.<br />

The PPS output is enabled through bit 30 in the AFIO_MAPR register.<br />

Figure 309. PPS output<br />

Ethernet MAC<br />

PPS output<br />

ai15672<br />

27.6 Ethernet functional description: DMA controller operation<br />

The DMA has independent transmit <strong>and</strong> receive engines, <strong>and</strong> a CSR space. The transmit<br />

engine transfers data from system memory into the Tx FIFO while the receive engine<br />

transfers data from the Rx FIFO into system memory. The controller utilizes descriptors to<br />

efficiently move data from source to destination with minimum CPU intervention. The DMA<br />

is designed for packet-oriented data transfers such as frames in Ethernet. The controller can<br />

be programmed to interrupt the CPU in cases such as frame transmit <strong>and</strong> receive transfer<br />

completion, <strong>and</strong> other normal/error conditions. The DMA <strong>and</strong> the STM32F107xx<br />

communicate through two data structures:<br />

● Control <strong>and</strong> status registers (CSR)<br />

● Descriptor lists <strong>and</strong> data buffers.<br />

Control <strong>and</strong> status registers are described in detail in Section 27.8 on page 906. Descriptors<br />

are described in detail in Section on page 886.<br />

The DMA transfers the received data frames to the receive buffer in the STM32F107xx<br />

memory, <strong>and</strong> transmits data frames from the transmit buffer in the STM32F107xx memory.<br />

Descriptors that reside in the STM32F107xx memory act as pointers to these buffers. There<br />

are two descriptor lists: one for reception, <strong>and</strong> one for transmission. The base address of<br />

each list is written into DMA Registers 3 <strong>and</strong> 4, respectively. A descriptor list is forwardlinked<br />

(either implicitly or explicitly). The last descriptor may point back to the first entry to<br />

create a ring structure. Explicit chaining of descriptors is accomplished by configuring the<br />

second address chained in both the receive <strong>and</strong> transmit descriptors (RDES1[14] <strong>and</strong><br />

TDES0[20]). The descriptor lists reside in the Host’s physical memory space. Each<br />

descriptor can point to a maximum of two buffers. This enables the use of two physically<br />

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

Host’s physical memory space, <strong>and</strong> 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 <strong>and</strong><br />

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

878/995 Doc ID 13902 Rev 9

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

Saved successfully!

Ooh no, something went wrong!