当前位置:首页 >> 信息与通信 >>

STM32F107的以太网应用


STM32 Connectivity Line
Ethernet & TCP/IP introduction
2009年STM32 全国研讨会

北京、深圳、上海、台北、 青岛、重庆、南京、哈尔滨、 武汉、福州、西安

Content STM32F107 Ethernet Generic information

about TCP-IP Nichelite TCP-IP Stack Application Examples

STM32 全国研讨会 14-25/09/2009

2

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:00 09:10

09:00 09:01

09:00 Grand Master Clock 09:00

09:00 09:05

09:00 09:30

STM32 全国研讨会 14-25/09/2009

4

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

STM32 全国研讨会 14-25/09/2009

5

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

um ks 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

su ck e

m

IP

ress IP Add

um ks c he C

ET H ER N ET

ress C Add MA

IP Header Ethernet Header IP Header

UDP Header UDP Header

STM32 全国研讨会 14-25/09/2009

TCP-IP : Key Protocols
um

s ck he 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

C

u ks ec h

UDP
m

IP

dress IP Ad

Internet Layer

C

u ks ec 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

9

TCP-IP : Key Protocols
Transport Layer
u ks ec h

C

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

ARP
m

net Ether

ARP Who knows 127.127.127.127’s 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 ET H ER m Layer Datalink su N ET description ck e
Ch

ddre MAC A ??

s s ??

Ethernet

STM32F107 PHY

STM32 全国研讨会 14-25/09/2009

10

TCP-IP : Key Application layer protocols
Application Layer

DHCP/ /68 rts 67 Po BOOTP
C su ck he m u ks ec h

UDP

I want to get an DHCP IP address ?

BOOTP

DNS
Transport Layer

BOOTP DHCP UDP

C

DNS3 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 u ks ec h m

TCP

I want HTTP this resource.

C

SMTP 5 P o rt 2
m

TCP

I want to SMTP send an email

Login : _

Terminal connection
m

POP3 10 Port 1
C u ks ec h

TCP

I want to POP3 get my emails.

C

Telnet rt 2 3
u ks ec h

TCP

Po

I want Telnet a terminal connection.
C u ks ec h m

Files Transfer

Network Management
C u ks ec h

TFTP 9 P o rt 6
C u ks ec 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 1 2 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 TCP description for a detailedclient / serverclient / 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

C

u ks ec h

m

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
le xamp E w a re 15 pins MII Hard MII+MDC s = ration u 17 pins ll co f i g rpinsn d as we MDC/MDIO he Ot 2 e be u s 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 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.

TFTP9 6
C u ks ec 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 s ample ? Or one 50Mhz external oscillator x a re E
H a rd w
Ethernet MAC 10/100

ns uratio ll fi c pins g as MII r 7 on RMII we Othe d e+MDC be us = 9 pins ca MDC/MDIO n
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 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


相关文章:
基于STM32F107的智能窗帘控制系统设计
【关键词】STM32F107;光线传感器;以太网;智能窗帘 1.引言 随着物联网的发展,...STM32 系列基于专为要求高性能、低成 本、低功耗的嵌入式应用专门设计的 ARM ...
LwIP协议栈开发嵌入式网络的三种方法分析
LwIP协议栈开发嵌入式网络的三种方法分析_计算机软件及应用_IT/计算机_专业资料。...STM32F107 以太网模块 MII_MDIO MII_RXD1 MII_RXD0 MII_RX_DV/ RMII_CRS...
这段时间在STM32F107调试lwIP心得
这段时间在 STM32F107 调试 lwIP 心得 开发板:STM3210C-EVAL(STM 原厂开发板,用起来确实很爽) 因为公司有项目,要做一个以太网的通讯模块,所以这段时间就...
stm32芯片简介
(PTP)的以太网接口, 用硬件实现这个协 议可降低 CPU 开销,提高实时应用和联网...产品的功能: STM32 互连型系列产品分为两个型号: STM32F105 和 STM32F107...
基于uCOS_II的以太网移植实例
1.1 硬件平台硬件平台是主芯片为 STM32F107VC 的金牛开发板,开发板上已集成...Api 文件夹中包含了以太网协议栈 的应用接口文件;core 文件夹中包含了以太网...
STM32单片机硬件关键基础精华及注意事项_图文
(PTP)的以太网接口,用硬件实现这个协议可降低 CPU 开销,提高 实时应用和联网...产品的功能: STM32 互连型系列产品分为两个型号:STM32F105 和 STM32F107。...
家庭智能系统开发终稿
(5)使学生掌握 RS485 总线设计、多机通信、以太网远程控制等技术的应用。 ...窗帘以及其他电气设备的控制,设计实现一个基于 STM32f107 互 联型微控制器为...
基于STM32的矿用UPS智能监控系统设计与实现
基于 ARM STM32F107VCT6 微处理器,实现 了在无...并设计了以太网,485 串口,CAN 总线等多 种接口与...本文应用 STM32 控制器设计并实现了 UPS 电源 的...
STM32F105xx 107xx DS_CH_V6
STM32F105xx 107xx DS_CH_V6_计算机软件及应用_IT/计算机_专业资料。数据手册...(K字节) 封装形式 以太网 通用 定时器 高级 基本 SPI/(I S) IC 通信 ...
stm32
(PTP)的以太网接口,用硬件 实现这个协议可降低 CPU 开销,提高实时应用和联网...STM32F105 具有 USB OTG 和 CAN2.0B 接口。STM32F107 在 USB OTG 和 CAN...
更多相关标签: