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

●<br />

TDES3: Transmit descriptor Word3<br />

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0<br />

TTSH<br />

rw<br />

Bits 31:0 TTSH: Transmit frame time stamp high<br />

This field is updated by DMA with the 32 most significant bits of the time stamp captured for<br />

the corresponding transmit frame. This field has the time stamp only if the Last segment control bit<br />

(LS) in the descriptor is set.<br />

27.6.8 Rx DMA configuration<br />

The Receive DMA engine’s reception sequence is illustrated in Figure 315 <strong>and</strong> described<br />

below:<br />

1. The CPU sets up Receive descriptors (RDES0-RDES3) <strong>and</strong> sets the OWN bit<br />

(RDES0[31]).<br />

2. Once the SR (ETH_DMAOMR register[1]) bit is set, the DMA enters the Run state.<br />

While in the Run state, the DMA polls the receive descriptor list, attempting to acquire<br />

free descriptors. If the fetched descriptor is not free (is owned by the CPU), the DMA<br />

enters the Suspend state <strong>and</strong> jumps to Step 9.<br />

3. The DMA decodes the receive data buffer address from the acquired descriptors.<br />

4. Incoming frames are processed <strong>and</strong> placed in the acquired descriptor’s data buffers.<br />

5. When the buffer is full or the frame transfer is complete, the Receive engine fetches the<br />

next descriptor.<br />

6. If the current frame transfer is complete, the DMA proceeds to step 7. If the DMA does<br />

not own the next fetched descriptor <strong>and</strong> the frame transfer is not complete (EOF is not<br />

yet transferred), the DMA sets the Descriptor error bit in RDES0 (unless flushing is<br />

disabled). The DMA closes the current descriptor (clears the OWN bit) <strong>and</strong> marks it as<br />

intermediate by clearing the Last segment (LS) bit in the RDES1 value (marks it as last<br />

descriptor if flushing is not disabled), then proceeds to step 8. If the DMA owns the next<br />

descriptor but the current frame transfer is not complete, the DMA closes the current<br />

descriptor as intermediate <strong>and</strong> returns to step 4.<br />

7. If IEEE 1588 time stamping is enabled, the DMA writes the time stamp (if available) to<br />

the current descriptor’s RDES2 <strong>and</strong> RDES3. It then takes the received frame’s status<br />

<strong>and</strong> writes the status word to the current descriptor’s RDES0, with the OWN bit cleared<br />

<strong>and</strong> the Last segment bit set.<br />

8. The Receive engine checks the latest descriptor’s OWN bit. If the CPU owns the<br />

descriptor (OWN bit is at 0) the Receive buffer unavailable bit (in ETH_DMASR<br />

register[7]) is set <strong>and</strong> the DMA Receive engine enters the Suspended state (step 9). If<br />

the DMA owns the descriptor, the engine returns to step 4 <strong>and</strong> awaits the next frame.<br />

9. Before the Receive engine enters the Suspend state, partial frames are flushed from<br />

the Receive FIFO (you can control flushing using bit 24 in the ETH_DMAOMR register).<br />

10. The Receive DMA exits the Suspend state when a Receive Poll dem<strong>and</strong> is given or the<br />

start of next frame is available from the Receive FIFO. The engine proceeds to step 2<br />

<strong>and</strong> re-fetches the next descriptor.<br />

The DMA does not acknowledge accepting the status until it has completed the time stamp<br />

write-back <strong>and</strong> is ready to perform status write-back to the descriptor. If software has<br />

Doc ID 13902 Rev 9 895/995

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

Saved successfully!

Ooh no, something went wrong!