STM32F1 ETHERNET

Started by tha, February 11, 2021, 08:40:30 AM

Previous topic - Next topic

tha

29 Ethernet (ETH): media access control (MAC) with DMA controller

Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx
microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes.
Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx
microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes.
High-density devices are STM32F101xx and STM32F103xx microcontrollers where the
Flash memory density ranges between 256 and 512 Kbytes.
XL-density devices are STM32F101xx and STM32F103xx microcontrollers where the
Flash memory density ranges between 768 Kbytes and 1 Mbyte.
Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers.

section นี้ใช้เฉพาะกับ STM32F107xx connectivity line devices เท่านั้น.

29.1 Ethernet introduction

Portions Copyright (c) 2004, 2005 Synopsys, Inc. สงวนลิขสิทธิ์ ใช้โดยได้รับอนุญาต

The Ethernet peripheral เปิดการใช้งาน the STM32F107xx เพื่อ transmit and receive data บน Ethernet เป็นไปตาม the IEEE 802.3-2002 standard

The Ethernet จัดให้มี a configurable, flexible peripheral เพื่อตรงตามความต้องการของหลากหลาย applications and customers. มันรองรับ two industry standard ที่อินเตอร์เฟสถึง the external physical layer (PHY): the default media independent interface (MII) ที่กำหนดใน the IEEE 802.3 specifications และ the reduced media independent interface (RMII). มันสามารถถูกใช้ในจำนวนของ applications อย่างเช่น switches, network interface cards, ฯลฯ.

The Ethernet เป็นไปตามมาตรฐานต่อไปนี้:
•    IEEE 802.3-2002 for Ethernet MAC
•    IEEE 1588-2002 standard for precision networked clock synchronization
•    AMBA 2.0 for AHB Master/Slave ports
•    RMII specification from RMII consortium

tha

29.2 Ethernet main features

The Ethernet (ETH) peripheral ประกอบด้วยคุณสมบัติดังต่อไปนี้, แสดงตามหมวดหมู่:

29.2.1 MAC core features

•    รองรับ 10/100 Mbit/s data transfer rates ด้วย external PHY interfaces
•    IEEE 802.3-compliant MII interface เพื่อสื่อสารกับ an external Fast Ethernet PHY
•    รองรับทั้ง full-duplex และ half-duplex operations
      –    รองรับ CSMA/CD Protocol สำหรับ half-duplex operation
      –    รองรับ IEEE 802.3x flow control สำหรับ full-duplex operation
      –    มีทางเลือกการส่งต่อของ received pause control frames ไปยัง the user application ใน full-duplex operation
      –    Back-pressure รองรับสำหรับ half-duplex operation
      –    การส่งโดยอัตโนมัติของ zero-quanta pause frame บนการยกเลิกถือสิทธิ์ของ flow control input ใน full-duplex
            operation
•    Preamble และ start-of-frame data (SFD) insertion ใน Transmit, และการลบออกใน Receive paths
•    Automatic CRC และ pad generation ควบคุมได้บน a per-frame basis
•    มีทางเลือกสำหรับ automatic pad/CRC ลอกออกบน receive frames
•    ความยาวเฟรมที่โปรแกรมได้เพื่อรองรับ Standard frames ด้วยขนาดสูงถึง 16 KB
•    Programmable interframe gap (40-96 bit times ในขั้นของ 8 )
•    รองรับได้หลากหลาย flexible address filtering modes:
      –    สูงถึง four 48-bit perfect (DA) address filters พร้อมการบังสำหรับแต่ละ byte
      –    สูงถึง three 48-bit SA address comparison check พร้อมการบังสำหรับแต่ละ byte
      –    64-bit Hash filter (ทางเลือก) สำหรับ multicast and unicast (DA) addresses
      –    ตัวเลือกเพื่อส่งผ่านทุก multicast addressed frames
      –    Promiscuous mode รองรับเพื่อส่งผ่านทุก frames โดยไม่มีการกรองใดๆสำหรับ network monitoring
      –    ส่งผ่านทุก incoming packets (ตามต่อ filter) พร้อมด้วย a status report
•    32-bit status แยกกันที่ส่งคืนสำหรับ transmission and reception packets
•    รองรับ IEEE 802.1Q VLAN tag detection สำหรับ reception frames
•    ที่แยกกัน transmission, reception, and control interfaces ให้กับ the Application
•    รองรับ mandatory network statistics ด้วย RMON/MIB counters (RFC2819/RFC2665)
•    MDIO interface สำหรับ PHY device configuration และ management
•    การตรวจพบของ LAN wakeup frames และ AMD Magic Packet™ frames
•    Receive feature สำหรับ checksum off-load สำหรับ received IPv4 และ TCP packets ที่ถูกห่อหุ้มโดย the Ethernet
      frame
•    Enhanced receive feature สำหรับการเช็ค IPv4 header checksum และ TCP, UDP, หรือ ICMP checksum ที่ถูกห่อหุ้มใน
      IPv4 or IPv6 datagrams

tha

•    รองรับ Ethernet frame time stamping ดังอธิบายใน IEEE 1588-2002. Sixty-four-bit time stamps ถูกให้ในแต่ละ
      frame's transmit or receive status
•    สองเซ็ตของ FIFOs: a 2-KB Transmit FIFO พร้อมด้วยความสามารถขอบเขตที่ตั้งโปรแกรมได้, และ a 2-KB Receive FIFO พร้อม
      ด้วยขอบเขตที่กำหนด่าได้ (ค่าเริ่มต้นคือ 64 bytes)
•    Receive Status vectors ถูกแทรกลงใน the Receive FIFO หลังจาก the EOF transfer เปิดการใช้งาน multiple-frame
      storage ใน the Receive FIFO โดยไม่มีความต้องการ FIFO อื่นเพื่อเก็บ frames' Receive Status เหล่านั้น
•    ทางเลือกเพื่อ filter ทุก error frames บน reception และไม่ส่งต่อพวกมันไปยัง the application ใน Store-and-Forward
      mode
•    ทางเลือกเพื่อส่งต่อ under-sized good frames
•    รองรับ statistics โดยการสร้าง pulses สำหรับ frames dropped หรือเสียหาย (เนื่องจาก overflow) ใน the Receive FIFO
•    รองรับ Store and Forward mechanism สำหรับ transmission ไปยัง the MAC core
•    การสร้างโดยอัตโนมัติของ PAUSE frame control หรือ back pressure signal ไปยัง the MAC core บนฐานของ Receive
      FIFO-fill (ขอบเขตที่กำหนดค่าได้) level
•    รับมือการส่งซ้ำโดยอัตโนมัติของ Collision frames สำหรับ transmission
•    ละทิ้ง frames บน late collision, excessive collisions, excessive deferral และ underrun conditions
•    Software control เพื่อล้าง Tx FIFO
•    คำนวณและใส่ IPv4 header checksum และ TCP, UDP, or ICMP checksum ใน frames ที่ถูกส่งใน Store-and-Forward
      mode
•    รองรับ internal loopback บน the MII สำหรับ debugging


tha

29.2.2 DMA features

•    รองรับทุก AHB burst types ใน the AHB Slave Interface
•    Software สามารถเลือกประเภทของ AHB burst (fixed หรือ indefinite burst) ใน the AHB Master interface
•    ทางเลือกเพื่อเลือก address-aligned bursts จาก AHB master port
•    ทำให้เหมาะที่สุดสำหรับ packet-oriented DMA transfers ด้วย frame delimiters
•    Byte-aligned addressing สำหรับ data buffer support
•    Dual-buffer (วงแหวน) หรือ linked-list (โซ่) descriptor chaining
•    Descriptor architecture, ยอมให้ large blocks of data transfer ด้วย minimum CPU intervention;
•    แต่ละ descriptor สามารถส่งถ่ายได้สูงถึง 8 KB of data
•    Comprehensive status reporting สำหรับ normal operation และ transfers with errors
•    Individual programmable burst size สำหรับ Transmit and Receive DMA Engines เพื่อทำให้เหมาะ host bus
      utilization
•    Programmable interrupt options สำหรับ different operational conditions
•    Per-frame Transmit/Receive complete interrupt control
•    Round-robin หรือ fixed-priority arbitration ระหว่าง Receive and Transmit engines
•    Start/Stop modes
•    Current Tx/Rx Buffer pointer เป็น status registers
•    Current Tx/Rx Descriptor pointer เป็น status registers

tha

29.2.3 PTP features

•    Received and transmitted frames time stamping
•    Coarse and fine correction methods
•    Trigger interrupt เมื่อ system time มาเป็นมากกว่า target time
•    Pulse ต่อ second output (product alternate function output)

tha

29.3 Ethernet pins

Table 209 แสดง the MAC signals และ the corresponding MII/RMII default(ค่าเริ่นต้น) หรือ remapped(เปลี่ยนขาใหม่) signals. มันยังแสดงให้เห็น the pins ที่ the signals เป็น input หรือ output, และ the pin configuration




tha

29.4 Ethernet functional description: SMI, MII and RMII

The Ethernet peripheral ประกอบด้วย a MAC 802.3 (media access control) พร้อมด้วย a dedicated DMA controller. มันรองรับทั้ง default media-independent interface (MII) และ reduced media-independent interface (RMII) ผานทาง one selection bit (อ้างอิงถึง AFIO_MAPR register).

The DMA controller อินเตอร์เฟสกับ the Core and memories ผ่านทาง the AHB Master and Slave interfaces. The AHB Master Interface ควบคุม data transfers ในขณะที่ the AHB Slave interface เข้าถึง Control and Status Registers (CSR) space.

The Transmit FIFO (Tx FIFO) บัฟเฟอร์ data ที่อ่านจาก system memory โดย the DMA ก่อน transmission โดย the MAC Core. ในทำนองเดียวกัน, the Receive FIFO (Rx FIFO) เก็บ the Ethernet frames ที่รับจาก the line จนกระทั่งพวกมันถูกส่งถ่ายไปยัง system memory โดย the DMA.

The Ethernet peripheral ยังมี an SMI เพื่อสื่อสารกับ external PHY. A set of configuration registers ยอมให้ผู้ใช้เลือก the desired mode และคุณลักษณะสำหรับ the MAC และ the DMA controller.

Note: The AHB clock frequency ต้องเป็นอย่างน้อย 25 MHz เมื่อ the Ethernet ถูกใช้.


tha

29.4.1 Station management interface: SMI

The station management interface (SMI) ยอมให้ the application เข้าถึง any PHY registers ผ่านทาง a 2-wire clock and data lines. The interface รองรับการเข้าถึงสูงถึง 32 PHYs.

The application สามารถเลือก one of the 32 PHYs และ one of the 32 registers ภายใน any PHY และส่ง control data หรือ receive status information. เพียง one register ใน one PHY สามารถถูกระบุตำแหน่งในเวลาใดก็ได้

ทั้ง the MDC clock line และ the MDIO data line ถูกจัดให้มีใช้เป็น alternate function I/O ใน the microcontroller:
•    MDC: a periodic clock ที่จัดให้มี the timing reference สำหรับ the data transfer ที่ความถี่สูงสุด 2.5 MHz. The
      minimum high และ low times สำหรับ MDC ต้องเป็น 160 ns แต่ละ , และ the minimum period สำหรับ MDC ต้องเป็น 400
      ns. ใน idle state the SMI management interface ขับ the MDC clock signal ต่ำ(low).
•    MDIO: data input/output bitstream เพื่อส่งถ่าย status information ไปยัง/จาก the PHY device ซิงโครไนส์กันกับ the
      MDC clock signal