LPC2300/LPC2400 TCP/IP OverviewTCP/IP and LPC2300/LPC2400 FamilyOctober 2007
Introduction to the LPC2300/LPC2400 Family Family is an important word in the title            – All blocks across the LPC...
Identical block memory mapsLPC2148 SSP Memory Map          LPC23XX SSP Memory MapSame functions, same address - LPC23XX/LP...
LPC2300/LPC2400Ethernet                                                            4                  ARM DEVCON 2007 Trai...
ApplicationWhat is a TCP/IP Stack?                          Layer                                                         ...
Basic Ethernet Frame All numbers are in Bytes PRE (preamble) - alternating 1’s/0’s SOF (Start of Frame) - alternating 1’s/...
What is the TCP/IP Stack Demo?                       Web                      Browser           HTTPPC Laptop             ...
TCP/IP API                  Embedded TCP/IP API will typically be a                            partial or complete version...
Source Code from NXP Semiconductors  TCP/IP Stack     NXP Sample Code    NIcheLite for LPC                                ...
Software from Interniche  Nichelite                                   NicheStack IPv4•Address Resolution Protocol (ARP)   ...
Software from Interniche   Options available for Nichelite & NicheStack IPv4      Device Management              • Utiliti...
NicheLite for LPCArchitectural Overview                                               TFTP                           App1 ...
NicheLite w/Add-onsArchitectural Overview                                               TFTP            SNMP             A...
NicheStackArchitectural Overview                                               TFTP            SNMP                App1   ...
RealView Microcontroller Development Kit  Third Party                  RealView Microcontroller                        Rea...
RealView Real-Time Library Extensive library of common ready-to-use components, speed software                            ...
Software from Keil   The TCP/IP Network Suite is a TCP/IP stack implemented   specifically for embedded applications.  App...
Real-Time Library Examples  C:KeilARMARTXExamples          Example Projects provide a basic configuration and             ...
Real-Time Library Examples  HTTP Server with CGI Interface   – Server provides authentication and allows multiple     sess...
Micrium Ethernet Products   µC/TCP-IP is a compact, reliable, high performance   TCP/IP protocol stack from the makers of ...
EasyWebTiny TCP/IP Stack and Web Server   This small TCP/IP stack and web server was published in the   extra issue ‘Embed...
EasyWebTiny TCP/IP Stack and Web ServerThis TCP/IP stack handles the ARP, ICMP, IP and TCP protocols. It is optimized  for...
uIP StackGPL Licensed Code  Mr. Adam Dunkels created the uIP stack and makes it  available under a BSD-Style License.   •A...
uIP StackGPL Licensed CodeSupports   Speed support 10 or 100 MB/s   Half-, full duplex or loopback mode   Receive fragment...
Recommended Reading Ethernet: The Definitive Guide (O’Reilly)  –   Chapter 1 (Evolution of Ethernet)  –   Chapter 2 (Ether...
26ARM DEVCON 2007 Training   February 12, 2009
Upcoming SlideShare
Loading in …5
×

ARM LPC2300/LPC2400 TCP/IP Stack Porting

1,394 views

Published on

LPC2300/LPC2400 TCP/IP & Porting with Stack

Published in: Automotive, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,394
On SlideShare
0
From Embeds
0
Number of Embeds
83
Actions
Shares
0
Downloads
16
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

ARM LPC2300/LPC2400 TCP/IP Stack Porting

  1. 1. LPC2300/LPC2400 TCP/IP OverviewTCP/IP and LPC2300/LPC2400 FamilyOctober 2007
  2. 2. Introduction to the LPC2300/LPC2400 Family Family is an important word in the title – All blocks across the LPC2000 family are similar – USB of the LPC2148 is the same as the device part of the LPC2300/LPC2400 – All SSPs are the same – All I2Cs are the same – Fast port implementation is the same available In develop. – These are just a few examples LPC24xx LPC23xx LPC24xx LPC23xx Functionality LPC2368 LPC2378 • Ethernet (MII+RMII) LPC24xx • USB FS Device • USB Host/OTG • Ethernet (RMII) LPC2366 • 2 x CAN • USB FS Device • Ext. Memory (SDRAM, SRAM) • 2 x CAN • 96K SRAM LPC2364 2 ARM DEVCON 2007 Training February 12, 2009
  3. 3. Identical block memory mapsLPC2148 SSP Memory Map LPC23XX SSP Memory MapSame functions, same address - LPC23XX/LPC24XX adds DMA 3 ARM DEVCON 2007 Training February 12, 2009
  4. 4. LPC2300/LPC2400Ethernet 4 ARM DEVCON 2007 Training February 12, 2009
  5. 5. ApplicationWhat is a TCP/IP Stack? Layer Transport Layer Application Application Network Header Data Layer TCP TCP Data Header Data Link IP IP Data Layer HeaderFrame Frame FrameHeader Data Trailer 5 ARM DEVCON 2007 Training February 12, 2009
  6. 6. Basic Ethernet Frame All numbers are in Bytes PRE (preamble) - alternating 1’s/0’s SOF (Start of Frame) - alternating 1’s/0’s but last two bits are “11” DA (Destination Address) – who gets it SA (Source Address) – who sent it [NOT SHOWN: optional VLAN header, 4 bytes] Length/Type – interpreted as length when <= 1518d or as type when > 1536d Data payload – minimum of 46, maximum of 1500 bytes FCS (Frame Check Sequence) – is the CRC of DA, SA, VLAN (if present), Length/Type, and Data payload 6 ARM DEVCON 2007 Training February 12, 2009
  7. 7. What is the TCP/IP Stack Demo? Web Browser HTTPPC Laptop Keil MCB2300 Board ServerApp Application Application AppTCP Network Network TCP Router/Hub/Switch IP Data Link Data Link Data Link IPFrame Transport Transport Transport Frame 7 ARM DEVCON 2007 Training February 12, 2009
  8. 8. TCP/IP API Embedded TCP/IP API will typically be a partial or complete version of the Berkeley Sockets API WebPC Laptop Browser Keil LPC2300 Board HTTP Server Client Server socket() socket() recv(), send() bind() close() listen() accept() recv(), send() close() 8 ARM DEVCON 2007 Training February 12, 2009
  9. 9. Source Code from NXP Semiconductors TCP/IP Stack NXP Sample Code NIcheLite for LPC •TFTP client and server •DHCP client Application •DNS client •Simple Web Server •Virtual File System •Command-line Transport TCP, mini-sockets API Network IP, ICMP, ARP, UDP Data Link (MAC) Ethernet Frame Ethernet Frame 9 ARM DEVCON 2007 Training February 12, 2009
  10. 10. Software from Interniche Nichelite NicheStack IPv4•Address Resolution Protocol (ARP) Feature rich TCP/IP adds:•Internet Protocol (IP) •Support for NAT Routing•Internet Control Message Protocol (ICMP) •Fragmentation and re-assembly•User Datagram Protocol (UDP) •IP Routing:•Transmission Control Protocol (TCP) Routes set via ICMP, SNMP, IGP, etc.•Dynamic Host Configuration Protocol •Loop back test driver(DHCP) Client •Optimized checksum routines•Bootstrap Protocol (BOOTP) •Multi Homed IP support•Trivial File Transfer Protocol (TFTP) •Support for Auto-IP Assignment•Domain Name Service (DNS) client•Simple Web Server Add•Virtual File System •BSD Sockets•Command-line •Telnet server •FTP server 10 ARM DEVCON 2007 Training February 12, 2009
  11. 11. Software from Interniche Options available for Nichelite & NicheStack IPv4 Device Management • Utilities (FTP,Telnet,FileSystem) • E-mail (SMTP, POP3) • Webserver (HTTP server, SSL) • Simple Network Management Protocol (SNMP) Gateway Protocols • Domain Name Server (DNS) • Network Address Translation Router (NAT) • Routing Information Protocol (RIP) • Dynamic Host Configuration Protocol (DHCP) Security • Internet Key Exchange (IKE) • IP Security (IPSec) , • Secure Socket Layer (SSL) • Cryptography (DES, AES, 3DES) 11 ARM DEVCON 2007 Training February 12, 2009
  12. 12. NicheLite for LPCArchitectural Overview TFTP App1 ... AppN Listener UDP TCP ARP, DHCP, DNS Services Memory Management RTOS Abstraction IP Buffer queues Receive queue Device Driver 12 ARM DEVCON 2007 Training February 12, 2009
  13. 13. NicheLite w/Add-onsArchitectural Overview TFTP SNMP App1 ... AppN Telnet FTP HTTP UDP TCP ARP, DHCP, DNS Services Memory Management RTOS Abstraction PPP IP Buffer queues Receive queue Device Driver 13 ARM DEVCON 2007 Training February 12, 2009
  14. 14. NicheStackArchitectural Overview TFTP SNMP App1 ... AppN Telnet FTP HTTP SSL UDP Raw TCP ARP, DHCP, DNS Services Memory Management RTOS Abstraction PPP IP (v4/v6) NAT IP Filtering Buffer queues Receive queue Device Driver 14 ARM DEVCON 2007 Training February 12, 2009
  15. 15. RealView Microcontroller Development Kit Third Party RealView Microcontroller RealView Real-Time Utilities Development Kit LibrarySoftware VersionSoftware Version µVision Editor µVision Editor Control System Control System Project Management & Make Utility Project Management & Make Utility RTX Real-Time Kernel RTX Real-Time Kernel PC-LINT PC-LINT RealView C/C++ RealView RealView C/C++ RealView TCP/IP Network Suiteintensive syntax check intensive syntax check Compiler Macro Assembler TCP/IP Network Suite with MISRA support with MISRA support Compiler Macro Assembler TCP, UDP, PPP, and SLIP Interface TCP, UDP, PPP, and SLIP Interface HTTP Server with CGI Scripting HTTP Server with CGI Scripting Telnet Server, TFTP Server I-Logix Rhapsody I-Logix Rhapsody Libraries Libraries Telnet Server, TFTP Server SMTP Client, DNS Resolver SMTP Client, DNS Resolver UML 2.0 UML 2.0 GUI Library GUI Library RealView Linker RealView Linker Flash File System Flash File Systemwith Display Simulationwith Display Simulation CAN Connector CAN Connector µVision Debugger µVision Debugger USB Device Interface USB Device Interface for Device Simulation for Device SimulationMATLAB/SimulinkMATLAB/Simulink CPU & Peripheral CPU & Peripheral Keil ULINK Keil ULINK CAN Interface CAN Interface Simulation Interface Simulation Interface Simulation Simulation JTAG Adapter JTAG Adapter 15 ARM DEVCON 2007 Training February 12, 2009
  16. 16. RealView Real-Time Library Extensive library of common ready-to-use components, speed software development.RealView Real-Time Library Meets Embedded Developers needs – Solves Common Embedded Challenges RTX Real-Time Kernel RTX Real-Time Kernel • Real-Time Systems • Embedded Communication TCP/IP Network Suite TCP/IP Network Suite – Designed for use with MCU DevicesTCP, UDP, PPP, and SLIP InterfaceTCP, UDP, PPP, and SLIP Interface HTTP Server with CGI Scripting HTTP Server with CGI Scripting – High level of Re-use Telnet Server, TFTP Server Telnet Server, TFTP Server Examples Examples SMTP Client, DNS Resolver SMTP Client, DNS Resolver Extensive Range of Application Examples – As with all Keil tools. Flash File System Flash File System – Can be used as building blocks. USB Device Interface Royalty Free USB Device Interface – RTX (Object) included in RealView MDK. CAN Interface CAN Interface 16 ARM DEVCON 2007 Training February 12, 2009
  17. 17. Software from Keil The TCP/IP Network Suite is a TCP/IP stack implemented specifically for embedded applications. Application Layer •DNS •TFTP & Telnet •SMTP Client •Embedded Web server with CGI and password protection. Transport Layer •TCP and UDP sockets Data Link Layer •Ethernet, PPP and SLIP interfaces KeilTM includes the TCP/IP stack in their RT-Library 17 ARM DEVCON 2007 Training February 12, 2009
  18. 18. Real-Time Library Examples C:KeilARMARTXExamples Example Projects provide a basic configuration and help you to get running quickly. All examples run on Evaluation Boards.RTOS Kernel Examples Artx_ex1 Use basic RTOS kernel features: timeouts & signals. Artx_ex2 Show task priorities and signal passing. Mailbox Using the Mailbox and Memory Allocation functions. Traffic Complete Traffic Light Controller with serial communication.TCP/IP Networking Examples easyWeb Simple Web interface Http_demo HTTP Server with Password Protection and CGI Scripting. Telnet_demo Telnet Server shows a simple IP based command line interface. DNS_demo Using the DNS resolver that connects to host names. LEDSwitch Controlling with TCP/IP, UCP via Ethernet, SLIP or PPP Link. SMTP_demo Shows sending of a dynamic message to an email address. 18 ARM DEVCON 2007 Training February 12, 2009
  19. 19. Real-Time Library Examples HTTP Server with CGI Interface – Server provides authentication and allows multiple sessions – A CGI interface allows interaction with MCU hardware. 19 ARM DEVCON 2007 Training February 12, 2009
  20. 20. Micrium Ethernet Products µC/TCP-IP is a compact, reliable, high performance TCP/IP protocol stack from the makers of uCOS. • Built from the ground up with Micriums renowned quality • Highly scalable and reliable, • Rapid configuration • Full Berkeley 4.4 socket layer interface • TFTPs , FTPc, FTPs • HTTPs, SNTPc • POP3c, SMTPc • DHCPc, DNSc • TELNETcs Q4-2007 • PPPc Q4-2007 20 ARM DEVCON 2007 Training February 12, 2009
  21. 21. EasyWebTiny TCP/IP Stack and Web Server This small TCP/IP stack and web server was published in the extra issue ‘Embedded Internet’ of the magazine Design & Elektronik. For a complete German description of this software the extra issue can be ordered at www.elektroniknet.de/extraheft. Original port to MCB2300 for ARM Compiler (Keil) available as part of Keil ARM software distribution. Port to GNU available on yahoo groups site: – http://tech.groups.yahoo.com/group/lpc2000/ 21 ARM DEVCON 2007 Training February 12, 2009
  22. 22. EasyWebTiny TCP/IP Stack and Web ServerThis TCP/IP stack handles the ARP, ICMP, IP and TCP protocols. It is optimized for low resource consumption, not for performance. Because of the low resource consumption, the TCP/IP stack has some restrictions: Only one active TCP session at the same time No reassembling of fragmented incoming IP frames No buffering of TCP segments that are received in wrong order No checksum verification of received data no support for ‘type of service (TOS)’ and security options received TCP options are ignored 22 ARM DEVCON 2007 Training February 12, 2009
  23. 23. uIP StackGPL Licensed Code Mr. Adam Dunkels created the uIP stack and makes it available under a BSD-Style License. •ARP-protocol implemented in the higher layer as provided in the original UiP software. •Other high layer protocol functions can be added to this basic software. •The main routine uses polling making it easy to call the routines by a real-time OS. port available here: • http://www.freertos.org/portlpc2368uIP.html (rowley) 23 ARM DEVCON 2007 Training February 12, 2009
  24. 24. uIP StackGPL Licensed CodeSupports Speed support 10 or 100 MB/s Half-, full duplex or loopback mode Receive fragmentation of frames Supports MII or RMII interface Flexible receive and transmit buffer configuration to adapt to frame formats required by application Different receive filter capabilities to reduce the amount of packet processing Uses DMA engine in the Ethernet controller Interrupt drivenCurrently not supported: Imperfect hash filtering Transmit flow control Transmit fragmentation of frames Wake-up on LAN (WoL) 24 ARM DEVCON 2007 Training February 12, 2009
  25. 25. Recommended Reading Ethernet: The Definitive Guide (O’Reilly) – Chapter 1 (Evolution of Ethernet) – Chapter 2 (Ethernet System operation) – Chapter 3 (MAC Protocol, half-duplex) – Chapter 4 (full-duplex) – Chapter 5 (Auto-negotiation) – Chapter 6 (Media, MII signal definition) – Chapter 7 (10BASE-T) – Chapter 9 (100BASE-TX) RMII Specification – www.national.com/appinfo/networks/files/rmii_1_2.pdf 25 ARM DEVCON 2007 Training February 12, 2009
  26. 26. 26ARM DEVCON 2007 Training February 12, 2009

×