Rl-Arm: RTX Real-Time Kernel Tcpnet Networking Suite Flash File System Usb Device Interface Can Interfaces
Rl-Arm: RTX Real-Time Kernel Tcpnet Networking Suite Flash File System Usb Device Interface Can Interfaces
Rl-Arm: RTX Real-Time Kernel Tcpnet Networking Suite Flash File System Usb Device Interface Can Interfaces
RTX Real-Time Kernel TCPnet Networking Suite Flash File System USB Device Interface CAN Interfaces June 2009
Microcontroller have
Processor On-chip Memory Interrupt System Rich peripheral set
SRAM,
I/O Pins, Timers, PWM A/D and D/A converters UART, SPI, I2C Complex communication peripherals (CAN, USB, Ethernet)
80 GPIO Pins
What is RL-ARM?
For example CAN in industrial applications Web-based and mass storage products
Integrated solution
Cost effective
Allows you to focus effort on developing the important parts of your application Provides tested and optimized components
RL-TCPnet
10
Email, SMTP
Modem, PPP
Serial, SLIP
TCPnet Networking Suite HTTP Server ARP, IEEE 802.xx network CGI Scripting TCP UDP Telnet Server FTP Server ARP DHCP SMTP Server DNS Resolver PPP SLIP
Ethernet
Modem UART
Debug UART
11
to your application
13
14
15
TCPnet Performance
UDP Packet size 10 200 400 600 800 1000 1200 1400 Packets / sec 19,790 21,370 17,490 14,230 11,950 10,370 9,120 8,140 kByte / sec 176 4,164 6,820 8,330 9,360 10,090 10,670 11,130 Packets / sec 7,540 6,450 5,600 4,730 4,210 3,736 3,322 3,082 TCP kByte / sec 74 1,272 2,202 2,782 3,300 3,652 3,894 4,215
Examples shown using Cortex M3 device at 96MHz, 100 Mbps full duplex Using CMSIS compatible Ethernet drivers
16
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 Further TCP sockets require an approximate 2kB additional space
17
RL-Flash
18
Accessed via standard I/O function calls Two file system implementations provided Small & fast file system for internal RAM and ROM FAT32/16/12 for external storage SPI Flash, SD/MMC cards
8.3 and long filenames, royalty-free option available
SD/MMC, storage
19
RL-Flash Example
Standard file I/O with SD Card Command line interface Interfaces with UART or RTX
SD Card
20
RL-Flash Performance
Board MCBSTM32 LM3S8962 LM3S6965 LM3S3768 Device ST STM32 CPU Core Cortex-M3 Cortex-M3 Cortex-M3 Cortex-M3 ARM9 ARM7 ARM7 ARM7 ARM9 ARM7 CPU [MHz] 72 50 50 50 99 48 48 60 48 60 Card Interface SPI at 18MHz SPI at 12.5MHz SPI at 12.5MHz SPI at 12.5MHz SD4 at 25MHz SD4 at 24MHz SD4 at 24MHz SPI at 7.5MHz SPI at 12MHz SPI at 15MHz Write [KB/s] 711.1 537.8 539.2 539.5 4,083.8 4,084.3 3,946.3 299.4 355.2 402.2 Read [KB/s] 758.1 607.6 603.6 603.8 5,403.7 5,525.9 5,330.6 313.4 357.1 416.1 Luminary LM3S8962 Luminary LM3S6965 Luminary LM3S3768 Atmel AT91SAM9G20 NXP LPC2468 NXP LPC2368 NXP LPC2148 ST STR912 ST STR750
Figures shown were achieved working with 4MB of data in 4KB blocks
21
RL-USB
22
Offer plug and play compatibility for your design Enables interfaces for standard USB device classes
Uses native drivers provided for Windows 2000/XP/Vista
23
RL-USB Configuration
24
Human Interface Device Connects to PC without driver LEDs controlled from PC application Switches reported to PC application
USB
25
RL-CAN
CAN Interface
26
Interrupt-driven hardware layer Supports several ARM-based microcontrollers Common API for access to many CAN controllers Including Atmel, NXP, ST, Luminary, TI, Toshiba
Configure and initialize devices Send, request and receive messages
27
Hardware
RL-CAN Examples
A/D Converter gets input voltage from Potentiometer Input Voltage sent every second via CAN2 Message received via CAN is shown on LEDs via CAN1 Using Vision Simulation Script generates A/D input voltage Analog Input CAN Tx Messages received via CAN2 Voltage
Incremental Script
CAN Rec
LEDs
28
29
Scripts for CAN Input and Output Messages Signal Functions Automated Message Processing Periodic CAN Messages
FUNC void SendCANmessage (void) { CAN0ID = 0x4500;// message ID = 0x4500 CAN0L = 2; // message length 2 bytes CAN0B0 = 0x12; // message data byte 0 CAN0B1 = 0x34; // message data byte 1 CAN0IN = 2; // send message with 29-bit ID } FUNC void Print_CANmessage (void) { switch (CAN0OUT) {
case 1: printf("\nSend 11-bit ID=%X", break; case 2: printf("\nSend 29-bit ID=%X", break;
CANAID); CANAID);
} printf("\nMessage Length %d, Data: ", CAN0L); printf("%X %X", CAN0B0, , CAN0B7);
case 3: printf("\nRequest 11-bit ID=%X", CANAID); return; case 4: printf("\nRequest 29-bit ID=%08X", CANAID); return;
30
31
Embedded applications typically have two design concepts main as Infinite Loop
Allows application to be separated into independent tasks Message passing eliminates critical memory buffers Each task has its own stack area Interrupt communication with event flags and messages
32
Hardware interface layer Easy expansion of system software Hardware independent Housekeeping Process scheduling CPU resource management Task communication Focus on Application Development Leave basic system management to the RTOS kernel Avoid re-writing resource management code that already exists Reduce porting and testing overheads
33
34
Real-Time?
Not all tasks are Most Urgent 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 Deterministic behaviour is often most important A Real-Time OS is a framework RTOS provides good multitasking environment Reliable and scalable management of housekeeping tasks
35
Create and delete tasks, change task priorities Manage event flag and CPU resources Multi-Tasking Pre-emptive context switching, scheduling, and semaphores Real-Time Control Deterministic behaviour Inter-task communication Mailbox management Interface to interrupt functions Memory allocation Thread-safe (usage even in ISR)
36
RTX Specifications
Multi-Tasking Round Robin, Pre-emptive, Cooperative Unlimited User Timers, Semaphores and Mailboxes
Task Specifications Priority Levels No. of Tasks Defined No. of Tasks Active Context Switch Interrupt Latency
256
Bytes
37
RTX Performance
Task Specifications CPU Clock Speed Initialize system, start task Create defined task, (no task switch) Create defined task, (with task switch) Delete Task Task Switch Set event (no task switch) Send semaphore Send message Max Interrupt lockout for IRQ ISRs ARM7TDMI 60MHz 46.2S 17.0S 19.1S 9.3S 6.6S 2.4S 1.7S 4.5S 3.1S Cortex-M3 72MHz 22.1S 8.1S 9.3S 4.8S 3.9S 1.9S 1.6S 2.5S -
38
39
40
41
RTX Examples
Traffic Light LEDs are timed or controlled by push button Uses interrupt control, event management, and multitasking
capabilities of RTX Kernel
42
RTX Examples
CAN Example using RTX Mailbox and event handling CAN Send (Tx) shows automatic data handling capabilities message checking with instant message receipt CAN Rec
task wait and return almost impossible without Real-Time Kernel
Incremental Script
43
RL-ARM Roadmap
What new features can I expect to see?
44
The RTX kernel and sources, gives you all the resources you need to create and control multi-threaded, real-time applications that can be tailored to your system.
RL-ARM enables USB, TCP/IP networking and file-system support. Use existing resources to ensure you focus on the important parts of your application.
RL-ARM is designed, tested and optimised by ARM engineers. Documentation and examples make it easy to re-use the work done by our experts.
45
Now!
task A task B
FTP client and host support
Next year
46
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
47
48