IAR PowerPac introduction

Download Report

Transcript IAR PowerPac introduction

IAR PowerPacTM
Complete suite of tools from IAR
visualSTATE
Idea
Design
IAR
Embedded
Workbench
Verify,
Validate,
Implement
Compile
RTOS & Middleware
IAR
PowerPac
IAR J-Link
& IAR
J-Trace
Debug
IAR
Development
Kits
Deploy
Target
application
Model State Chart / UML
State Machine Modeling Tool
Target System
ARM SoC
On-Chip Peripherals
User-Written Codes
On-Chip
Flash
Middleware
Code
GUI
TCP/IP USB
File
Stack Stack System
AutoGenerated
Code
On-Chip
RAM
ARM Core
ETM
Embedded
ICE
RTOS Kernel
Trace
Port
BSP
JTAG
Port
Compiler / Assembler
Emulator
IDE
Linker
Project
Manager
Debugger
Trace
Probe
JTAG
Probe
Market drivers
• 32-bit microcontrollers now becoming affordable
• Software and hardware complexity has grown
• Growing need for real-time multitasking system
• Increased understanding for costs related to open source
• Increased expectations of pre-integrated software platforms
• Time-to-market
• Need for external communication
IAR PowerPacTM
Additional
components
IAR PowerPac TCP/IP
IAR PowerPac USB
•
Fully featured real-time operating system
•
High performance file system
•
USB device communication stack
•
TCP/IP protocol stack
•
Innovative business model similar to that of
IAR Embedded Workbench
•
Tight integration with IAR Embedded
Workbench
•
Easy to get started
•
Board support packages
IAR PowerPac Source
IAR PowerPac Base
(RTOS +
File System)
Operating system
- key features
• Small memory footprint (2-3 KByte for typical ARM
implementation)
• Pre-emptive multi-tasking
• Round-robin scheduling
• Up to 255 priorities
• Unlimited number of tasks, semaphores, mailboxes and
software timers
• Full interrupt support
• Zero interrupt latency time
• Nested interrupts permitted
• Very fast context switch times
File system
Application
File system
API layer
File system layer
• Very small footprint, e.g. 16 KByte
ROM / 1,6 KByte RAM
• MS-DOS/MS-Windows compatible
FAT12, FAT16 and FAT32 support
• Multiple device driver support
• Multiple media support
Logical block layer
Device driver
Hardware layer
• OS support
• Device drivers available: RAM disk,
MMC, SD, CompactFlash , IDE, SMC,
NOR/NAND flashes
• Highly modular structure keeping
minimum memory consumption
IAR PowerPac USB
• Sold as an add-on to PowerPac
Base/Source using the same
business model
• Key communication classes
• Board support packages
• Small footprint
• High speed
• Supports USB 1.1 & 2.0 devices
• The highest possible transfer
rate on USB 2.0 full speed
(12 Mbit/second) devices is
approximately 1 Mbyte per
second.
Bulk
MSD
CDC
USB Core
Driver
HID
IAR PowerPac TCP/IP
• Protocols: TCP, IP, Telnet, UDP,
ARP, DHCP (client), ICMP, TFTP
• Highly optimized for minimum
memory consumption & high speed
DNS
– 2.5 Mbyte/s (ARM7 at 48 MHZ)
– 18 Kbyte ROM
• Standard socket interface
• Connections limited only by
available memory
• Zero compile time configuration ->
code can be compiled into a library
• Tightly integrated with PowerPac
RTOS
DHCP
Telnet
TFTP
BSD sockets
UDP
TCP
IP
ARP
Drivers
ICMP
IAR PowerPac的特点
File System
- 极小的代码
+ ROM 17k ~
+ RAM 4k ~
- 读写速度极快
ARM7(50MHz)下达1.2M ~ 4.1M
- 兼容FAT12/16/32
- 可同时读写多种存储介质
- 支持操作系统
- 类ANSI C的API,用户轻松上手
- 非常简单的设备驱动模板
- 提供以下驱动:
RAM, MMC, SD, CompactFlash
IDE, NOR and NAND Flash
RTOS
- 极小的代码
+ ROM 1.7k ~ 2.5k
+ RAM 25 Bytes~
- 抢占式和循环式的任务调度
- 255个优先级
- 无限多的任务、信号量和邮箱
USB
- 极小的代码
+ ROM 6k ~ 10k
+ RAM 1k
- 支持USB 1.1或USB 2.0
- 高速度的传输速率
+ USB 2.0可以跑全速 12Mbit/秒
+ Mass Storage模式可跑高速480Mbit/秒
- 不需要定制主机端的驱动
- 高效、可移植、带注释的ANSI C代码
- 硬件抽象层允许快速支持新设备
- 包括Bulk、MSD、CDC以及HID模块
- 中断零延迟
- 中断处理程序可进行任务切换
- 允许中断的嵌套
- 非常迅速的上下文切换
ARM7(50MHz)下达到 8.92us
评估版免费下载:www.iar.com/pparm
TCP/IP
-极小的代码
+ ROM 12K;
-可移植性强;
-支持IP/UDP/TCP 协议
-高度可裁减
-零数据复制
-可安装的socket library子集
-非阻塞版本的函数
-连接数量仅受内存大小限制
-优化的汇编语言校验和函数
-延迟应答
-BSD形式的“Keepalive”选项
- 每个任务可有单独的优先级
- 优化的功耗管理
- 与IAR EWARM无缝集成
- 提供初学者入门开发模板
- 提供芯片初始化代码
Agenda
• IAR PowerPac RTOS
• IAR PowerPac File System
• IAR PowerPac USB
• IAR PowerPac TCP/IP
What is a Real Time Kernel ?
 Software that manages the time of a microprocessor or
microcontroller:
– Ensures that the most important code runs first
What is a Real Time Kernel ?
Allows Multitasking:
– Allows to do more than one thing at the same
time.
– Breaks down the application into multiple tasks
each handling one aspect of the application.
– It’s like having multiple CPUs.
What is a Real Time Kernel ?
Provides valuable services to the application
– Time delays
– Semaphore management
– Inter-task communication and
synchronization
– Memory management
Why using an RTOS ?
• More responsive to real time events, provides
predictable response times in time critical
applications
• Task oriented design, cleaner
and better organized
• Using an RTOS abstracts the
hardware-dependence, porting
the application to a different
target is easier
• Provides useful service to the application
Memory usage in EWARM
Kernel size (ROM)
approx. 3000 bytes
Kernel RAM usage
51 bytes
RAM usage per task control block
32 bytes
RAM usage per resource
semaphore
8 bytes
RAM usage per counting semaphore
2 bytes
RAM usage per mailbox
20 bytes
RAM usage per software timer
20 bytes
RAM usage per event
Min. stack-size per task (RAM)
0 bytes
56 bytes
Agenda
• IAR PowerPac RTOS
• IAR PowerPac File System
• IAR PowerPac USB
• IAR PowerPac TCP/IP
PowerPac File System main features
• MS DOS/MS compatible FAT12, FAT16 and
FAT32 support.
• Long file name support (optional).
• Multiple device driver support / OS support
• Simple, easy to use API
• Multimedia support
• Caching functionality
• Check disk functionality
• Format functionality
PowerPac File System main features
•
•
•
•
•
•
RAM disk support
SMC card support
MMC/SD support using SPI or Card mode
CompactFlash card and IDE device support
NOR flash support
NAND flash support
PowerPac File System main features
• Wear leveling
– makes sure that the number of erase cycles remains
approximately equal for each sector
• Fail-safe operations
– The driver makes only atomic actions and takes the
responsibility that the data managed by the file system
is always valid.
– In case of a power loss or a power reset during a write
operation, it is always assured that only valid data is
stored in the flash.
– If the power loss interrupts the write operation, the old
data will be kept and the block will not be corrupted.
Application
PowerPac File System
API Layer
Storage API
File System API
File System Layer
(FAT)
Storage Layer
Device Driver
CF / IDE / MMC / NAND / NOR / SD /...
Hardware Layer
App. Program using
Storage API or FS API.
Responsibility of app.
programmer
File System API:
<stdio.h> like functions like
FS_FOpen(), FS_FRead(),
FS_FWrite().
Translation of file operations
to sector operations.
Synchronisation of device
operations for different file
operations.
Low level routines to access
sectors of a device and check
status.
Low level routines to access
your hardware.
Responsibility of app.
programmer
Agenda
• IAR PowerPac RTOS
• IAR PowerPac File System
• IAR PowerPac USB
• IAR PowerPac TCP/IP
IAR PowerPac USB
Bulk
•
•
•
•
•
All types of applications
Single, high speed
PC is USB host
Allows full bandwidth
Custom PC host included
MSD (Mass Storage Device)
•
•
Digital camera, USB stick, MP3 player etc.
No custom USB host driver needed
CDC (Communication Device Class)
•
•
Modem, telephone system fax machine etc…
No custom USB host driver needed
HID (Human Interface Device)
•
•
Keyboard, mouse, gamepad
No custom USB host driver needed
Agenda
• IAR PowerPac RTOS
• IAR PowerPac File System
• IAR PowerPac USB
• IAR PowerPac TCP/IP
IAR PowerPac TCP/IP
• What is a TCP/IP stack?
Application Layer (DHCP, DNS, ...)
Transport Layer (TCP/UDP)
Network Layer (IP)
Data-Link Layer (Ethernet)
TCP/IP Application layer
Application Layer
– Consists of user defined and well known protocols
•
•
•
•
•
Dynamic Host Configuration Protocol (DHCP)
Domain Name System (DNS)
Telnet
TFTP
……
– Client-Server Model
• Server offers a service
• Client requests a service
TCP/IP Transport Layer
• Transport layer responsible for application
address
• A Port is the address of the application
– 0 to 1023 are well-known reserved ports
– 1024 to 49151 are registered server ports
– 49152 to 65535 are dynamic client ports
TCP/IP Transport Layer
• Transmission Control Protocol (TCP)
–
–
–
–
Connection oriented protocol
Full duplex, reliable
Data may be reorganized (Nagle)
Connections can be lost
• User Datagram Protocol (UDP)
– Connectionless protocol
– No guarantee of delivery
– Packets are sent unaltered
TCP/IP Network Layer
• Network layer responsible for host address
• Achieved via internet protocol (IP)
– IP address is a 4 byte unique ID for a node
– Often represented in dotted-decimal notation
• 192.168.1.30 which is equivalent to 0xC0A8011E
• 255.255.255.255 broadcast address
• 127.0.0.1 loopback address
– Network mask is used to determine location of a
host (ex. 255.255.255.0)
TCP/IP Network Layer
Internet Control Message Protocol (ICMP)
– Responsible for error messages on the network
– Example: destination unreachable
– Most popular use of ICMP is ping
• Echo request and reply
TCP/IP Data Link Layer
• Ethernet (hardware) Interface
• Responsible for hardware address
– Known as Media Access Control (MAC) address
for Ethernet
• This is a 6 byte unique address
• Cannot be used to determine the location of the device
– Address Resolution Protocol (ARP)
• Sends broadcast packets to ask for the hardware address
TCP/IP Data Link Layer
• Respond to Asynchronous Events (Incoming
Packets)
• Must manage outgoing packets
• Implemented as a separate task
– Queues incoming and outgoing data
IAR PowerPac TCP/IP API
• Similar to the BSD API
• Berkley Systems Distribution (BSD)
• This is a common socket interface
– Porting an already existant application is easy
IAR PowerPac TCP/IP API
Client
socket()
connect()
Server
socket()
bind()
listen()
accept()
send()
recv()
recv()
send()
closesocket()
closesocket()
IAR PowerPac business model
• Principle:
– Base product in object code format
• Licensing model:
–
–
–
–
–
–
Seat license - per developer and CPU
Full source code upgrade
Snap-on SW modules at additional cost – USB and TCP/IP
Group license (up to 20 developers)
Site license (unlimited on the same site)
No royalty fees
• Result:
– Low-risk licensing model
– A license can be used in unlimited number of projects and products
– Affordable site license for unlimited number of developers
Copy protection in PowerPac
• Affects PowerPac Base products and only for
ARM
– PPARM-BASE, PPARM-USB-BASE, PPARM-TCPIPBASE
• Requires registration in the same way as for EW
• The same license manager
• The PowerPac libraries will be built with a special
compiler option tagging with LMS information
• ILINK will make the license control of by looking
for a module with the LMS tag
IAR PowerPac products
• For ARM
– PPARM-BASE: ~ USD 5000 per seat
– PPARM-SRC
~ USD 12000 per seat
– PPARM-USB-BASE
~ USD 2000 per seat
– PPARM-USB-SRC
~ USD 5000 per seat
– PPARM-TCPIP-BASE
– PPARM-TCPIP-SRC
IAR PowerPac - evaluation version
• Available in all EW product variants with the
following limitations:
– IAR PowerPac RTOS can create a maximum of three tasks
– IAR PowerPac File System can only handle one open file at any
given time
– IAR PowerPac USB has a time limit of 15 minutes on the
connection.
– IAR PowerPac TCP/IP has a time limit of 15 minutes on the
connection.
• Time limited version will be available with
EWARM 5.11
Why use a commercial RTOS ?
Proven code
Hard real time
Priority
controlled
Mulititasking
Costs
Shorter time
to market
Commercial RTOS?
Visualization
Universal
Documentation
Why use a commercial RTOS ?
• Proven code:
– Used by hundreds of users in a multiplicity of ways
– Continuously used and tested
– Developer can focus on application program instead of
wasting time on finding bugs
– Code is more organized
• Hard real-time:
– Zero latency
– Short interrupt latency
– Fast context switch
Why use a commercial RTOS ?
• Visualization:
– Kernel aware
debugging (plug-in)
• Documentation:
– In case of crew change: Well documented code/manual
– Technical support
– Makes porting to different hardware easier
Why use a commercial RTOS ?
• Shorter time to market:
– Reliability lets developer focus on application
– Training on RTOS takes less time than inventing it from
scratch
– Writing the documentation is very time consuming
• Costs:
– Less expensive than costs for developer when inventing
from scratch
– Less expensive when changing to a different processor
– Developers costs are higher than buying a commercial
RTOS
Objections to not choosing a commercial
RTOS
“My application does not benefit from
multitasking!”
• Timing more accurate
• Program structure easier
• Easy to add more components in future
• Mid-Size App: Smaller code
• Power savings
Objections to not choosing a commercial
RTOS
“We have our own, proprietary RTOS and it works
fine ! ”
• Is your RTOS well documented?
•
•
•
•
•
•
•
Portable to different CPU?
Crew change
Longer learning curve
Performance
Functionality?
Debugger integration?
Easier use of middleware
Objections to not choosing a commercial
RTOS
“We can not afford it !”
•
•
•
•
Cost less than compiler - no royalties
Shorter development time saves money
Shorter time too market
Better product
Objections to not choosing a commercial
RTOS
“I do not want to depend on anybody !”
• Source code available
• Less dependency on individual members of
development team
Objections to not choosing a commercial
RTOS
“I do not want to change the existing code!”
• The existing code can be easily integrated into a
single task and split into separate tasks later
• New code can benefit from the RTOS
Objections to not choosing a commercial
RTOS
“I do not have enough memory!”
• IAR PowerPac RTOS has a very small footprint –
about 2 Kbyte for a ARM7
Objections to not choosing a commercial
RTOS
“Using an RTOS makes things too complicated”
• Simple start project and BSPs
• Code can be modularized, making things easier to
maintain and debug
• Easier debugging C-SPY is kernel aware
• Guaranteed timing for high priority task takes
burden off developer
Objections to not choosing a commercial
RTOS
“My application requires hard real time, which an
RTOS can not deliver!”
• Not true:
– Zero latency for high priority interrupts
– Short interrupt latency
– Fast context switch
Objections to not choosing a commercial FS
“We write our own, proprietary File system”
•
•
•
•
•
Is your File system well documented?
Portable to different CPU?
Crew change?
Performance?
Functionality?
Objections to not choosing a commercial FS
“I have simple routines to read and write data”
• Do your routines support wear leveling?
•
•
Do your routines include an error correction algorithm?
What happens if you change to a different media type?
Summary
We offering:
• A tightly integrated RTOS, file system and communication
stacks – all tools for developing embedded applications
• Perfect compliment to IAR Embedded Workbench
• Innovative ”low-risk” price model
• Continious ”add-ons” for more middlewares
• Upgrade path
• Same license management system as IAR Embedded
Workbench
• Global technical support
Thank You!