Upload
dwayne-kory-stevenson
View
257
Download
9
Tags:
Embed Size (px)
Citation preview
111
RL-ARM Real-Time LibraryTCPnet Networking Suite
Flash File SystemUSB and CAN InterfacesRTX Real-Time Kernel
222
Presentation Agenda Overview and Introduction
Embedded Connectivity Challenges
Components of the RL-ARM 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
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
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 UARTs
Two fast I2C, 400KHzTwo channels for SPI, SSI
or Microwire
10-bit A/D converter (eight channels)
Real-Time Clock
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 UARTs
Today’s Microcontroller Selection
666
RL-ARM 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.
RL-ARMRL-ARM
RTX Source Code
TCP/IP Suite
Flash File System
USB Device Interface
CAN Interface
Exa
mp
les
and
Tem
pla
tes
Real-Time Library
777
RL-TCPnetTCP/IP Networking Suite
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 with sliding window
flow control UDP with multicasting
support Configurable listening
ports
Physical Interfaces Ethernet PPP (serial connection) SLIP (dial-up)
999
The Internet applications supported by TCPnet can be used to add powerful functionality to your embedded system.
TCPnet Networking Suite
HTTP Server with CGI Scripting Remote system configuration via on-line web forms, with utility to
upload file to memory cards. Supports XML scripts. SMTP Client
Remote system can send automatically emails with status or error reports
TFTP Server Fast file uploads to the remote embedded system – useful for
remote firmware updates Telnet Server
Command-line interaction with the remote system
101010
Flexible TCP/IP Communication Layer
TCPnet may be used with or without the RTX Kernel, fully integrated with µVision for easy configuration and debug
111111
Scalable TCP/IP Connectivity
Crossover Patch-Cable
Direct PC connection Easily replaces point-point
serial connection High Speed ~100Mbps
121212
Scalable TCP/IP Connectivity
LAN
Ethernet Switch
Simple Network More flexible system Easily expanded
131313
Scalable TCP/IP Connectivity
LAN
Ethernet Switch
Complex Network Multiple devices and interfaces Easy data sharing Flexible configuration
141414
Scalable TCP/IP Connectivity
LAN
Router
Internet
Internet Connectivity TCPnet provides easy solution
to connect to the world
151515
Serial TCP/IP Connectivity
Modem
RS232
PPP/SLIP
Telephone Line
Internet
Classic Serial Modem Interface TCPnet provides serial interface
support for PPP/SLIP
161616
Flexible TCP/IP Connectivity
Telephone Line
Internet
Cellular / Wireless Interface Extended to wireless world
GPRS/GSM
Modem
RS232
PPP/SLIP
RS232
PPP/SLIP
171717
RL-ARM ExamplesExamples and Templates
181818
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
191919
HTTP Server with CGI Interface Server provides authentication and allows multiple sessions A CGI interface allows interaction with MCU hardware
RTX & TCPnet Examples
202020
LED Switch LEDs 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)
212121
TCPnet Examples: Memory Footprint
Demo Example ROM Size RAM Size
HTTP Server (without RTX Kernel) 25.6 KBytes 20.0 KBytes
Telnet Server 20.4 KBytes 20.0 KBytes
TFTP Server 20.6 KBytes 24.7 KBytes
SMTP Client 16.7 KBytes 19.5 KBytes
DNS Resolver 12.7 KBytes 19.6 KBytes
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 DNS Resolver: used to resolve IP address from the Host name
222222
RL-FlashFSFlash File System
232323
Flash File System (RL-FlashFS)
RL-ARM includes a Flash File System that can create, save, read and modify files on ROM, RAM, classic Flash ROM, and Memory Cards
File Systems Supported File Tables in ROM
FAT12, FAT16 and FAT32
Long file name support
Sub-folder support
Classic C File I/O Functions interface Uses standard C library functions such as fopen or fread
Allows simultaneous access to different media from multiple threads
Time Stamps supported (only interface to RTC needed)
Flash File System
Flash DriverFile Table FAT12/16
Flash ROMRAM SD/MMC
Standard C File I/O Functions
ROM
242424
Flash File System (RL-FlashFS)
RL-FlashFS supports a variety of memory types.
Flash Memory Devices
Flash programming algorithms provided for popular microcontrollers (on-chip Flash) and memory devices (off-chip Flash)
Configurable algorithm similar to ULINK2 Flash Programming provided for all microcontrollers in the Device Database
SD / MMC Memory Cards
Via proven SPI or MMC interface available in many ARM based Microcontrollers
Format and De-fragmentation Functions
Faster read/write access with multiple block read/write commands
File caching and memory card hot plug supported
252525
RL-FlashFS Examples SD Memory Card
Simple Command Interface Targets for UART and Real-
Time Agent
SD Card
Flash File System Examples ROM Size RAM Size
Example: File System on on-chip Flash 21 KBytes 4.5 KBytes
Example: File System on SD Card 31 KBytes 10.1 KBytes
262626
RL-USBUSB Device Interface
272727
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
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, CDC)
RTX Messages Interface Enough power for other user tasks
282828
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
292929
RL-USB Templates HID Template
Connects to PC without driver LEDs 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
USB HID
LEDSwitch Utility(source code in \Keil\ARM\Utilities\USB_Client1)
USB Driver Examples ROM Size RAM Size
HID Class 7.4 KBytes 4.9 KBytes
Memory Class 8.7 KBytes 37.7 KBytes
Virtual COM port over USB 8.9 KBytes 5.7 KBytes
303030
RL-CANCAN Interface
313131
CAN Interface (RL-CAN)
RL-ARM includes a generic CAN driver and hardware adaptationsfor several ARM based Microcontrollers.
API that allows control of several on-chip CAN Controllers Initialize and start CAN communication
Define CAN message objects for receiving or transmitting
Send, Request, or Receive CAN messages
Interrupt-Driven Hardware Layer for standard ARM based Microcontrollers Atmel SAM7 series NXP LPC21xx/LPC23xx ST STR7, STR9 & STM32 series
Implemented using RTX Kernel Memory Pool
Message Passing
323232
RL-CAN Example
CAN Tx
CAN Rec LEDs
Analog Input Voltage
Incremental Script
Using Keil MCB2300 or MCBSTR9 Evaluation Board A/D Converter gets input voltage from Potentiometer Input Voltage sent every second (via CAN2) Message received via CAN is displayed on LEDs (via CAN1)
Using µVision Simulation Script generates
A/D input voltage Messages received via CAN2
353535
RTX Real-Time Kernel
363636
Real-Time? What is a Real-Time system?
Nearly all embedded systems are real-time
For example, a phone does in parallel
Communicate via 3G
Respond to the keyboard and drive the display
All these activities are handled in a “timely manner”
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
373737
Why use a Real-Time Kernel? In a real-time system you always need code to handle its
real-time aspects With a real-time kernel this is done for you
You can focus on application development
Building Block Software / Hardware interface layer
Easy expansion of system software
Hardware independent
House Keeping Process scheduling
CPU resource management
Task communication
383838
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
393939
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
404040
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
414141
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
424242
RTX Support
RTX-V2 Extended RTOS features, allowing more robust and
fail-proof RTX Kernel implementation
Support for simultaneous calls to C library from different threads
All system calls implemented with SWI or SVC instructions and executed in privileged mode
Old ARM7™/ARM9™ version uses os_clock_demon system clock task to control task switches of all user tasks.
Less RAM required: 32 Bytes less per task, up to 300 Bytes less in total
MDK3.40 includes an improved implementation of RTX.
434343
RTX Performance
Task Specifications ARM7TDMI Cortex-M3
CPU Clock Speed 60MHz 72MHz
Initialize system, start task 46.2µS 22.1µS
Create defined task, (no task switch) 17.0µS 8.1µS
Create defined task, (with task switch) 19.1µS 9.3µS
Delete Task 9.3µS 4.8µS
Task Switch 6.6µS 3.9µS
Set event (no task switch) 2.4µS 1.9µS
Send semaphore 1.7µS 1.6µS
Send message 4.5µS 2.5µS
Max Interrupt lockout for IRQ ISRs 3.1µS -
http://www.keil.com/support/man/docs/rlarm/rlarm_ar_timing_spec.htm
444444
RTX Memory Requirements
Memory Requirements ROM Size RAM Size
RTX Kernel Library only (ARM7/ARM9) 2.5 KBytes 300 Bytes
RTX_Blinky Example (ARM7/ARM9) 4.7 KBytes 2.9 KBytes
RTX Kernel Library only (Cortex-M) 2.9 KBytes 260 Bytes
RTX_Blinky Example (Cortex-M) 4.9 KBytes 3.6 Kbytes
Minimum System Stack - 64 Bytes
The RTX_Blinky example is ported to all Keil Evaluation Boards Implements 6 tasks, with inter-task communication via mailboxes and
semaphores
Includes LCD and peripheral drivers
454545
Compilation Tasks are integrated into the RealView C Compiler language.
Close integration in 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 MDK for easy development and debugging
464646
RTX Setup
All major parameters of RTX can be easily changed using the µVision configuration wizard.
474747
Kernel Aware Debugging
Tasks and Event analysis Resource Loading
Allowing resource optimisation
RTX and µVision are tightly integrated, kernel aware debugging is fully supported.
484848
RTX Event Viewer
Displays task switching and events of a running RTX systemSimulation or on a Cortex-M device.
494949
RL-ARM ExamplesRTX Real-Time Kernel
505050
Traffic Light LEDs are timed or controlled by push button
Utilizes interrupt control, event management and multitasking capabilities of RTX Kernel
Demonstrates RTX concepts
RTX Examples
515151
RTX Examples
CAN Tx
CAN Rec LEDs
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
525252
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
535353
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.