Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is...

21
NDA required until November 11, 2008 The World Leader in High Performance Signal Processing Solutions Maikel Kokaly-Bannourah Embedded Systems Products &Technologies Group Analog Devices Inc. Migrating from VDK to μC/OS-III™ Real-Time Kernel for CrossCore® Embedded Studio

Transcript of Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is...

Page 1: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

NDA required until November 11, 2008

The World Leader in High Performance Signal Processing Solutions

Maikel Kokaly-BannourahEmbedded Systems Products &Technologies Group

Analog Devices Inc.

Migrating from VDK toμC/OS-III™ Real-Time Kernel for CrossCore® Embedded Studio

Page 2: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

Training Module Outline

What is µC/OS-III™ Real-Time Kernel for CrossCore® Embedded Studio?• Supported Features and Availability

Migrating from VisualDSP++ Kernel (VDK) to µC/OS-III™ Real-Time Kernel for CrossCore® Embedded Studio

• Features Comparison Table• Differences in Footprint

VDK to µC/OS-III™ Porting Guidelines• Including Live Porting Demo

µC/OS-II™ Real-Time Kernel for CrossCore® Embedded Studio• Main Differences with µC/OS-III™ and Availability

2

Page 3: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

What is µC/OS-III™ Real-Time Kernel for CrossCore® Embedded Studio?

μC/OS-III™ Real-Time Kernel for CrossCore® Embedded Studio is the result of a partnership between Analog Devices and Micrium

Provides user-friendly programming environment for μC/OS-III™ applications running on Analog Devices' Blackfin® and SHARC® processors

Integrated environment with CCES, offering the advantage of an industry-standard IDE combined with Analog Devices' advanced optimizing compiler technology

3

Page 4: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

µC/OS-III™ Real-Time Kernel for CrossCore® Embedded Studio Features

Supported features include:• Seamless integration with CrossCore® Embedded Studio• Processor independent interface

• Supporting both SHARC® and Blackfin® processors

• Scalable to contain only required features• Supports pre-emptive and co-operative scheduling, including round-robin scheduling• Provides inter-task messaging support• Ability to pend on multiple kernel objects• Configurable error checking to reduce footprint and MIPS• ANSI C source code

For more information, visit:• http://www.analog.com/ucos3

4

Page 5: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

Migrating from VDK to µC/OS-III™

Processor Family

VisualDSP++® Kernel (VDK)

µC/OS-III™ for CrossCore® Embedded Studio

BF5xx1

21xxx1

TSxxx

BF6xx

Next Gen

5

1 CrossCore® Embedded Studio supports all Blackfin® and SHARC® processors, with theexception of ADSP-BF535 and ADSP-210xx processors

Page 6: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

Features Comparison Table: VDK vs. μC/OS-III™ (1 of 3)

Feature VisualDSP++® Kernel (VDK) μC/OS-III™ for CCES

Pre-emptive Multitasking Yes Yes

Maximum Number of Tasks Limited only by memory Limited only by memory

Maximum Number of Priorities 31 Configurable

Number of Tasks at each Priority Level Unlimited Unlimited

Round Robin Scheduling Yes (Specified per priority level) Yes (Specified per task)

Task Yield Yes No

Task Suspend/Resume No Yes

Stack Overflow Detection Support Yes No (Release 1.0.x)

Task-specific Semaphores No Yes

Semaphores Yes Yes

Mutex (Nestable) Yes Yes

Mutex Priority Inheritance No Yes

6

Page 7: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

Features Comparison Table: VDK vs. μC/OS-III™ (2 of 3)

Feature VisualDSP++® Kernel (VDK) μC/OS-III™ for CCES

Event Flags / Event Groups Yes Yes

Message Queues Task-specific only Task-specific and application-wide

Multi-core Messaging Yes (via shared memory and link ports) Yes (via shared memory using MCAPI)

Fixed Sized Memory Management Yes (memory pools) Yes (memory partitions)

Thread Local Storage Yes Yes

Software Timers No Yes

Pend on Multiple Objects No Yes

Built-in Performance Measurements No Yes

User Definable Hook Functions No Yes

RTOS Memory Allocation Dynamic (Malloc/Free) Static

C Written Interrupt Handlers Yes Yes (adi_int)

7

Page 8: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

Features Comparison Table: VDK vs. μC/OS-III™ (3 of 3)

Feature VisualDSP++® Kernel (VDK) μC/OS-III™ for CCES

Error checking Globally (ON/OFF) Customizable

Error management Yes (via Thread Error Function) Yes (via API Return Value)

Configuration GUI Yes Yes

RTOS Debug Window Yes Yes

Delivery Method Pre-built Libraries (no source code) Source Code

System Services Integration Yes Yes

MISRA-C:2004 No (Written in C++) Yes

Certifiable (DO178B Level A etc)

No Yes

8

Page 9: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

Footprint Comparison Table: VDK vs. μC/OS-III™

Footprint (Bytes) Code Data Total

VDK μC/OS-III™ VDK μC/OS-III™ VDK μC/OS-III™

ADSP-21469 19084 20196 2200 9865 21284 30061

ADSP-BF533 11168 8922 2216 7760 13384 16682

9

VDK Dynamic vs. μC/OS-III™ Static Data Allocation

Page 10: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

VDK to µC/OS-III™ Porting Guidelines

Considerations when porting code from VDK to µC/OS-III™ • Integrated µC/OS-III™ Add-in for CrossCore® Embedded Studio• CrossCore® Embedded Studio Interrupt Handler: adi_int.h• Error Management in µC/OS-III™ • µC/OS-III™ Debug Features• Use of MCAPI® for Inter-Core Communication

Porting Experience based on a VDK Example Project• Live Porting Demo!

10

Page 11: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

Integrated µC/OS-III™ Add-in for CrossCore® Embedded Studio

11

Page 12: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

CrossCore® Embedded Studio Interrupt Handler: adi_int.h

CrossCore® Embedded Studio provides new interrupt handling APIs and macros through the header file adi_int.h

• adi_int_InstallHandler• Used to install an interrupt handler for a given interrupt

• adi_int_EnableInt• Enables or disables the specified interrupt

• adi_int_UninstallHandler• Uninstalls the interrupt handler and disables the source and interrupt

This same interrupt handler can be used for:• Blackfin and SHARC Processors• RTOS and non-RTOS Applications

12

Page 13: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

Error Management in µC/OS-III™

Most µC/OS-III™ API functions return an error code• The error return value is done through the last argument of the API function, as a pointer to an

error code

IMPORTANT NOTE: error codes should be checked by the application to ensure that the µC/OS-III™ function performed its operation as expected!

13

µC/OS-IIIVDK

Page 14: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

µC/OS-III™ Debug Features

CrossCore® Embedded Studio provides an RTOS Status view to observe the status of components of the µC/OS-III™ Real-Time Operating System

Under the Debug Perspective, select: • Window > Show View > Other > Debug > RTOS Status

User definable μC/OS-III Hooks allow you to extend the RTOS debugging capabilities

• …/system/uCOS-III/AppSources/os_app_hooks.c

14

Page 15: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

Inter-Core Communication Enabled by MCAPI®

CrossCore® Embedded Studio includes MCAPI® support for communication and synchronization in multi-core devices

Ideally suited for applications, which divide their processing and/or functionality across multiple cores, eliminating dependence on proprietary APIs

Single-core processors can also benefit from MCAPI® for multi-threaded applications, since it provides inter-thread communication facilities

For more info, visit: • http://www.multicore-association.org/workgroup/mcapi.php

15

Page 16: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

CrossCore® Embedded Studio MCAPI® Add-in

16

Page 17: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

Live Porting Demo

17

Page 18: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

µC/OS-II™ Real-Time Kernel for CrossCore® Embedded Studio Also Available!

In addition to µC/OS-III™, µC/OS-II™ is also available supporting Blackfin® and SHARC® processors!

µC/OS-II™ features include:• Mature and well established user base

• µC/OS-II™ initially released in 1999 vs. µC/OS-III™ release in 2009

• Certification already available• DO178B Level A, EUROCAE ED-12B, SIL3/SIL4 IEC, IEC-

61508,…

• Smaller footprint

Main limitations in comparison with µC/OS-III™:• Supports only one task per priority • Limited number of tasks and signals

For more information, visit:• http://www.analog.com/ucos2

18

Page 19: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

Features Comparison Table: μC/OS-II™ vs. μC/OS-III™ (1 of 2)

Feature µC/OS-II™ µC/OS-III™

Maximum number of tasks 255 Unlimited

Number of tasks at each priority level 1 Unlimited

Round robin scheduling No Yes

Mutual exclusion semaphores Yes Yes (Nestable)

Message mailboxes Yes No (not needed)

Signal a task without requiring a semaphore No Yes

Option to post without scheduling No Yes

Send messages to a task without requiring a message queue No Yes

Task suspend/resume Yes Yes (Nestable)

Code footprint (Blackfin Processors) 6KB – 12KB 8KB – 15KB

Data footprint (Blackfin Processors) 5KB – 8KB 7KB – 10KB

19

Page 20: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

Features Comparison Table: μC/OS-II™ vs. μC/OS-III™ (2 of 2)

Feature µC/OS-II µC/OS-III

Run-time configurable No Yes

Built-in performance measurements Limited Extensive

Time stamps on posts No Yes

Tick handling at task level No Yes

MISRA-C:1998 Yes N/A

MISRA-C:2004 No Yes

DO178B Level A and EUROCAE ED-12B Yes Certifiable

Medical FDA pre-market notification (510(k))and pre-market approval (PMA) Yes Certifiable

SIL3/SIL4 IEC for transportation and nuclear systems Yes Certifiable

IEC-61508 Yes Certifiable

20

Page 21: Migrating from VDK to μC/OS-III™ Real-Time Kernel for ... fileTraining Module Outline What is µC/OS -III™ Real- Time Kernel for CrossCore® Embedded Studio? • Supported Features

For More Information

µC/OS-III™ Real-Time Kernel: www.analog.com/uCOS3µC/OS-II™ Real-Time Kernel: www.analog.com/uCOS2CrossCore® Embedded Studio: www.analog.com/CCESAnalog Devices Video Channel: videos.analog.com Processors and DSP Website: www.analog.com/ProcessorsEngineerZone Support Community: http://ez.analog.com/

21