100% found this document useful (3 votes)
819 views25 pages

STM32F107 Ethernet Introduction

The document discusses STM32 connectivity solutions featuring Ethernet and TCP/IP. It describes the STM32F107 chip which supports Ethernet communication through an integrated MAC block that connects to PHY chips via MII or RMII interfaces. It also introduces the Nichelite TCP/IP stack from Interniche which provides protocols and demo applications to help developers implement Ethernet-enabled projects using the STM32F107. Example applications presented include a custom protocol over TCP, firmware upgrading via TFTP, and using DHCP, DNS, and other protocols.

Uploaded by

kit2
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
819 views25 pages

STM32F107 Ethernet Introduction

The document discusses STM32 connectivity solutions featuring Ethernet and TCP/IP. It describes the STM32F107 chip which supports Ethernet communication through an integrated MAC block that connects to PHY chips via MII or RMII interfaces. It also introduces the Nichelite TCP/IP stack from Interniche which provides protocols and demo applications to help developers implement Ethernet-enabled projects using the STM32F107. Example applications presented include a custom protocol over TCP, firmware upgrading via TFTP, and using DHCP, DNS, and other protocols.

Uploaded by

kit2
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

STM32 Connectivity Line

Ethernet & TCP/IP introduction


2009STM32

Content STM32F107 Ethernet Generic information about TCP-IP Nichelite TCP-IP Stack Application Examples

STM32 14-25/09/2009

The STM32F107 MAC block diagram


Configurable and flexible MAC 802.3 Support two industry standard interfaces for the PHY
Media Independent Interface (MII) Reduced Media Independent Interface (RMII)

Integrated DMA controller Hardware support of IEEE 1588 Ethernet wakeup event
Ethernet
DMA FIFO FIFO TX RX

IEEE 1588 MAC 802.3


MII / RMII MDC / MDIO

STM32F107
STM32 14-25/09/2009
3

AHB Bus

PHY

Wake up event

Precision Time Protocol (IEEE1588) : What is it It is a protocol designed to synchronize real-time clocks of the devices of a network Synchronization is done with the most accurate clock found in a packet-based network: called the Grand Master Clock. Accuracy is Sub-second
Detailed PTP description

09:10 09:00

09:01 09:00

09:00 Grand Master Clock 09:00

09:05 09:00

09:30 09:00

STM32 14-25/09/2009

Content STM32F107 Ethernet Generic information about TCP-IP Nichelite TCP-IP Stack Application Examples

STM32 14-25/09/2009

Generic information about TCP-IP

SMTP
BOOTP

FTP

?
HTTP
TFTP
?

POP3

DHCP
SNMP

IP
?

?
?

PPP

DNS

ICMP
?

ARP

TCP

Telnet

UDP ?
6

STM32 14-25/09/2009

TCP-IP : A layered protocol stack Application The main interface for the user. Higher level protocols Layer Transport End-to-end connections (UDP and TCP) Ensure reliability (TCP) Layer Internet Layer Data link Layer
Intra & Inter-Network communication no guaranty of delivery Intra-Network communication Transport data on the physical support
STM32 14-25/09/2009
7

TCP-IP : Encapsulation
TFTP UDP

User

Data

m su k ec Ch

User Data TFTP Header UDP Header TFTP Header TFTP Header TFTP Header User Data User Data User Data User Data Ethernet Trailer
8

b Port N

Ch

u ks c e

IP

ress IP Add

m su k ec h C

ET H ER N ET

dress d A C MA

IP Header Ethernet Header IP Header

UDP Header UDP Header

STM32 14-25/09/2009

TCP-IP : Key Protocols


um

ks ec h C

ddre M AC A

IP
E

et thern ss

IP I want to send data to 127.127.127.127


UDP I want to send a datagram on the port #

Transport Layer

TCP

UDP

su ck e h

UDP
m

IP

dress IP Ad

Internet Layer

su ck e h

TCP
m

IP

dress IP ad

I want to TCP send data in a reliable way on the port #

IP

Datalink Layer
Ethernet STM32F107 PHY

Click on the letter to get a detailed description


STM32 14-25/09/2009

TCP-IP : Key Protocols


Transport Layer
su ck e h

.FF .FF.FF F F . F FF.F

ARP
m

net Ether

ARP Who knows 127.127.127.127s MAC address?

TCP

UDP

ICMP s dd r e s
C su ck he m

IP

IP A

ICMP I send or receive queries or error messages

Internet Layer PING ICMP 127.127.127.127

IP

ARP Click on the letter to get a detailed T H ER E m Datalink Layer NET su description k ec
Ch

Addre C A M ??

s s ??

Ethernet

STM32F107 PHY

STM32 14-25/09/2009

10

TCP-IP : Key Application layer protocols


Application Layer

DHCP/ 7/68 6 s t r Po BOOTP


C su ck he m su ck e h

UDP

I want to get an DHCP IP address ?

BOOTP

DNS
Transport Layer

BOOTP DHCP UDP

DNS 3 P o rt 5
m

TCP) UDP (

What is DNS the IP address of www.st.com ?

TCP
Internet Layer

ICMP
Click on the letter to get a detailed description

IP

ARP
Ethernet

Datalink Layer

STM32F107 PHY
11

STM32 14-25/09/2009

Application layer protocols


World Wide Web
su ck he m

Email

HTTP 0 P o rt 8
C su ck e h m

TCP

I want HTTP this resource.

SMTP 5 P o rt 2
m

TCP

I want to SMTP send an email

Login : _

Terminal connection
m

POP3 10 Port 1
C su ck e h

TCP

I want to POP3 get my emails.

Telnet rt 2 3
su ck e h

TCP

Po

I want Telnet a terminal connection.


C su ck e h m

Files Transfer

Network Management
C su ck e h

TFTP 9 P o rt 6
C su ck e h

UDP

I want to TFTP transfer files. I want to FTP transfer files

Por

SNMP

I want to SNMP manage /162 my network. ts 161


m

UDP

Port

FTP 21 s 20/
m

TCP

STM32 14-25/09/2009

12

Application layer protocols


World Wide Web File Transfer
email Other Domain Names

Application Layer
Configuration

SMTP

POP3

Telnet

DNS (c)

WWW

File Transfer

Network mgt

BOOTP DHCP (c)

HTTP

FTP

TFTP

SNMP

Email

TCP

UDP

Transport Layer Internet Layer Datalink Layer

Login : _

Terminal connection Network Management

ICMP ARP Ethernet

IP

STM32F107 PHY

STM32 14-25/09/2009

13

Content STM32F107 Ethernet Generic information about TCP-IP Nichelite TCP-IP Stack Application Examples

STM32 14-25/09/2009

14

NicheLite from Interniche Free Package from ST Source code available


Webserver Demo Domain Names Configuration

HTTP demo
TCP / UDP demo

DNS (c)

DHCP (c) BOOTP


File Transfer

TCP client / server demo

UDP client / server demo TCP ICMP

TFTP UDP IP

Included Optional Demos


Other solutions

Others
Nichetool

ARP Ethernet

STM32F107 PHY
15

STM32 14-25/09/2009

NicheLite from Interniche Free Package from ST Source code available


Domain Names

See Application Note DNS (c) DHCP (c) HTTP demo AN3000 on our website BOOTP UDP client / TCP client / for a detailed description server demo server demo TFTP of the Package
Webserver Demo TCP / UDP demo File Transfer

Configuration

TCP ICMP www.st.com/stm32 Included

UDP IP

Optional Demos
Other solutions

Others
Nichetool

ARP

Ethernet

STM32F107 PHY
16

STM32 14-25/09/2009

Content STM32F107 Ethernet Generic information about TCP-IP Nichelite TCP-IP Stack Application Examples

STM32 14-25/09/2009

17

Example 1 : User defined protocol over TCP-IP Hardware Requirements Use a MII PHY already qualified by customer Minimize the BOM cost Software Requirements The customer has its own protocol Data is similar a stream of bytes :
Lost packets need to be resent Packets need to be ordered
Us er de fin M ed P y

su ck e h

TCP

Lost data / data reordering is not handled by the protocol

STM32 14-25/09/2009

ro ow to n co l
18

Example 1 : Ethernet Block Diagram


ple m a x eE r a w 15 pins MII Hard MII+MDC ions t = 17 pins a r u fi g n o el l c r w e s h a t 2 pins MDC/MDIO O sed u e b can
XT1 STM32F107
25MHz 25MHz

Ethernet MAC 10/100


XTAL 25MHz

OSC

PLL

HCLK

PHY

One 25Mhz external crystal (internal oscillator) MII interface


15 pins for the communication between the MAC & PHY 2 pins for the MDC / MDIO (to access PHY registers)
STM32 14-25/09/2009
19

Example 1 : user defined protocol over TCP-IP

Domain Names

Configuration

TCP client / server Application

DNS (c)

DHCP (c)

TCP

UDP

IP ARP ARP
Ethernet

ICMP

STM32F107 PHY
STM32 14-25/09/2009

Included Based on demos

20

Example 2 : Firmware upgrade


Hardware Requirements Use RMII to optimize the GPIO usage Reduce the BOM cost Software Requirements Need a commercial solution Need a cost effective solution Need the source code Using a simple protocol Reliable protocol

I want to TFTP transfer files.

TFTP 69
C su ck e h m

UDP

P o rt

Included
STM32 14-25/09/2009
21

Example 2 :Ethernet Block Diagram RMII interface ( RMII + MDC/MDIO = 9 pins) One 25Mhz external crystal les p m a Or one 50Mhz external oscillator x a re E
H a rd w
Ethernet MAC 10/100

ions t a r u fi g n RMII well o 7 pins c MII r e h Ot d as e +MDC s u be n a c = 9 pins MDC/MDIO


RMII_REF_CLK

RMII + XTAL 25MHz

HCLK OSC

50MHz

PHY XT1/XT2 50MHz

PLLs
PHY_CLK

RMII + OSC 50MHz

PLL

50MHz
HCLK

RMII_REF_CLK

PHY XT1
50MHz 22

PHY_CLK

STM32 14-25/09/2009

Example 2 : Firmware upgrade

File Transfer

Domain Names

Configuration

TFTP Upgrade Application

TFTP

DNS (c)

DHCP (c)

TCP

UDP

IP ARP

ICMP

STM32F107 PHY
STM32 14-25/09/2009

Included Demo under development

Ethernet

23

Summary
The STM32F107 is a product with advanced features IEEE1588 support MAC IP designed for performances The STM32F107 is a flexible product : RMII and MII connection available on all the packages The customer can use his prefered PHY Minimum external HW required ST offers a effective Hardware & Software solution NicheLite stack available for download with the Key Protocols and demo to start quickly Source code of the stack provided www.st.com/stm32
STM32 14-25/09/2009
24

Thank You

STM32 14-25/09/2009

25

You might also like