111 real-time library tcpnet networking suite flash file system usb and can interfaces rtx real-time...

44
1 1 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

Upload: roy-lloyd

Post on 24-Dec-2015

225 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

111

Real-Time LibraryTCPnet Networking Suite

Flash File SystemUSB and CAN InterfacesRTX Real-Time Kernel

Page 2: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

222

Presentation Agenda Overview and Introduction

Embedded Connectivity Challenges

Components of the Real-Time Library

TCPnet Networking Suite Protocols, Applications and TCP/IP Components

Networking examples

Flash File System Structure and SD Memory Card example

USB Device Interface Device Driver Classes and HID example

CAN Interface CAN example

RTX Real-Time Kernel RTOS Concepts and examples

Page 3: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

333

Embedded Connectivity Challenges Serial Interfaces

Best choice, wide support, easy implementation

CAN & USB Supported

Multiple Devices, Multiple Interfaces Need support for numerous standards

Need easy, high speed, PC style communication

Multi-Point Access Different parts of system need device access

Devices need to be system wide resource

Web and Remote Communication Access to web-based resources

Remote information transfer

Internet

Page 4: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

444

Peripherals I/O Pins, Timers, PWM A/D and D/A converters UART, SPI, I2C Complex communication

Peripherals (CAN, USB, Ethernet)

Wide range of MCU Cores 8/16/32 Bit On-chip Memory Interrupt System

Customers expect supportfor specific Microcontrollers. Block Diagram of STR9x

Today’s Microcontroller Selection

JTAG Debug and Embedded Trace Macrocell

CAN Interface (2.0B)

Dual Burst Flash

512KB Main

32KB 2nd level

Power management, RTC, reset and watchdog, internal oscillator and PLL

80 GPIO Pins

96KB SRAM, optional battery back-up

16-bit standard Timers including PWM

10/100 Ethernet MAC with DMA and MII

USB Full-speed Slave9 Programmable DMA

Channels

96MHz ARM966-EJS

3-Phase Induction Motor Controller (IMC)

Three 16550-style UART’s

Two fast I2C, 400KHzTwo channels for SPI, SSI

or Microwire

10-bit A/D converter (eight channels)

Real-Time Clock

Page 5: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

555

Peripherals I/O Pins, Timers, PWM A/D and D/A converters UART, SPI, I2C Complex communication

peripherals (CAN, USB, Ethernet)

Wide range of MCU Cores 8/16/32 Bit On-chip Memory Interrupt System

Customers expect supportfor specific Microcontrollers. Block Diagram of LPC2378

JTAG Debug and Embedded Trace Macrocell

2 CAN Channels

512KB On-chip Flash

Power management, RTC, reset and watchdog, internal oscillator and PLL

104 GPIO Pins

32KB SRAM, 2KB Battery back-up RAM

16-bit standard Timers including PWM

10/100 Ethernet MAC with DMA & 16KB Static RAM

USB 2.0 Interface with 8KB Static RAM

2 Programmable DMA Channels

72MHz ARM7TDMI-S

SD/MMC Memory Card I/F

10-bit D/A converter

Three I2C InterfacesTwo channels for SPI or

SSP

10-bit A/D converter (eight channels)

Four 16550-style UART’s

Today’s Microcontroller Selection

Page 6: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

666

RealView Real-Time Library

Meets Embedded Developers needs Solves common embedded challenges

Real-Time systems Embedded communication & networking

Designed for use with MCU devices

Extensive Range of Examples Easy to begin working. Can be used as building blocks.

Royalty Free Includes RTX source code. License – single user, multi project

Extensive library of common ready-to-use middleware components, speed software development.

RealViewRealView

RTX Source Code

TCP/IP Suite

Flash File System

USB Device Interface

CAN Interface

Exa

mp

les

and

Tem

pla

tes

Real-Time Library

Page 7: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

777

RL-TCPnetTCP/IP Networking Suite

Page 8: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

888

Ground-up design for embedded applications, maximum performance, minimum memory requirement and easy to use.

TCPnet Networking Suite

Debugging Multiple debug levels:

Errors only Complete status information

Status information on UART interface

Socket Interface TCP/IP UDP

Physical Interfaces Ethernet PPP (serial connection) SLIP (dial-up)

Standard Applications HTTP Web Server with CGI

Scripting Telnet and TFTP Server SMTP Client DNS Resolver

Page 9: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

999

Flexible TCP/IP Communication Layer

TCPnet may be used with or without the RTX Kernel, fully integrated with µVision for easy configuration and debug

Page 10: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

101010

Scalable TCP/IP Connectivity

Crossover Patch-Cable

Direct PC connection Easily replaces point-point

serial connection High Speed ~100Mbps

Page 11: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

111111

Scalable TCP/IP Connectivity

LAN

Ethernet Switch

Simple Network More flexible system Easily expanded

Page 12: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

121212

Scalable TCP/IP Connectivity

LAN

Ethernet Switch

Complex Network Multiple devices and interfaces Easy data sharing Flexible configuration

Page 13: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

131313

Scalable TCP/IP Connectivity

LAN

Router

Internet

Internet Connectivity TCPnet provides easy solution

to connect to the world

Page 14: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

141414

Serial TCP/IP Connectivity

Modem

RS232

PPP/SLIP

Telephone Line

Internet

Classic Serial Modem Interface TCPnet provides serial interface

support for PPP/SLIP

Page 15: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

151515

Flexible TCP/IP Connectivity

Telephone Line

Internet

Cellular / Wireless Interface Extended to wireless world

GPRS/GSM

Modem

RS232

PPP/SLIP

RS232

PPP/SLIP

Page 16: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

161616

RL-ARM ExamplesExamples and Templates

Page 17: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

171717

Example Projects show a complete configuration and help you to get started quickly. All examples are ready to 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

TCPnet Networking Examples (run on Atmel, NXP and ST Evaluation Boards)

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

..\Examples

..\Boards

RTX & TCPnet Examples

Page 18: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

181818

HTTP Server with CGI Interface Server provides authentication and allows multiple sessions A CGI interface allows interaction with MCU hardware

RTX & TCPnet Examples

Page 19: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

191919

LED Switch LED’s can be controlled via PC or other eval board Uses TCP and UDP

TCPnet Examples

LAN

Ethernet Switch

PC running LED Switch Client

Evaluation Boards with LED Switch Client

LEDSwitch Utility(complete source code in

\Keil\ARM\Utilities\LEDSwitch)

Page 20: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

202020

TCPnet Examples: Memory Footprint

Demo Example Total ROM Size Total RAM Size

HTTP Server (without RTX Kernel) 41,984 Bytes 20,112 Bytes

HTTP Server (with RTX Kernel) 45,240 Bytes 21,776 Bytes

Telnet Server 22,312 Bytes 20,112 Bytes

TFTP Server 34,996 Bytes 24,320 Bytes

SMTP Client 16,736 Bytes 19,600 Bytes

LED Switch Server 11,220 Bytes 19,568 Bytes

LED Switch Client 15,328 Bytes 19,576 Bytes

DNS Resolver 15,328 Bytes 19,776 Bytes

HTTP Server: Web Server supporting dynamic Web pages and CGI Scripting Telnet Server: with command line interface, authorization etc TFTP Server: for uploading files (for example Web pages to a Web Server) SMTP Client: for sending automated emails LED Switch Server and Client: shows basic TCP/IP and UDP communication DNS Resolver: used to resolve IP address from the Host name

Page 21: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

212121

RL-FlashFlash File System

Page 22: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

222222

Flash File System (RL-Flash)

RL-ARM includes a Flash File System that allows to create, save, read and modify files on ROM, RAM, classic Flash ROM, and Memory Cards

Classic C File I/O Functions interface to RAM or ROM images Standard Flash ROM SD or MMC Memory Cards

Standard Flash ROM Configurable algorithm similar to

ULINK2 Flash Programming

Lightweight interface with smallhardware requirements

SD / MMC Memory Cards

via proven SPI or MMC interface available in many ARM based Microcontrollers

Format Function and Time Stamps (only interface to RTC needed)

using FAT12 or FAT16 Flash File System (8.3 Filename conventions)

Flash File System

Flash DriverFile Table FAT12/16

Flash ROMRAM SD/MMC

Standard C File I/O Functions

ROM

Page 23: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

232323

SD Memory Card File I/O with SD Memory Card Simple Command Interface Targets for UART or

Real-Time Agent

RL-Flash Examples

SD Card

Page 24: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

242424

RL-USBUSB Device Interface

Page 25: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

252525

USB Device Interface (RL-USB)

RL-ARM includes Device Interfaces for common USB device classeswhich have default support in Windows 2000/XP/Vista (no driver hassle).

Common USB Device Classes Human Interface Device (HID): Mouse, Keyboard, Control Device

Audio Device: Speaker, Microphone, Audio CD

Mass Storage Device (MSD): USB Stick, Camera, (any external files)

Communication Device: USB-COM Adapter, Telephone Modem (due Q4 2007)

Templates for standard ARM processor-based Microcontrollers Proven Hardware Layer USB Event Handler (HW specific) Generic USB Core Common USB Device Classes

(HID, MSD, Audio)

RTX Messages Interface enough power for other user tasks

Page 26: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

262626

RL-USB Configuration

Implementing USB Devices requires USB know-how even when RL-ARM simplifies the configuration of the main USB parameters.

Use a standard USB Template Adjust USB Core Parameters Update the Device Descriptors Extend the USB Event Handlers

Composite Devices USB Core Configuration

Specify USB Event Handlers Add USB Classes

Configure the Device Descriptor

Implement USB Class Code Add USB Class Code from

the related USB Template Re-assign USB Event Handlers

USB Core Configuration using the

µVision Configuration Wizard

Page 27: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

272727

RL-USB Templates

 

USB HID

HID Template Connects to PC without driver LED’s can be controlled from PC application Switches are reported to the PC application

Other USB Templates Audio: implements a PC Speaker MSD: implements a Memory Stick

LEDSwitch Utility(complete source code in

\Keil\ARM\Utilities\USB_Client1)

Page 28: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

282828

RL-CANCAN Interface

Page 29: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

292929

RL-CAN Example

CAN Tx

CAN Rec LED’s

Analog Input Voltage

Incremental Script

Using Keil MCB2300 or MCBSTR9 Evaluation Board A/D Converter gets input voltage from Potentiometer Input Voltage send every second (via CAN2) Message received via CAN is displayed on LED’s (via CAN1)

Using µVision Simulation Script generates

A/D input voltage Messages received via CAN2

Page 30: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

323232

Need More Help? Application Notes on www.keil.com/appnotes

192: Using TCP/IP Examples on ARM Powered Evaluation Boards 195: Developing HID USB Device Drivers For Embedded Systems

Page 31: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

333333

RTX Real-Time Kernel

Page 32: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

343434

Why use a Real-Time Kernel? Building Block

Software / Hardware interface layer

Easy expansion of system software

Hardware independent

House Keeping Process scheduling

CPU resource management

Task communication

Focus on Application Development Leave basic system management

Page 33: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

353535

Software Concepts for ARMThe ARM core requires a different mindset for embedded applications.

ARM7 & ARM9 have just two interrupt levels Standard (IRQ) and Fast (FIQ) but provide CPU modes with separate interrupt stacks for predictable stack requirements.

‘main’ as End-less Loop Solution for simple applications Usage together with powerful

multi-level interrupt system Stack usage un-predictable

Using a Real-Time Kernel Allows application to be separated

into independent tasks Message passing eliminates

critical memory buffers Each task has an own stack area Interrupt communication with

event flags and messages

TasksPriority 0

IRQ

FIQ

TasksPriority 1

TasksPriority 2

Time

Main

ISRlevel 0

ISRlevel 1

ISRlevel 2

Time

Page 34: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

363636

What makes a Good RTOS Performance

Predictable behaviour

Low latency

High number of interrupt levels

Ease of Use Flexible API and implementation

Tool-chain integration.

Scheduling options

Multitasking, Preemptive, Round Robin.

System Friendly Consumes small amount of system resource

Proven Kernel

Low cost

Page 35: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

373737

Real-Time? Real-Time does not equal High Speed

Not all tasks are ‘Super High Speed’

Systems perform to deadlines

Tasks need to complete before deadline and other tasks

Real-Time OS not to be confused with high speed requirements

Real-Time, not mission critical Varying levels of Real-Time

Hard, Firm, Soft and Non

RTOS not confined to critical systems

Real-Time OS = Building Block RTOS provides easy Multitasking Environment

House keeping tasks

Page 36: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

383838

RTX Features

Full-featured Real-Time kernel meets the requirements of a ‘good’ real-time kernel

Task Specifications

Priority Levels 256

No. of Tasks Defined Unlimited

No. of Tasks Active 256

Context Switch < 300 Cycles

Interrupt Latency < 100 Cycles

Memory Requirements Bytes

CODE Space(depending on used functionality)

1.5K – 5K

RAM Space(each active task requires an own stack space)

< 500

Main Features Multi-Tasking – Round Robin, Pre-emptive, Cooperative

Unlimited – User Timers, Semaphores and Mailboxes

Royalty free

Page 37: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

393939

Process Management Create and delete tasks Change task priorities Event flag management Interrupt functions CPU resources

Multi-Tasking Preemptive context switching Scheduling Semaphore management

Real-Time Control Deterministic behaviour

Inter-task Communication Mailbox management Interface to interrupt functions

Memory Allocation Thread-safe (usage even in ISR)

RTX Real-Time Kernel

Full-featured Real-Time kernel designed to meet the challenges of Embedded System Design

Page 38: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

404040

Compilation Tasks are integrated into the RealView C Compiler language.

Close integration in RealView MDK (µVision)

µVision IDE automatically includes RTX Libraries

Tool Chain Integration

void task1 (void) _task {… code of task 1 placed here….

}

RTX is fully integrated into RealView MDK for easy development and debugging

Page 39: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

414141

RTX Setup

All major parameters of RTX can be easily changed using the µVision configuration wizard.

Page 40: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

424242

Kernel Aware Debugging

Tasks and Event analysis Resource Loading

Allowing resource optimisation

RTX and µVision are tightly integrated, kernel aware debugging is fully supported.

Page 41: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

434343

RL-ARM ExamplesRTX Real-Time Kernel

Page 42: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

444444

Traffic Light LED’s are timed or controlled by push button

Utilizes interrupt control, event management and multitasking capabilities of RTX Kernel

Demonstrates RTX concepts

RTX Examples

Page 43: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

454545

RTX Examples

CAN Tx

CAN Rec LED’s

Analog Input Voltage

Incremental Script

CAN Example using RTX Mailbox and event handling

CAN Send (Tx) – shows automatic data handling capabilities

CAN Rec – message checking with instant message receipt

– task wait and return

– almost impossible without Real-Time Kernel

Page 44: 111 Real-Time Library TCPnet Networking Suite Flash File System USB and CAN Interfaces RTX Real-Time Kernel

464646

Get More Information

Application Notes

Program Examples

Device Database

Support Knowledgebase

Discussion Forum

Customers use www.keil.com on a daily basis to obtain program examples, latest technical information, and support.