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

Bits 31:0 TBAP2 / TTSH: Transmit buffer 2 address pointer (Next descriptor address) / Transmit frame<br />

time stamp high<br />

These bits take on two different functions: the application uses them to indicate to the DMA the<br />

location of data in memory. And then after transferring all these data, the DMA may then use<br />

these bits to pass back time stamp data.<br />

TBAP2: When the software makes this descriptor available to the DMA (at the moment when<br />

the OWN bit is set to 1 in TDES0), these bits indicate the physical address of Buffer 2 when a<br />

descriptor ring structure is used. If the Second address chained (TDES1 [24]) bit is set, this<br />

address contains the pointer to the physical memory where the next descriptor is present. The buffer<br />

address pointer must be aligned to the bus width only when TDES1 [24] is set. (LSBs are ignored<br />

internally.)<br />

TTSH: Before it clears the OWN bit in TDES0, the DMA updates this field with the 32 most<br />

significant bits of the time stamp captured for the corresponding transmit frame (overwriting the<br />

value for TBAP2). This field has the time stamp only if time stamping is activated for this frame<br />

(see TDES0 bit 25, TTSE) <strong>and</strong> if the Last segment control bit (LS) in the descriptor is set.<br />

Tx DMA descriptor format with IEEE1588 time stamp<br />

The descriptor format (as described previously) <strong>and</strong> field descriptions remain unchanged<br />

when created by software (OWN bit is set in TDES0). However, if the software has enabled<br />

the IEEE 1588 functionality, the TDES2 <strong>and</strong> TDES3 descriptor fields take on a different<br />

meaning when the DMA closes the descriptor (OWN bit in TDES0 is cleared).<br />

The Transmit descriptor has additional control <strong>and</strong> status bits (TTSE <strong>and</strong> TTSS,<br />

respectively) for time stamping, as shown in Figure 314. The software sets the TTSE bit<br />

(when the OWN bit is set), instructing the core to generate a time stamp for the<br />

corresponding Ethernet frame being transmitted. The DMA sets the TTSS bit if the time<br />

stamp has been updated in the TDES2 <strong>and</strong> TDES3 fields when the descriptor is closed<br />

(OWN bit is cleared).<br />

Figure 314. Transmit descriptor field format with IEEE1588 time stamp enabled<br />

31 0<br />

TDES 0<br />

O<br />

W<br />

N<br />

Ctrl<br />

[30:26]<br />

T<br />

T<br />

S<br />

E<br />

Res.<br />

24<br />

Ctrl<br />

[23:20]<br />

Reserved<br />

[19:18]<br />

T<br />

T<br />

S<br />

S<br />

Status [16:0]<br />

TDES 1<br />

Reserved<br />

[31:29]<br />

Buffer 2 byte count<br />

[28:16]<br />

Reserved<br />

[15:13]<br />

Buffer 1 byte count<br />

[12:0]<br />

TDES 2<br />

Buffer 1 address [31:0] / Time stamp low [31:0] (1)<br />

TDES 3<br />

Buffer 2 address [31:0] or Next descriptor address [31:0] / Time stamp high [31:0] (1)<br />

ai15642<br />

1. The DMA updates TDES2 <strong>and</strong> TDES3 with the time stamp value before clearing the OWN bit in TDES0:<br />

TDES2 is updated with the lower 32 time stamp bits (the sub-second field, called TTSL in subsequent<br />

section TDES2: Transmit descriptor Word2) <strong>and</strong> TDES3 is updated with the upper 32 time stamp bits (the<br />

Seconds field, called TTSH in subsequent sections TDES3: Transmit descriptor Word3)<br />

Doc ID 13902 Rev 9 891/995

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

Saved successfully!

Ooh no, something went wrong!