ID_220L_Peksenar_Open_Source_Ethernet

Download Report

Transcript ID_220L_Peksenar_Open_Source_Ethernet

ID 220L: Hands-on Embedded Ethernet
Design with an Open Source
TCP/IP Stack
Renesas Electronics America Inc.
Fatih Peksenar
Senior Manager, Applications Engineering
12 October 2010
Version: 1.2
“© 2010 Renesas Electronics America Inc. All rights reserved
Mr. Fatih Peksenar
 Manager, Applications Engineering
 Responsible for Ethernet Application
development within the Renesas America
Applications Group.
 Developed various Ethernet Application
projects as examples and for customers.
– RX62N, SH7216, H8S2472 platforms
 PREVIOUS EXPERIENCE:
 Lead system designer for Allied Telesyn, ADC Telecom,
Nortel, where I implemented 10/100/1000 Ethernet.
 MSEE from the University of Minnesota
2
“© 2010 Renesas Electronics America
Inc. All rights reserved
Renesas Technology and Solution Portfolio
Microcontrollers
& Microprocessors
#1 Market share
worldwide *
ASIC, ASSP
& Memory
Advanced and
proven technologies
Solutions
for
Innovation
Analog and
Power Devices
#1 Market share
in low-voltage
MOSFET**
* MCU: 31% revenue
basis from Gartner
"Semiconductor
Applications Worldwide
Annual Market Share:
Database" 25
March 2010
** Power MOSFET: 17.1%
on unit basis from
Marketing Eye 2009
(17.1% on unit basis).
3
“© 2010 Renesas Electronics America
Inc. All rights reserved
Renesas Technology and Solution Portfolio
Microcontrollers
& Microprocessors
#1 Market share
worldwide *
Solutions
for
Innovation
ASIC, ASSP
& Memory
Advanced and
proven technologies
Analog and
Power Devices
#1 Market share
in low-voltage
MOSFET**
* MCU: 31% revenue
basis from Gartner
"Semiconductor
Applications Worldwide
Annual Market Share:
Database" 25
March 2010
** Power MOSFET: 17.1%
on unit basis from
Marketing Eye 2009
(17.1% on unit basis).
4
“© 2010 Renesas Electronics America
Inc. All rights reserved
Microcontroller and Microprocessor Line-up
Superscalar, MMU, Multimedia
High Performance CPU, Low Power
High Performance CPU, FPU, DSC
 Up to 1200 DMIPS, 45, 65 & 90nm process
 Video and audio processing on Linux
 Server, Industrial & Automotive
 Up to 500 DMIPS, 150 & 90nm process
 600uA/MHz, 1.5 uA standby
 Medical, Automotive & Industrial
 Up to 165 DMIPS, 90nm process
 500uA/MHz, 2.5 uA standby
 Ethernet, CAN, USB, Motor Control, TFT Display
 Legacy Cores
 Next-generation migration to RX
General Purpose
 Up to 10 DMIPS, 130nm process
 350 uA/MHz, 1uA standby
 Capacitive touch
5
“© 2010 Renesas Electronics America
Inc. All rights reserved
Ultra Low Power
Embedded Security
 Up to 25 DMIPS, 150nm process  Up to 25 DMIPS, 180, 90nm process
 190 uA/MHz, 0.3uA standby
 1mA/MHz, 100uA standby
 Application-specific integration  Crypto engine, Hardware security
Microcontroller and Microprocessor Line-up
 Up to 1200 DMIPS, 45, 65 & 90nm process
 Video and audio processing on Linux
 Server, Industrial & Automotive
Superscalar, MMU, Multimedia
 Up to 500 DMIPS, 150 & 90nm process
 600uA/MHz, 1.5 uA standby
 Medical, Automotive & Industrial
High Performance CPU, Low Power
 Up to 165 DMIPS, 90nm process
 500uA/MHz, 2.5 uA standby
 Ethernet, CAN, USB, Motor Control, TFT Display
High Performance CPU, FPU, DSC
RX
 Legacy Cores
 Next-generation migration to RX
Ethernet, CAN, USB, UART, SPI, IIC
General Purpose
 Up to 10 DMIPS, 130nm process
 350 uA/MHz, 1uA standby
 Capacitive touch
6
“© 2010 Renesas Electronics America
Inc. All rights reserved
Ultra Low Power
Embedded Security
 Up to 25 DMIPS, 150nm process  Up to 25 DMIPS, 180, 90nm process
 190 uA/MHz, 0.3uA standby
 1mA/MHz, 100uA standby
 Application-specific integration  Crypto engine, Hardware security
Innovation
Ethernet
Internet
Ethernet
Ethernet
7
“© 2010 Renesas Electronics America
Inc. All rights reserved
Ethernet
Our Ethernet Solution
Renesas provides you a complete set of FREE tools and low
cost MCUs with Ethernet peripheral. Embedded Ethernet
connectivity is very easy to achieve when you have Renesas as
a partner!
8
“© 2010 Renesas Electronics America
Inc. All rights reserved
Agenda
 OSI network layers and RX62N
 RX62N Ethernet peripherals
 uIP TCP/IP stack
 Freely available tools
 Lab Exercises
 Questions
 Feedback Form
9
“© 2010 Renesas Electronics America
Inc. All rights reserved
Key Takeaways
By the end of this session you will be able to:
 Identify the features of Renesas Ethernet peripherals
 Find out about freely available networking tools
 Understand pros an cons of uIP TCP/IP stack
 Get a functional sample project to take home with you
10
“© 2010 Renesas Electronics America
Inc. All rights reserved
OSI Networking Model
Layer
Data Unit
Function
7
Application
Data
Application Functions
File transfer, email, web page
FTP, SMTP, HTTP
6
Presentation
Data
Data Representation
Independence of local data formats
ASCII, MIDI, MPEG
5
Session
Data
Process-to-Process Communication
Process multiplexing
Socket session
establishment in TCP, SIP
4
Transport
Segment
End-to-End Communication
Error control, flow control, sequenced delivery
TCP, UDP
3
Network
Packet
Network Communication
Global addressing, routing, fragmentation and
reassembly
IPv4, IPv6, ICMP, ARP,
OSPF, BGP
2
Data Link
Frame
Direct Communication
Framing, link addressing error detection
802.3 Ethernet, ATM,
Token Ring, Frame Realy
1
Physical
Bit
Physical Channel Access
Line drivers/receivers, encoders/decoders, timing
RS-232, 10BASE-T,
100BASE-T
Ethernet
11
“© 2010 Renesas Electronics America
Inc. All rights reserved
Example
RX62N and OSI Network Model
Layer
Application
RDKRX62N
Open Source
uIP TCP/IP
Stack
Presentation
Session
Transport
Network
Data Link
Physical
National DP8364
IEEE 1588 PHY
12
“© 2010 Renesas Electronics America
Inc. All rights reserved
RX62N MAC &
Driver FW
Ethernet Controller
 Ethernet and IEEE 802.3 frames
 Type encapsulation
 Length encapsulation
 Automatic frame checksum
 10 and 100 Mbps operation
 Half and full duplex modes
 PAUSE MAC layer flow control (IEEE 802.3x)
 When in full duplex mode
 Wake-On-LAN (WOL) Magic Packet Detection
 MII and RMII PHY layer interface
Ethernet Frame
Bytes
13
Preamble
Destination
Address
Source
Address
Type/
Length
Data
FCS
8
6
6
2
46-1500
4
“© 2010 Renesas Electronics America
Inc. All rights reserved
Ethernet Direct Memory Access Controller
E-DMAC
 Directly connected to Ethernet Controller
 Transfer data between Ethernet Controller and memory
 Block transfers for efficient system bus utilization
 Support single frame and multi-buffer operation
 No need for large single buffers
 Multiple buffers can handle longer frames
 Totally automated
 Transmit and receive buffer management
 Driver provided as part of the lab
 Descriptors to define and control the buffers
14
“© 2010 Renesas Electronics America
Inc. All rights reserved
Ethernet Direct Memory Access Controller
E-DMAC
 Extensive information for buffer control
 On-chip or external buffers
 Circular buffers
 Automated operation
RECEIVE
DESCRIPTORS
TRANSMIT
DESCRIPTORS
status
bufsize
size
Char *buf_p
Discript *next
status
bufsize
size
Char *buf_p
Discript *next
status
bufsize
size
Char *buf_p
Discript *next
RX_BUFF
RX_BUFF
*
*
*
status
bufsize
size
Char *buf_p
Discript *next
15
“© 2010 Renesas Electronics America
Inc. All rights reserved
status
bufsize
size
Char *buf_p
Discript *next
TX_BUFF
TX_BUFF
*
*
*
RX_BUFF
status
bufsize
size
Char *buf_p
Discript *next
TX_BUFF
Ethernet Controller E-DMAC Working Together
E-DMAC
MAC
RX FIFO
TX DMAC
Internal Bus
RAM
RX
TX FIFO
RX BUFFER
RX BUFFER
TRANSMIT
DESCRIPTORS
CPU Memory Bus
RECEIVE
DESCRIPTORS
RX BUFFER
Ethernet
CPU
TX BUFFER
TX BUFFER
TX BUFFER
SH7216
16
“© 2010 Renesas Electronics America
Inc. All rights reserved
PHY
TX
TX Descriptor
Information
MII
RX DMAC
E-DMAC Interface
Memory Bus Interface
RX Descriptor
Information
Questions? True/False
 Ether Controller is responsible for moving Ethernet data
to/from system memory
 False. This is done by E-DMAC. Main responsibility of Ethernet
Controller is transmission and reception of Ethernet frames.
 E-DMAC can work with internal and external RAM
 True. There is no limitation on memory space for E-DMAC
operations.
 Ethernet Controller and E-DMAC function together to reduce
CPU load
 True. For example while Ethernet Controller is busy receiving
data, E-DMAC can move them to system RAM without loading
the CPU.
 Renesas Ethernet peripherals are almost the same across
the different families
 True. This allows code re-use and easy migration to other
Renesas Ethernet devices
17
“© 2010 Renesas Electronics America
Inc. All rights reserved
Features of uIP TCP/IP Stack
 Perfect solution for simple applications
 Small footprint
 Works on 8-bit to 32-bit MCUs
 Needs only a timer peripheral
 No RTOS required
 High-level applications supported
 ARP, IP, ICMP (ping), TCP, DHCP, Telnet, DNS
 Web server and client
 Supported by active community of developers
 Developed by Adam Dunkels at Swedish Institute of
Computer Science
 Free to use and distribute
18
“© 2010 Renesas Electronics America
Inc. All rights reserved
Things to Consider with uIP TCP/IP Stack
 Single TCP segment in flight
 Lower throughput with delayed ACK TCP receivers
 Fixes:
– Use uip-split module
– Disable delayed ACK at the receiver
 Single TCP and UDP application
 Only one TCP/UDP application supported
 Fixes:
– Add a multiplexer layer
– Service connections based on TCP/UDP ports
 Are these a problem?
 YOU DECIDE!
19
“© 2010 Renesas Electronics America
Inc. All rights reserved
Questions? True/False
 uIP works with 8-bit to 32-bit MCUs
 True. uIP TCP/IP stack scales from low to high end MCUs.
 uIP requires a DMA engine to run
 False. The only peripheral needed is a simple timer
 uIP comes with several application layer software
 True. DHCP, Web server and client are some of them
 uIP supports delayed ACK TCP segments
 False. Each TCP segment must be ACK’ed before another
transmitted.
20
“© 2010 Renesas Electronics America
Inc. All rights reserved
Freely Available Tools
 Wireshark
 De facto network protocol analyzer
 Extensive analysis of frames
 Freely available from
http://www.wireshark.org/
 Fping
 ICMP (ping) message tests the
connectivity to another device
 Fping builds on DOS ping utility
with more options
 Freely available from
http://www.kwakkelflap.com/fping.
html
21
“© 2010 Renesas Electronics America
Inc. All rights reserved
Lab Exercises
22
“© 2010 Renesas Electronics America
Inc. All rights reserved
General Notes on Lab Exercises
 Refer to lab handout
 There are questions in lab handout
 Answers to questions are at the end
 Total of 4 lab exercises
 About 15 minutes each
23
“© 2010 Renesas Electronics America
Inc. All rights reserved
Lab Exercises – You can start the lab now
24
“© 2010 Renesas Electronics America
Inc. All rights reserved
Innovation
You create the innovation. Renesas is here to help.
Let’s build it together!
25
“© 2010 Renesas Electronics America
Inc. All rights reserved
Questions?
26
“© 2010 Renesas Electronics America
Inc. All rights reserved
Thank You!
27
“© 2010 Renesas Electronics America
Inc. All rights reserved
Renesas Electronics America Inc.