Presentation is loading. Please wait.

Presentation is loading. Please wait.

RL-ARM Real-Time Library

Similar presentations


Presentation on theme: "RL-ARM Real-Time Library"— Presentation transcript:

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

2 Presentation Agenda Overview and Introduction TCPnet Networking Suite
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

3 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

4 Today’s Microcontroller Selection
Wide range of MCU Cores 8/16/32 Bit On-chip Memory Interrupt System 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 Slave 9 Programmable DMA Channels 96MHz ARM966-EJS 3-Phase Induction Motor Controller (IMC) Three style UARTs Two fast I2C, 400KHz Two channels for SPI, SSI or Microwire 10-bit A/D converter (eight channels) Real-Time Clock Peripherals I/O Pins, Timers, PWM A/D and D/A converters UART, SPI, I2C Complex communication Peripherals (CAN, USB, Ethernet) Customers expect support for specific Microcontrollers. Block Diagram of STR9x

5 Today’s Microcontroller Selection
Wide range of MCU Cores 8/16/32 Bit On-chip Memory Interrupt System 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 Interfaces Two channels for SPI or SSP 10-bit A/D converter (eight channels) Four style UARTs Peripherals I/O Pins, Timers, PWM A/D and D/A converters UART, SPI, I2C Complex communication peripherals (CAN, USB, Ethernet) Customers expect support for specific Microcontrollers. Block Diagram of LPC2378

6 RL-ARM Real-Time Library
Extensive library of common ready-to-use middleware components, speed software development. RL-ARM RTX Source Code TCP/IP Suite Flash File System USB Device Interface CAN Interface Examples and Templates 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

7 TCP/IP Networking Suite
RL-TCPnet TCP/IP Networking Suite

8 TCPnet Networking Suite
Ground-up design for embedded applications, maximum performance, minimum memory requirement and easy to use. 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) Debugging Multiple debug levels: Errors only Complete status information Status information on UART interface

9 TCPnet Networking Suite
The Internet applications supported by TCPnet can be used to add powerful functionality to your embedded system. 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 s 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

10 Flexible TCP/IP Communication Layer
TCPnet may be used with or without the RTX Kernel, fully integrated with µVision for easy configuration and debug

11 Scalable TCP/IP Connectivity
Direct PC connection Easily replaces point-point serial connection High Speed ~100Mbps Crossover Patch-Cable

12 Scalable TCP/IP Connectivity
Simple Network More flexible system Easily expanded LAN Ethernet Switch

13 Scalable TCP/IP Connectivity
Complex Network Multiple devices and interfaces Easy data sharing Flexible configuration LAN Ethernet Switch

14 Scalable TCP/IP Connectivity
Internet Connectivity TCPnet provides easy solution to connect to the world LAN Router Internet

15 Serial TCP/IP Connectivity
Classic Serial Modem Interface TCPnet provides serial interface support for PPP/SLIP Internet RS232 Telephone Line PPP/SLIP Modem

16 Flexible TCP/IP Connectivity
Cellular / Wireless Interface Extended to wireless world RS232 PPP/SLIP GPRS/GSM Internet RS232 Telephone Line PPP/SLIP Modem

17 Examples and Templates
RL-ARM Examples Examples and Templates

18 RTX & TCPnet Examples Example Projects show a complete configuration and help you to get started quickly. All examples are ready to run on Evaluation Boards. ..\Examples ..\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 address 18

19 RTX & TCPnet Examples HTTP Server with CGI Interface
Server provides authentication and allows multiple sessions A CGI interface allows interaction with MCU hardware

20 TCPnet Examples LED Switch
LEDs can be controlled via PC or other eval board Uses TCP and UDP PC running LED Switch Client LAN LEDSwitch Utility (complete source code in \Keil\ARM\Utilities\LEDSwitch) Ethernet Switch Evaluation Boards with LED Switch Client

21 TCPnet Examples: Memory Footprint
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 s DNS Resolver: used to resolve IP address from the Host name Demo Example ROM Size RAM Size HTTP Server (without RTX Kernel) 25.6 KBytes 20.0 KBytes Telnet Server 20.4 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 If you rebuild the applications you may have a total size larger than the table because they sometimes include large fixed data contents. For example the HTTP example has 23KB of webpage content.

22 RL-FlashFS Flash File System

23 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 Driver File Table FAT12/16 Flash ROM RAM SD/MMC Standard C File I/O Functions ROM Note that long filename support in final products requires the customer to get a license from Microsoft.

24 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

25 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

26 RL-USB USB Device Interface

27 USB Device Interface (RL-USB)
RL-ARM includes Device Interfaces for common USB device classes which have default support in Windows 2000/XP/Vista (no driver hassle). 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 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

28 USB Core Configuration using the µVision Configuration Wizard
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

29 LEDSwitch Utility (source code in \Keil\ARM\Utilities\USB_Client1)
RL-USB Templates LEDSwitch Utility (source code in \Keil\ARM\Utilities\USB_Client1) 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 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

30 RL-CAN CAN Interface

31 CAN Interface (RL-CAN)
RL-ARM includes a generic CAN driver and hardware adaptations for several ARM based Microcontrollers. 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 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

32 RL-CAN Example 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 Analog Input Voltage CAN Tx Incremental Script CAN Rec LEDs

33 Virtual Simulation Registers (VTREG)
µVision provides VTREGs for control of serial communication (CAN, I2C, SSP, SPI). CAN I/O is simulated using the following VTREGs.

34 µVision Debug & Signal Functions
Users define and generate complex input functions as stimulus to simulation models. Simulates Complex Input Scripts for CAN Input and Output Messages Signal Functions Automated Message Processing Periodic CAN Messages FUNC void SendCANmessage (void) { CAN0ID = 0x4500;// message ID = 0x 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", CANAID); break; case 2: printf("\nSend 29-bit ID=%X", CANAID); break; case 3: printf("\nRequest 11-bit ID=%X", CANAID); return; case 4: printf("\nRequest 29-bit ID=%08X", CANAID); return; } printf("\nMessage Length %d, Data: ", CAN0L); printf("%X … %X", CAN0B0, …, CAN0B7);

35 RTX Real-Time Kernel

36 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

37 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

38 Software Concepts for ARM
The 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

39 What makes a Good RTOS Performance Ease of Use System Friendly
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

40 RTX Features Main Features
Full-featured Real-Time kernel meets the requirements of a ‘good’ real-time kernel Main Features Multi-Tasking – Round Robin, Pre-emptive, Cooperative Unlimited – User Timers, Semaphores and Mailboxes Royalty free Task Specifications Priority Levels 256 No. of Tasks Defined Unlimited No. of Tasks Active 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

41 RTX Real-Time Kernel Full-featured Real-Time kernel designed to meet the challenges of Embedded System Design 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)

42 MDK3.40 includes an improved implementation of RTX.
RTX Support MDK3.40 includes an improved implementation of RTX. 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

43 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 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 -

44 RTX 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) 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

45 Tool Chain Integration
RTX is fully integrated into MDK for easy development and debugging Compilation Tasks are integrated into the RealView C Compiler language. Close integration in MDK (µVision) µVision IDE automatically includes RTX Libraries void task1 (void) _task { … code of task 1 placed here…. }

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

47 Kernel Aware Debugging
RTX and µVision are tightly integrated, kernel aware debugging is fully supported. Tasks and Event analysis Resource Loading Allowing resource optimisation 47

48 RTX Event Viewer Displays task switching and events of a running RTX system Simulation or on a Cortex-M device. Communicates using DCC - Debug Communication Channel 300B - Optimized for resource light systems ETM (Embedded Trace Macrocell) offers real-time trace of program execution However it has major drawbacks for use with MCU. Not available in all ARM based MCUs – almost no ARM7 versions and few ARM9 Uses dedicated pins for trace interface, does not use JTAG – user looses I/O or other peripherals Requires extra hardware, can be expensive >$2000.

49 RL-ARM Examples RTX Real-Time Kernel

50 RTX Examples Traffic Light LEDs are timed or controlled by push button
Utilizes interrupt control, event management and multitasking capabilities of RTX Kernel Demonstrates RTX concepts

51 RTX Examples 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 Analog Input Voltage CAN Tx Incremental Script CAN Rec LEDs

52 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

53 Get More Information Application Notes Program Examples
Customers use on a daily basis to obtain program examples, latest technical information, and support. Application Notes Program Examples Device Database Support Knowledgebase Discussion Forum


Download ppt "RL-ARM Real-Time Library"

Similar presentations


Ads by Google