MDK_411_full_presentation

Download Report

Transcript MDK_411_full_presentation

Development Tools
for ARM-Powered Devices
MDK-ARM Microcontroller Development Kit
ULINK Adapters
Evaluation Boards
May 2010
1
Agenda
 Introduction and Overview
 Keil MDK-ARM Microcontroller Development Kit
 µVision4 Integrated Development Environment
 ARM Compilation Tools
 Verification and Debug
 Complete device simulation
 Analysis tools
 CoreSight Debug & Trace
 Hardware Components
 ULINK USB-JTAG Adapters
 Evaluation Boards
2
Keil Microcontroller Tools
 Leading supplier of MCU development tools
 ANSI C/C++ compilers, Debuggers
 Device simulation
 Middleware components
 Extensive Device Database®
 >1,870 8/16/32 bit MCUs
 Established support
 Web support portal
 User group structure
 Global distribution network
 Huge installed base
 100K+ users world wide
3
Software Development Tools
4
MDK-ARM
 Complete software development environment
Examples and Templates
 For ARM7/9 and Cortex-R4 MCU devices
 Any Cortex-M embedded system
MDK-ARM
Microcontroller Development Kit
 Easy to learn and easy to use
ARM C/C++ Compiler
 Industry leading technology
 ARM Compiler
RTX RTOS Kernel Library
 Keil µVision IDE / Debugger
µVision
Complete
device
support

Device Database & IDE
 Start-up code & Flash algorithms
µVision
Debugger & Analysis Tools
 Board support packages (BSPs)
 Extensive library of example code
Device Peripheral Simulation
 RTX Real-Time Kernel
 Full-feature RTOS Kernel for embedded systems
5
RL-ARM
 Extensive library of ready-to-use middleware components
6
RL-ARM
Real-Time Library
RTX RTOS Source Code
TCPnet Networking Suite
Flash File System
USB Device Interface
CAN Interface
Examples and Templates
 Speed up software development
 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
Hardware Components
 Range of evaluation boards and debug hardware
 Verify application running on hardware target
 ULINK family of USB Adapters
 Debug and Flash programming
 JTAG and SWD support
 Hi-Speed Streaming Trace
 Evaluation Boards
 ARM7/9 and Cortex-M
 Numerous MCU vendors
 NXP, ST, Toshiba
 Nuvoton, Triad, TI
7
MDK-ARM
Microcontroller Development Kit
MDK-ARM
Microcontroller Development Kit
RTX RTOS Kernel Library
µVision
Device Database & IDE
µVision
Debugger & Analysis Tools
Device Peripheral Simulation
8
Examples and Templates
ARM C/C++ Compiler
µVision4 IDE
 Industry-leading IDE for MCU and smartcard devices







9
Common to ARM, C166, and 8051 platforms
Includes target device configuration and Device Database
Source code editor
High speed simulation
Project debugging
Powerful analysis tools
Flash programming
µVision4 Ease of Use
 Device Database
 Directory of over 670 supported ARM MCUs
 Enables quick selection of device
 In µVision for easy project creation
 Also online, with parametric search
 Device Configuration
 Start-up code for effortless device setup
 Configuration Wizard helps to configure
device parameters
 Examples and Templates
 Fast out-of-box experience
 Can be used as a base for user project
 BSPs for numerous boards
10
MDK-ARM
Compilation Tools
MDK-ARM
Microcontroller Development Kit
RTX RTOS Kernel Library
µVision
Device Database & IDE
µVision
Debugger & Analysis Tools
Device Peripheral Simulation
11
Examples and Templates
ARM C/C++ Compiler
ARM Compilation Tools
 Best-in-class compilation tools
 Architecture-specific optimisations enable applications to run faster
 Small code size reduces system cost
 The ARM Compilation tools contain:
 Highly-optimizing ISO C/C++ compiler
 Supports ARM, Thumb and Thumb2 Instruction sets including FPU
 Full C and C++ run-time library support
 MicroLib optimized C Libraries
 Superset of standard ARM C Library
 Optimized for embedded applications


Un-used functions removed from memory footprint
Minimal overhead for un-used OS functions
 Faster system bring-up

12
Most functions initialized at point of use
MicroLib – Optimized for Embedded
 Reduces system code size by 50% to 90%
Library Totals
RO Totals
51%
63%
Processor
ARM7TDMI
ARM7TDMI
Cortex-M0
Cortex-M3
Object
ARM
Thumb
Thumb
Thumb-2
Standard
MicroLib
% saving
Library Total
21,352
8,980
61%
RO Total
25,608
12,816
51%
Library Total
17,156
6,244
57%
RO Total
20,129
9,348
50%
Library Total
16,452
5,996
64%
RO Total
19,472
9,016
54%
Library Total
15,018
5,796
63%
RO Total
18,616
8,976
54%
Based on Dhrystone 2.1 Benchmark
13
Improved Performance in MicroLib v4.1
 Complete re-optimization of the floating point library
 Improved performance for both Cortex-M3 and Cortex-M0
 Fewer cycles required per call
 Single precision add/subtract are now 2x faster
 Conversion functions are now 3x faster
 fadd is 2x faster, i2f is 3x faster, dmul is 6x faster
2x
14
3x
6x
10x
MDK-ARM
Verification and Debug
MDK-ARM
Microcontroller Development Kit
RTX RTOS Kernel Library
µVision
Device Database & IDE
µVision
Debugger & Analysis Tools
Device Peripheral Simulation
15
Examples and Templates
ARM C/C++ Compiler
µVision Application Verification
 High speed simulator
 Complete of simulation of instruction set, peripherals and interfaces
 Verify your application before hardware is available
 Target debugger
 Connect target hardware to µVision debugger
 BSP for evaluation boards from many vendors
 Test actual behaviour of application on targeted device
 Powerful analysis tools
 Monitor signals and variables in your application
 Logic Analyzer, Code Coverage, and Execution Profiling
 Quickly identify and fix bottlenecks for improved performance
 Supported by simulator and target debugger
16
System Viewer Windows
 Displays contents of device’s peripheral registers
 Detailed status information is available
 Change register values directly from the window
 Flexible views
 Window can show registers

17
from one or multiple peripherals
Can open multiple windows
during a debug session
Kernel-Aware Debugging
 Analysis of RTOS tasks and events while the application runs
 Enabled by tight integration of RTX Kernel with µVision
 Monitoring of system resources
 Understand how your application interacts with the Kernel
 Optimize your application to make better use of resources
18
MDK-ARM
CoreSight Debug and Trace
MDK-ARM
Microcontroller Development Kit
RTX RTOS Kernel Library
µVision
Device Database & IDE
µVision
Debugger & Analysis Tools
Device Peripheral Simulation
19
Examples and Templates
ARM C/C++ Compiler
Run-Stop Debugging has Limitations
 Stopping code execution changes system behaviour
 Execution timing cannot be analyzed
 Not servicing interrupts may have catastrophic results
 Buffers may overrun or connected hardware gets no service
 Many practical problems result from a run-stop debugging
 Communications systems get into timeout state
 Motor controllers freeze with high current state
20
CoreSight Introduction
 Debug and trace technology in Cortex-M devices
 On-the-fly debugging
 Debug application while the processor is running
 Set breakpoints, read/write memory locations
 Direct access to memory, no need to go through processor
 Increased number of watchpoints
 Flexible trace options
 Integrated Data Trace
 Optional Instruction Trace (ETM)
 Reduced pin count interface
 2-pin Serial Wire Debug (SWD)
 1-pin Serial Wire Viewer (SWV)
 Uses standard JTAG connectors
 Supported in MDK-ARM and ULINK family of adapters
21
CoreSight™ Debug Technology (Cortex-M)
Instruction Stream for
Code Execution Analysis,
Time Profiling, Code Coverage
Start, Stop, and Single-step
User Program
Application Trace
Information:
Debug printf,
RTOS nfo,
Unit Test,
UML Annotation
8 Hardware
Breakpoints in
User Program
Data Trace or
Access Breakpoints
for 4 Variables
On-the-Fly (while
User Program runs)
read/write access
to Variables and
Memory Contents
Timing Information
PC Sampling,
Event Counters,
Interrupt Execution
JTAG (5-pin) or
Serial Wire (2-pin
+ 1 trace pin)
ITM, DWT Output via
1 serial trace data pin
(UART or Manchester Mode)
ITM, DWT, ETM
Output via
4 trace data pins
+ 1 clock pin
Trace (ETM, ITM, DWT) not available on Cortex-M0
22
CONFIDENTIAL
Debug and Trace Connectors
20-pin (0.1”) or 10-pin (0.05”) Connector
 Identical Debugging capabilities
Support 2 Operating Modes:
20-pin (0.1”) ARM JTAG
10-pin (0.05”) Cortex Debug
 Standard 5-pin JTAG mode (device chaining)
 Serial CoreSight mode


20-pin (0.05”)
Cortex Debug+ETM
2-pin Serial Wire Debug (SWD)
1-pin Serial Wire Trace Output (SWO) for
Data Trace at minimum system cost
20-pin (0.05”) Debug+ETM Connector
 Superset of 10-pin 0.05” Connector

Adds 4 (trace data) +1 (trace clock) pins
for high-speed Data + Instruction Trace in
any operating mode (JTAG or SWD)
More Information: www.keil.com/coresight/connectors.asp
23
Cortex-M CoreSight Offers Simple Solutions
 #1: Direct memory access to running system





Native support in the debugger interface
Values updated dynamically
In-place editing of live variables
Set breakpoints while system is running
No software overhead, no extra hardware,
works with any Cortex-M device
 #2: printf-style output via an ITM Channel
 Output details to a debug console
 Uses CMSIS standard interface
 Intrusive (the debug printf is a routine that
adds to execution time and needs memory),
but can be shipped within the end product
24
Trace Records (DWT + ITM)
 Trace Records display program flow
 Capture timestamp, PC sample, and Read/Write accesses
 Time delay and lost cycles are noted
 Raw trace data from all trace sources
 Filter window to refine the view
 Updated while
target system
is running
25
Instrumented Trace (ITM)
 32 ITM channels: write to memory location creates trace data
 Channel 0: for printf-style debug information
 Channel 31: for RTX event viewer
 Remaining ITM channels for user data output
// Output 32-bit variable
// to ITM channel 1
ITM->PORT[1].u32 = value;
A write operation to an ITM
channel memory location
creates a trace record with
output value, time stamp,
and program location.
26
Exception and Interrupt Trace (DWT)
 Statistical information about exceptions and interrupts
 Captures detailed information
 Name and number of exception; number of times entered
 Max and Min time spent in and out of exceptions
27
Event Counters (DWT)
 Display real-time values of specific event counters
 Provide performance indications
 Extra cycles taken to execute instructions
 May be due to memory contentions (Flash waitstates)
 Cycles of overhead caused by handling exceptions
 Cycles spent in sleep mode
 Number of cycles spent

28
performing memory accesses
Number of folded branch
instructions
Logic Analyzer (DWT)
 Allows signals to be monitored graphically
 Monitor variables in the application
 Accurate timing
 Easy, fast analysis of signal timing with access to source code
 View delta changes from
cursor to current location
 Code analysis
 View instruction that
caused variable change
29
Instruction Trace (ETM)
 Execution history of all executed instructions
 Instruction Trace window displays: cycle count (timing) and assembly
code synchronized to the C source code.
 Instruction Trace is useful to analyze sporadic problems
 Data corruption by incorrect interrupt/thread protection
 Incorrect timing caused by interrupt/thread nesting
30
Sporadic Data Problem (ETM)
void Alert (void) {
// Alarm Function
if (clock.min != 59 &&
// Validate Time
clock.hour != 12) {
debug_printf ("System Should never be there");
}
}
void CheckAlert (void) {
if (clock.min == 59 &&
clock.hour == 12)
Alert ();
// check for alarm at 12:59
// check minute for 59
// check hour for 12
// call Alarm Function
{
:
Instruction Trace shows Interrupt Execution
within the compare statement
31
Code Coverage (ETM)
 Complete software validation requires code coverage
 Product liability and industry standards (IEC61508) demand for testing
according to “State of Science and Technology” methodologies
 ETM enabled devices provide complete instruction stream
 Non-intrusive - use final, optimized code at full speed
 Feedback provided directly in the debugger window
 Source & disassembly view
 Color-coded details for

individual instructions
Summary analysis by
function or module
 Log File Support
 Coverage information can
be saved for documentation
32
Execution Time Profiling and Analysis (ETM)
 Instruction Trace provides timing information
 Identify where most time is spent in your application
 Isolate problems by finding which C statements take
longer than expected
to execute
33
Debug and Trace Units
34
Debug and Trace Adapters
ULINK2: Debug + Serial Wire Trace
 Flash Programming + Run-Control
 Memory + Breakpoint (access while running)
 Serial Wire Trace Capturing up to 1Mbit/sec
(UART mode)
ULINKpro: adds ETM + Streaming Trace
 Cortex-M processors running up to 200MHz



50MHz JTAG clock speed
Serial Wire Trace Capturing up to 100Mbit/sec
(Manchester Mode)
ETM Trace Capturing up to 800Mbit/sec
 Virtually un-limited Trace Buffer

35
Streaming Trace allows contiguous
Code Coverage and Performance Analysis
ULINKpro Debug and Trace Unit
 Features







Debug via JTAG interface for ARM7/9 and Cortex-M
Serial Wire Debug (SWD) for Cortex-M
Serial Wire Viewer (SWV) data trace for Cortex-M
Instruction trace (via ETM) for Cortex-M
Data streaming direct to host PC
Cortex-M processors running up to 200MHz
Connectors:
 20-pin 0.10“ JTAG
 10-pin 0.05“ Cortex Debug
 20-pin 0.05“ Cortex Debug+ETM
 Performance
 50MHz JTAG clock speed
 1MB/s memory read/write
36
What is Streaming Trace?
 Trace data transferred in




real-time to debug host
Capture size only limited by host
resources (hard disk)
Trace for minutes, hours, or longer
Required for full code-coverage
and timing analysis
Today’s workstations can present
trace data instantly
37
ULINKpro Benefits
 Performance Analysis
 Dynamic analysis of running application
 Identify program bottlenecks and optimize your application
 Code Coverage
 Easily prove complete testing of application where required
 Quickly determine where to improve your testing strategy
 Execution History
 Find bugs which cause failures long after the event
 Streaming Trace
 No trace buffer removes risk of overflow and lost data
 Analyze large sections of code and observe true behaviour
38
Comparison of debug and trace units
ULINKpro
ULINK2
ULINK-ME
CPU Clock speed
200MHz
200MHz
200MHz
JTAG Clock speed
50MHz
10MHz
10MHz
Memory read/write
1MByte/s
25KByte/s
25KByte/s
-
1Mbit/s
1Mbit/s
Data Trace streaming (Manchester mode)
100Mbit/s
-
-
ETM Trace streaming
800Mbit/s
-
-
Features
Run control debug (ARM 7/9 and Cortex-M)
Memory + Breakpoint (while running)
Data trace (Cortex-M)
ETM Instruction Trace (Cortex-M)
Performance
Data Trace streaming (UART mode)
Analysis Tools
Logic Analyzer
Performance Analyzer
Execution Profiling
Code Coverage
39
MDK-ARM
RTX Real-Time Kernel
MDK-ARM
Microcontroller Development Kit
RTX RTOS Kernel Library
µVision
Device Database & IDE
µVision
Debugger & Analysis Tools
Device Peripheral Simulation
40
Examples and Templates
ARM C/C++ Compiler
Why use a Real-Time Kernel?
 Structured framework for embedded applications
 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
41
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, Pre-emptive, Round Robin
 System Friendly
 Consumes small amount of system resource
 Proven kernel
 Low cost
42
Real-Time?
 Real-Time does not simply mean High Speed
 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
43
RTX Real-Time Kernel
 Full-featured real-time kernel for embedded systems
 Process Management
 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)
44
RTX Specifications
 Provides all real-time kernel requirements
 Multi-tasking: Round Robin, Pre-emptive, Cooperative
 Unlimited: User Timers, Semaphores and Mailboxes
 Royalty-free
Memory Requirements
Task Specifications
Priority levels
256
CODE Space
Bytes
1.5K – 5K
(depending on used functionality)
No. of Tasks Defined
No. of Active Tasks
Unlimited
256
Context Switch
< 300 Cycles
Interrupt Latency
< 100 Cycles
45
RAM Space
(each active task requires its own stack space)
< 500
RTX Performance
Task Specifications
46
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 ISR’s
3.1µS
-
RTX Benefits I
 Commercial level RTOS at no additional cost
 Full feature RTOS, included in MDK-ARM
 No Royalty fees or other on-going costs
 Short learning curve for increased productivity
 Fully integrated into µVision IDE and Debugger
 RTX kernel-aware tools enable easy configuration and debug
 Developed specifically for embedded systems
 Uses minimum system resources
 Fast operation, with memory footprint as small as 5KB
 Flexible scheduling
 Choose the best kernel scheduling option for your application
 Pre-emptive, Round Robin, or Co-operative
47
RTX Benefits II
 Deterministic behaviour
 Events and interrupts handled within a pre-defined time
 Reliable behaviour for time-critical applications
 Source code available
 RL-ARM provides full source code for RTX
 Useful when certification is required
 Market leading RTOS
 Top 5 in EETimes 2010 Embedded Market OS survey
48
Market Leading RTOS
 Consistently one of the top ranked RTOS
49
Starter Kits
50
Evaluation Boards
 Proven hardware for quick development and debug
 Designed for easy set-up
 Extensive program examples
 Available as starter kits
 Evaluation version of MDK-ARM
 ULINK-ME adapter
STMicro STM32C
(Cortex-M3)
51
Nuvoton NUC1xx
(Cortex-M0)
NXP LPC2929
(ARM968E-S)
Get More Information
 Customers use www.keil.com on a daily basis to obtain






52
Program examples
Latest technical information
Support Knowledgebase
Application Notes
Device Database
Discussion Forum
Summary
 Out-of-box user experience
Examples and Templates
MDK-ARM
 Easy to learn and use
Microcontroller Development Kit
 Device Database and Startup code
ARM C/C++ Compiler
 Industry-leading tools
RTX RTOS Kernel Library
 µVision IDE
µVision
 ARM Compilation tools
Device Database & IDE
 Advanced verification and debug
µVision
Debugger & Analysis Tools
 Sophisticated analysis tools
Device Peripheral Simulation
 Code Coverage and Profiling
 Hardware components
 Complete the testing cycle by running on target hardware
 Complete solution for developing embedded applications
 ARM7/9 & Cortex-R4 MCU devices, and Cortex-M systems
53