getstart.book page i friday, april 25, 2003 11:55 am...

56
2.2.1 Tornado Getting Started Guide WINDOWS VERSION ®

Upload: others

Post on 14-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

2.2.1

Tornado

Getting Started Guide

WINDOWS VERSION

®

getStart.book Page i Friday, April 25, 2003 11:55 AM

Page 2: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Copyright 2003 Wind River Systems, Inc.

ALL RIGHTS RESERVED. No part of this publication may be copied in any form, byphotocopy, microfilm, retrieval system, or by any other means now known or hereafterinvented without the prior written permission of Wind River Systems, Inc.

Wind River, the Wind River logo, Tornado, and VxWorks are registered trademarks ofWind River Systems, Inc. Any third-party trademarks referenced are the property of theirrespective owners. For further information regarding Wind River trademarks, please see:

http://www.windriver.com/company/terms/trademark.html

Corporate HeadquartersWind River Systems, Inc.500 Wind River WayAlameda, CA 94501-1153U.S.A.

toll free (U.S.): (800) 545-WINDtelephone: (510) 748-4100facsimile: (510) 749-2010

For additional contact information, please visit the Wind River URL:

http://www.windriver.com

For information on how to contact Customer Support, please visit the following URL:

http://www.windriver.com/support

Tornado Getting Started Guide, 2.2.1 (Windows Version)

25 Apr 03Part #: DOC-15098-8D-00

getStart.book Page ii Friday, April 25, 2003 11:55 AM

Page 3: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

iii

Contents

Documentation Guide .............................................................................................. v

Introduction ........................................................................................ vPrinted Documentation ..................................................................... vList of Documents .............................................................................. viAccessing Online Documentation ................................................... viiiContent Overview .............................................................................. ixRelease and Migration Information ................................................ ixTornado IDE and Tools ...................................................................... xVxWorks Operating System ............................................................. xiGNU Compiler and Tools ................................................................. xiiiDiab C/C++ Compiler and Tools .................................................... xiiiDocumentation Conventions ........................................................... xiv

1 Overview ................................................................................................................... 1

1.1 Introduction ...................................................................................................... 1

1.2 Terminology and Conventions ....................................................................... 2

2 Installation and License Management .................................................................... 3

2.1 Overview ........................................................................................................... 3

2.2 Installing Tornado and Related Products ..................................................... 3

Host System Requirements .............................................................. 3Installation Media .............................................................................. 4Installation Keys ................................................................................. 4

getStart.book Page iii Friday, April 25, 2003 11:55 AM

Page 4: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

iv

License Management ........................................................................ 4Restricting Group Usage in a Solaris Environment ...................... 5Running SETUP ................................................................................. 6Setting Environment Variables ........................................................ 8Running Tornado ............................................................................... 10Uninstalling Tornado ........................................................................ 11

2.3 Installing and Administering a License Server ........................................... 12

Installing and Configuring a License Server ................................. 12Administering a License Server ...................................................... 12UNIX License Server Lock File Permission Issues ....................... 14Getting Help With License Management ....................................... 14

3 Tornado Tutorial ........................................................................................................ 15

3.1 Introduction ...................................................................................................... 15

3.2 Start Tornado .................................................................................................... 16

3.3 Create a Project ................................................................................................. 18

3.4 Add the Sample Source File to the Project ................................................... 22

3.5 Build the Project ............................................................................................... 24

3.6 Download the Project to the VxWorks Target Simulator ........................... 26

3.7 Run the Application from the Tornado Shell ............................................... 29

3.8 Examine Target Memory Consumption ....................................................... 31

3.9 Examine Task Activity ..................................................................................... 32

3.10 Fix Task Priorities and Find the Next Bug .................................................... 35

3.11 Fix the Last Bug and Take it for a Spin ......................................................... 37

3.12 What Next? ....................................................................................................... 40

getStart.book Page iv Friday, April 25, 2003 11:55 AM

Page 5: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

v

Documentation Guide

Introduction

This guide to Tornado 2.2.1 documentation provides an overview of thedocumentation, which includes:

■ how to obtain printed books

■ a list of documents and available formats

■ how to access documents online

■ a content overview

■ documentation conventions

Printed Documentation

This release of Tornado is shipped with printed versions of the Tornado ReleaseNotes, the Tornado Getting Started Guide (for Windows or UNIX), the GNU Toolchainfor Tornado 2.2 Release Notes, and the Diab Release Notes, 5.0.3 (for ColdFire, or forother architectures when purchased as an optional product).

The full documentation set for this release is shown in Table 1. Please refer to theflyer entitled “Obtaining Your Printed Manuals” in your software shipment forinformation on obtaining the printed books that are part of your purchase. Booksare distributed through the online Wind River bookstore located at:

http://www.windriver.com/windsurf/bookstore/

getStart.book Page v Friday, April 25, 2003 11:55 AM

Page 6: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

vi

The Wind River Bookstore is a Web-based store that allows you to order Tornadodocumentation at any time. It is accessible to anyone with a Wind River OnlineSupport account.You can also use the bookstore to purchase additional copies ofbooks.

List of Documents

Tornado product documentation is provided in several different formats: HTML,PDF, and print.Table 1 lists the core documentation set and the format in whicheach document is available.

Table 1 Core Documentation Set for Tornado 2.2.1/VxWorks 5.5.1

Document HTML PDF Print

CD-ROM File System for VxWorks 5.5.1 Programmer’sSupplement

X

GDB User's Guide X

GNU Toolchain for Tornado 2.2 Release Notes X* X

GNU ToolKit User's Guides (for ARM, MIPS, Pentium,PPC, simulators, MC68K, and SH)

X

GNU Make User's Guide X

GNU Binary Utilities User’s Guide for ColdFire X

Diab C/C++ Compiler for Coldfire User's Guide X X X

Diab C/C++ Compiler for PowerPC User's GuideDiab C/C++ Compiler for ARM User's GuideDiab C/C++ Compiler for MIPS User's Guide(for use with Diab optional products)

X X X

Diab Release Notes (ColdFire and Diab optional products) X* X

Tornado Release Notes X* X

Tornado API Programmer's Guide X X X

Tornado API Reference X

Tornado Getting Started Guide, Windows Version X X X

Tornado Migration Guide X*

getStart.book Page vi Friday, April 25, 2003 11:55 AM

Page 7: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Documentation Guide

vii

Tornado Tools Reference X

Tornado User's Guide, Windows Version X X X

Tornado SETUP SDK Developer's Guide X*

VxWorks OS Libraries API Reference† X X X

VxWorks Drivers API Reference† X X X

VxWorks Errno Code List X

VxWorks BSP Developer's Guide X X

VxWorks BSP Reference X

VxWorks for 68K/CPU32 Architecture Supplement X X X

VxWorks for ARM Architecture Supplement X X X

VxWorks for ColdFire Architecture Supplement X X X

VxWorks for Hitachi SuperH Architecture Supplement X X X

VxWorks for Intel XScale/StrongARM Architecture Supplement X X X

VxWorks for MIPS Architecture Supplement X X X

VxWorks for Pentium Architecture Supplement X X X

VxWorks for PowerPC Architecture Supplement X X X

VxWorks Network Programmer's Guide X X X

VxWorks Programmer's Guide X X X

WindView User's Guide X X X

WindView User's Reference X X X

* PDF not on the product CD; available only from Wind River Online Support.† Formerly provided in the VxWorks Reference Manual.

Table 1 Core Documentation Set for Tornado 2.2.1/VxWorks 5.5.1

Document HTML PDF Print

getStart.book Page vii Friday, April 25, 2003 11:55 AM

Page 8: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

viii

Accessing Online Documentation

Online Help

Help buttons in every Tornado dialog box and the Help menu on the menu barprovide information on the Tornado component you are currently executing. Inaddition, from the shell, you can hot-key to the reference entries for VxWorksroutines.

HTML

HTML versions of the documentation are available from the Tornado IDE menu atHelp>Manuals Contents. You can also view the HTML by openinginstallDir\docs\books.html in a Web browser.

PDF

PDF versions of most of the books in the Tornado 2.2.1 documentation set, as wellas the Diab compiler guides, are provided in installDir\SETUP\DOCS. They arealso available in the DOCS directory at the root of the Tornado core product CD,accessible from your CD-ROM drive. PDF versions of the documentation are alsoavailable from Wind River Online Support:

http://www.windriver.com/windsurf

Support

Support information specific to Tornado 2.2.1 is available at:

http://www.windriver.com/support/resources/tornado22_bulletin.html

getStart.book Page viii Friday, April 25, 2003 11:55 AM

Page 9: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Documentation Guide

ix

Content Overview

Documentation for Tornado falls into the following general categories:

■ release and migration information■ Tornado IDE and tools■ VxWorks operating system■ GNU compiler and tools■ Diab compiler and tools

Each of these categories is described in this chapter. Online documentation anddocumentation conventions are also discussed.

Release and Migration Information

Tornado Release Notes

The Tornado Release Notes contain the latest list of supported hosts and targets, aswell as information on compatibility with older releases, an outline of newfeatures, and any caveats concerning the current release.

Tornado Migration Guide

The Tornado Migration Guide contains information designed to help VxWorksdevelopers in moving from Tornado 2.2.x and VxWorks 5.4.x to Tornado 2.2.1 andVxWorks 5.5.1

GNU Toolchain Release Notes

The GNU Toolchain Release Notes contain information about changes made to theGNU toolchain since the Tornado 2.0 release.

Diab Release Notes

The Diab C/C++ Release Notes contain information about changes made to the Diabcompiler suite since the Diab 4.4 release.

Tornado Web Page

A Tornado 2.2.1/VxWorks 5.5.1 product information Web page is available at:http://www.windriver.com/support/resources/tornado22_bulletin.html

getStart.book Page ix Friday, April 25, 2003 11:55 AM

Page 10: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

x

Tornado IDE and Tools

Tornado Getting Started Guide

The Tornado Getting Started Guide (this manual) provides instructions on installingTornado and other Tornado products, as well as tutorial introductions to both theTornado tools and VxWorks.

Tornado User’s Guide

The Tornado User’s Guide is the central document for the Tornado IDE. It includes:

■ A global overview of Tornado and its capabilities.

■ Instructions on how to configure your environment and set upcommunications with a target system.

■ The Tornado development environment and its major interactive features—simulator, editor, project facility, target server management, shell, browser,and debugger.

■ Command-line tools for project creation and debugging.

■ COM and DCOM.

■ Customizing Tornado.

■ Tornado directories and files, the use of Tcl (Tool Command Language) inTornado, and reference information for host tools.

■ Wind River coding conventions.

Tornado API Programmer’s Guide

The Tornado API Programmer’s Guide is for developers who wish to extend theTornado development environment. It contains descriptive information about:

■ The run-time agent.

■ Its host-system counterpart, the target server.

■ The WDB protocol that supports the target agent and target server.

■ The WTX C and Tcl protocols used by the Tornado tools to communicate withthe target server.

■ Client Component Architecture (CCA), which is the new architecture of theTornado IDE.

getStart.book Page x Friday, April 25, 2003 11:55 AM

Page 11: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Documentation Guide

xi

Tornado API Reference

The Tornado API Reference is the reference companion to the Tornado APIProgrammer’s Guide.

Tornado Reference

The Tornado Reference describes the host tools and utilities.

Tornado SETUP Developer’s Guide

The Tornado SETUP Developer’s Guide provides instructions for creating aninstallation image that can install products on top of Tornado.

WindView User’s Guide

The WindView User’s Guide describes the features and use of the WindViewsoftware logic analyzer, which is integrated with the Tornado IDE. The companionWindView User’s Reference, describes WindView and networking events.

VxWorks Operating System

VxWorks Programmer’s Guide

The VxWorks Programmer’s Guide describes the VxWorks operating system andassociated run-time facilities. This guide is the best starting point for learningabout VxWorks from a problem-solving perspective because it is organized by thefunction of VxWorks components. It includes the following topics:

■ The fundamentals of the VxWorks kernel and run-time environment.

■ The I/O system and the device drivers that underlie it.

■ Local file systems, including the DOS-compatible file system and the CD-ROMfile system. Also see the CD-ROM File System for VxWorks 5.5.1 Programmer’sSupplement.

■ POSIX standard interfaces, which are real-time extensions to the VxWorkskernel facilities.

■ Target tools, which include the target-resident shell, loader, and symbol tables;as well as VxWorks show routines.

■ C++ development, with guidelines for creating VxWorks applications in C++and configuring VxWorks to support them.

getStart.book Page xi Friday, April 25, 2003 11:55 AM

Page 12: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

xii

■ TrueFFs, a flash memory interface, which provides a block device interface toa wide variety of flash-memory devices.

■ Configuring and writing COM and DCOM applications for VxWorks.

■ VxMP, which provides shared-memory objects dedicated to high-speedsynchronization and communication between tasks running on separateCPUs.

■ VxFusion, a lightweight, media-independent mechanism, based on VxWorksmessage queues, for developing distributed applications.

■ VxVMI, a virtual memory interface, which provides write protection and anarchitecture-dependent interface to the CPU’s MMU.

VxWorks Architecture Supplements

The VxWorks architecture supplements provide additional information specific totarget architectures.1

VxWorks Network Programmer’s Guide

The VxWorks Network Programmer’s Guide describes the networking facilitiesavailable with VxWorks. It includes the following topics:

■ Configuring the network stack.

■ Network configuration protocols.

■ Dynamic routing protocols.

■ Networking APIs.

■ Booting over the network.

■ Creating a new data link layer driver or network service.

VxWorks API References

The VxWorks OS Libraries API Reference and the VxWorks Drivers API Referenceinclude reference descriptions of all VxWorks libraries that apply to all targets.

1. For example, VxWorks for PowerPC Architecture Supplement.

NOTE: If you have installed Tornado with the default networking component, thenetworking guide is titled VxWorks Network Programmer's Guide. If you haveinstalled an optional networking product, the title is slightly different.

getStart.book Page xii Friday, April 25, 2003 11:55 AM

Page 13: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Documentation Guide

xiii

Each entry lists the routines found in a given library, including a one-line synopsisof each, along with a general description of their use.

VxWorks BSP Reference

The VxWorks BSP Reference consists of reference descriptions for BSP-specificlibraries and routines for all installed BSPs. This section also contains entries forthe serial, Ethernet, and SCSI drivers available with VxWorks Board SupportPackages (BSPs).

VxWorks Errno Code List

The VxWorks Errno Code List provides a description of VxWorks errno codes, bynumber, by routine name, and alphabetically.

VxWorks BSP Developer’s Guide

The VxWorks BSP Developer’s Guide provides instructions on creating,documenting, and testing new BSPs, components, and projects.

GNU Compiler and Tools

The GNU ToolKit User’s Guide is a convenient collection of manuals for the GNU Cand C++ compiler and its supporting tools: the C preprocessor, assembler, staticlinker, and binary utilities. Specific versions are provided for each architecturefamily. The GNU Make User’s Guide is the Free Software Foundation’s (FSF) manualfor the make utility. The GDB User’s Guide is the FSF manual for the command-lineinterface to the GNU debugger GDB, which is the foundation for the Tornadographical debugger, CrossWind.

Diab C/C++ Compiler and Tools

The Diab C/C++ Compiler Guide describes the tools in the Diab C/C++ OptimizingCompiler Suites, including the compilers, assembler, linker, and utilities. The Diabsuite is provided as the standard compiler for ColdFire, and is available for otherarchitectures as an optional product.

NOTE: The FSF develops software under UNIX, and examples in their manualsreflect this. Nevertheless, the GNU tools operate reliably under Windows.

getStart.book Page xiii Friday, April 25, 2003 11:55 AM

Page 14: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

xiv

Documentation Conventions

Cross-References

In the Tornado guides, cross-references to a reference entry for a specified tool ormodule refer to an entry in the online VxWorks API Reference (for target libraries orsubroutines) or to the Tornado API Reference(for host tools).

Cross-references between books take the form Book Title: Chapter Name, and are notlinked in the HTML version.

Pathnames

In general, all manuals refer to Tornado directories and files with pathnamesstarting at the installation directory installDir. Use the pathname chosen on yoursystem for Tornado installation. Your working directory is referred to as projDir.

Screen Displays

The screen displays in this book are for illustrative purposes. They may notcorrespond exactly to the Tornado environment you see on your computer,because both Tornado and the Windows environment in which it runs can becustomized. Tornado is also designed to permit easy integration with added tools.

Command-Line Examples

Tornado allows you to execute most functions either from within the IDE or fromthe command line. The command syntax is usually the same for Windows andUNIX command lines. For this reason these documents use the following defaultformat for command lines:

% prjCreate

When a particular command syntax applies to UNIX only, this is stated. When acommand syntax applies to Windows only, or when the Windows version differsfrom the UNIX version, the Windows format is:

c:\> winFooRun param

Typographical Conventions

Tornado manuals use the font conventions in the following table for specialelements. C subroutine names always include parentheses, as in printf( ).Combinations of keys that must be pressed simultaneously are shown with a +linking the keys. For example, CTRL+F3 means to simultaneously press the keylabeled CTRL and the key labeled F3.

getStart.book Page xiv Friday, April 25, 2003 11:55 AM

Page 15: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Documentation Guide

xv

Table 2 Typographical Conventions

Term Example

files, pathnames installDir\host

libraries, drivers memLib.c

Command-prompt tools dir

Tcl procedures wtxMemRead

C subroutines semTake( )

VxWorks boot commands p

code display main ();

keyboard input display [vxKernel] -> wtxregd -V

output display value = 0

user-supplied values name

components INCLUDE_NFS

keywords struct

named key on keyboard RETURN

key combinations ALT+SHIFT+F5

lower-case acronyms fd

GUI titles and commands Help

GUI menu path Tools>Target Server>Configure

references to other manuals VxWorks Programmer’s Guide: Basic OS

getStart.book Page xv Friday, April 25, 2003 11:55 AM

Page 16: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

xvi

getStart.book Page xvi Friday, April 25, 2003 11:55 AM

Page 17: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

1

1Overview

1.1 Introduction

Thank you for purchasing Tornado!

Tornado 2.2.1 provides a greater level of accessibility for users unfamiliar withTornado, and increased productivity for experienced developers. Key features ofthis release are:

■ the integrated version of the VxWorks target simulator (VxSim) introduced inTornado 2.0

■ the integrated version of the WindView logic analyzer for the target simulatorintroduced in Tornado 2.0

■ an improved project facility

■ a new debugger engine

The target simulator allows you to experience Tornado — as well as begindeveloping hardware-independent modules — without target hardware. Theintegrated version of WindView provides dynamic visualization of applicationbehavior on the simulator. The new project facility provides automated graphicalfeatures for managing project files, configuring VxWorks, and buildingapplications. The new debugger GUI is easier to use and provides more directaccess to debug information.

This guide describes how to install Tornado and other compatible products. It alsoprovides a simple tutorial that demonstrates the use of the project facility, theintegrated versions of the target simulator and WindView, and the Tornadodebugger. The tutorial is designed to provide new users with an accessibleintroduction to the key features of Tornado and their use in application

getStart.book Page 1 Friday, April 25, 2003 11:55 AM

Page 18: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

2

development. It is also intended to provide experienced Tornado users with anintroduction to major innovations in the development environment.

1.2 Terminology and Conventions

The following terms are used in this document:

hostA computer on which the Tornado IDE runs.

targetA processor board that runs VxWorks (Tornado’s real-time operating system)and applications developed with Tornado.

target serverA service that runs on the host and manages communications between hosttools (such as the Tornado shell, debugger, and browser), and the target systemitself. One target server is required for each target.

Tornado registryA Tornado service that keeps track of, and provides access to, target servers.Only one registry is required on a network, but registries may be run on eachTornado host.

The following conventions are used in this document:

■ As a convenience, the drive and root installation directory are identified asinstallDir in this document, but the location is determined at installation.

■ A series of items to be selected from the GUI is denoted by A>B>C. Theelements A, B, and C may be menu items, buttons, or tabs.

NOTE: The integrated target simulator (VxSim-Lite) runs as a single instance peruser, without networking support. Optional networking products are not availablefor this version. The full-scale version of the simulator, VxSim, is available as anoptional product. It supports multiple-instance use, networking, and otheroptional products.

The integrated version of WindView is designed solely for use with the VxWorkstarget simulator. WindView is available as an optional product for all supportedtarget architectures.

getStart.book Page 2 Friday, April 25, 2003 11:55 AM

Page 19: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

3

2Installation and License

Management

2.1 Overview

These instructions provide guidance for installing Tornado and related Wind Riverproducts, as well as for installing and administering a license server. The SETUPprogram is used for both product and license server installation. SETUP includesinstructions for the details of the installation process itself. The following sectionsprovide information about the prerequisites to installation, initiating theinstallation process, as well as post-installation configuration and use.

2.2 Installing Tornado and Related Products

Before installing Tornado and related products, be sure that your system meets thebasic requirements for supporting the product, that you have your installationkey(s), and that you understand your license management options. After you haveinstalled your product, make sure that you perform any additional configurationthat is required for its use.

Host System Requirements

Before you install Tornado or any related products, confirm that your host systemprovides the minimal support for the product, including the appropriate versionof the operating system and patch level or service pack.

getStart.book Page 3 Friday, April 25, 2003 11:55 AM

Page 20: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

4

Installation Media

Tornado 2.2.1 is provided on two CDs:

■ The Tornado 2.2.1/VxWorks 5.5.1 CD, which includes the host executables andtarget libraries for a specific architecture, as well as the VxWorks simulator.

■ The BSPs/Drivers CD, which includes BSPs, drivers, and associated sourcecode.

Both CDs must be installed in order to use the product on a real target. TheTornado 2.2.1/VxWorks 5.5.1 CD must be installed first, and the BSPs/Drivers CDsecond.

VxWorks 5.5.1 and run-time products are sold on a per-processor-family basis.Therefore, it is important to install the correct variation(s) of VxWorks run-timecomponents that match the BSP(s) you will be using.

Installation Keys

Your installation keys are printed on the Installation Keys sheet in the Getting Startedportfolio that contains the product CDs. If you cannot locate the Installation Keyssheet, contact Wind River by e-mail at [email protected]. Please includeyour sales order number. You can also call 1-800-USA-4-WRS (1-800-872–4977) ifyou are in North America and ask for Key Administration. In other locations,contact the nearest Wind River office.

License Management

Tornado and related tools require a license key file before they can be used. Youhave various options for procuring license information and creating the file foryour system. The simplest method is to allow the SETUP program to access theWind River licensing database automatically over the Internet during the

! CAUTION: Please consult the Tornado Release Notes to be sure that your host systemfulfills all of the requirements for proper installation of the product. The releasenotes also contain information about known problems relevant to installation. Therelease notes are available in your Getting Started portfolio, as well as from:http://www.windriver.com/support/resources/tornado22_bulletin.html

getStart.book Page 4 Friday, April 25, 2003 11:55 AM

Page 21: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

2

2Installation and License Management

5

installation process. You can also obtain license key information by phoning,FAXing, or emailing Wind River; and then create the file manually.

One of the following two licensing methods is associated with the purchase of yourproduct:

■ Licensing controlled by a license server at your site. Server licensing allowsyou to use various host systems to run licensed products, up to the numericlimit of licenses you have purchased. The licenses are not tied to specifichardware.

■ Node-locked licensing, which allocates a license to a single, specific machine.Node-locked licensing is useful for systems that are intended to be used whenthey are not in contact with a license server. Node-locked licensing isrecommended, for example, for notebook computers that are used off-site andoff the network on which a license server runs.

If you are installing Tornado or other licensed products for use with a licenseserver, make sure that the server has been installed and is running on yournetwork. (For instructions on installing and configuring a license server, see2.3 Installing and Administering a License Server, p.12.)

If you are installing a product for use with a node-locked license, your host systemdoes not need to have access to a license server.

Note that you can complete product installation without a license key file. Whenyou subsequently start Tornado (and the required key is not found) SETUP isautomatically launched to allow license configuration. You can also run SETUP /L(on Windows) or SETUP -L (on Solaris) from the command line to perform licenseconfiguration.

Restricting Group Usage in a Solaris Environment

The following instructions describe how you can limit access to Tornado to aspecific group of users in a Solaris environment:

1. Create a UNIX group for all Tornado users.

2. Create a special user account for Tornado installation.

3. Assign all Tornado users, including the special Tornado installation useraccount, to the Tornado user group. This provides full access for all Tornadousers with their regular UNIX accounts.

4. Use the special account to install Tornado; do not install Tornado as thesuperuser (root).

getStart.book Page 5 Friday, April 25, 2003 11:55 AM

Page 22: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

6

Verify that the correct group is set as the default within the shell used forTornado installation; use the id and newgrp commands to verify and set thegroup. For example:

% iduid=101(tornado) gid=1(other)

% newgrp my_group

% iduid=101(tornado) gid=101(my_group)

5. During Tornado installation, when you reach the SETUP file permissionsscreen, select write privileges for the group. The three rows in the dialog boxset permissions for user, group and other respectively. By default, the groupwrite permission box is not checked.

The permissions are modifiable after the installation with the UNIXcommands chmod, chown and chgrp, although root access may be required.If necessary, the owner of the installation account can add group writepermission, after the installation, in the following manner:

% cd installDir% chmod -R g+w *

Running SETUP

For Tornado 2.2.1, install the Tornado 2.2.1/VxWorks 5.5.1 CD first, and theBSP/Driver CD second. Each has its own installation key. Be sure to install at leastthe minimum required set of products for each CD.

From the Tornado/VxWorks CD, you must at least install:

■ a compiler

■ Tornado Tools

■ VxWorks

From the BSP/Drivers CD, you must at least install:

■ Driver Objects/Headers

■ at least one VxWorks BSP (not necessary if using only a simulator)

If you plan to install a third-party BSP, it must not overwrite or modify anyWind River-supplied files.

getStart.book Page 6 Friday, April 25, 2003 11:55 AM

Page 23: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

2

2Installation and License Management

7

Optional products should be installed in the same directory tree as the version ofTornado for which they have been released.

The SETUP program provides instructions on its screens that describe how toproceed with each step of the installation process. The sequence of steps requiredfor installation is dependent on your choice of how to procure a license key and thetype of license management you select.

WARNING!

Please note the following installation restrictions:

■ Do not install Tornado 2.2.1 in the same directory as any previous installationof Tornado, or in the same directory as versions of Tornado for other targetoperating systems.

■ If you are using more than one target architecture (not including the VxWorkssimulator), each set of CDs much must be installed in a separate tree.

■ Do not attempt to install in directories with spaces in the names.

Windows

Installation must be performed by a user with administrative privileges.

The SETUP program starts automatically when you insert the CD. On subsequentoccasions, you can start SETUP again on Windows by displaying the contents of theCD-ROM drive (using Windows Explorer or a comparable file manager) anddouble-clicking on SETUP.EXE, which is at the root of the CD-ROM file system.

Solaris

Installation should not be performed by the superuser (root).

Solaris users whose LANG environment variable is not set to English must run thefollowing command prior to installation:

% unsetenv LANG

Also see Restricting Group Usage in a Solaris Environment, p.5.

When you insert the CD, the file manager starts automatically, and you can startSETUP from there. Or you can run SETUP from the command line; for example:

% /cdrom/cdrom0/SETUP

getStart.book Page 7 Friday, April 25, 2003 11:55 AM

Page 24: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

8

Setting Environment Variables

On Solaris hosts you must set environment variables for both license managementand Tornado usage before you run Tornado and related products.

On Windows hosts, you only need to set environment variables if you did not useautomatic license configuration during product installation, or if you want to starttools from the command line.

If you reset the license management environment variable after running Tornadoon either host, you must delete a cache file (on Solaris) or registry entries (onWindows) before the new setting can take effect.

Solaris

On Solaris hosts, you must set the LM_LICENSE_FILE environment variable afterinstallation. For licensing controlled by a server, the variable must be set to the portnumber (the default is 27000) and server name. For node-locked licensing, thevariable must be set to the location of the license file. The examples below illustratesettings for each of the licensing models (for the C shell):

setenv LM_LICENSE_FILE 27000@cosmos

setenv LM_LICENSE_FILE /usr/fred/LM/WRSLicense.lic

If you allow SETUP to retrieve license information from Wind River automatically,the required environment variable setting is described at the end of the installationprocess in the Finish screen. It is also described in the installDir/LMEnvVar.txt file.

However, If you opted to get license key information for your installation byemailing, FAXing, or phoning Wind River, you must set the LM_LICENSE_FILEenvironment variable manually. This process is described in Wind River’sresponse to your request.

You can use the LM_LICENSE_FILE variable to access more than one license serveror more than one license key file (for node-locked licensing). Doing so ensures thatyou are able to obtain a license by providing access more than one server, or thatyou have access to all the license keys that you need for the set of tools that you areusing (for node-locked licensing). To do so, reference an existing setting andappend the new value, or simply edit the original setting and append the new

NOTE: If you reset the license server environment variable after using Tornado,you must also delete ~/.flexlmrc, which is used to cache the keys used for licensemanagement.

getStart.book Page 8 Friday, April 25, 2003 11:55 AM

Page 25: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

2

2Installation and License Management

9

value(s). The following examples provide illustrations for both license serverenvironments and node-locked licensing (for the C shell):

setenv LM_LICENSE_FILE ${LM_LICENSE_FILE}:27000@cosmos

setenv LM_LICENSE_FILE 27000@cosmosz:27000@warthog:27000@ubu

setenv LM_LICENSE_FILE ${LM_LICENSE_FILE}:/usr/fred/LM/WRSLicense.lic

setenv LM_LICENSE_FILE /usr/me/LM/WRSLicense.lic:/usr/you/LM/WRSLicense.lic

In order to run Tornado, you must also configure your host environment asdescribed in the Tornado User’s Guide: Setup and Startup. As a short-cut, you cansource either torVars.csh or torVars.sh (depending on your host shell), which canbe found in installDir/host/sun4-solaris2/bin. If you install your product using theautomated license configuration method, the torVars shell scripts automaticallyinclude the setting for license management as well.

Windows

On Windows hosts, you do not need to set the LM_LICENSE_FILE environmentvariable if you allowed SETUP to retrieve license information from Wind Riverautomatically. In this case, the variable is set during the installation process.

However, If you opted to obtain license key information for your installation byemailing, FAXing, or phoning Wind River, you must set the LM_LICENSE_FILEenvironment variable manually.

Windows 2000 Pro or XP Pro. Set the environment variable manually as follows:

1. Go to Control Panel>System.

2. Click on the Advanced tab.

3. Click on the Environment Variables button.

4. Click on the New button under the System Variables section.

5. In the Variable Name edit box, enter LM_LICENSE_FILE.

6. In the Variable Value edit box:

For license server sites, enter the license server port number and name; forexample:27000@cosmos

For node-locked licensing, enter the full path for the license file on yoursystem; for example:C:\Tornado2.2.1\.wind\license\WRSLicense.lic

getStart.book Page 9 Friday, April 25, 2003 11:55 AM

Page 26: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

10

7. Click OK.

Windows NT 4.0. Set the environment variable manually as follows:

1. Log on to Windows using the same account that was used to install the licensemanager.

2. Go to Start>Settings>Control Panel>System.

3. Choose the Environment tab.

4. In the Variable edit box, enter LM_LICENSE_FILE.

5. In the Value edit box:

For license server sites, enter the license server port number and name; forexample:27000@cosmos

For node-locked licensing, enter the full path for the license file on yoursystem; for example:C:\Tornado2.2.1\.wind\license\WRSLicense.lic

6. Click OK.

Running Tornado

For information about setting up your host-target development environment,starting Tornado, and booting VxWorks, see the Tornado User’s Guide: Setup andStartup.

NOTE: If you reset the license server environment variable after it is initially set(automatically or manually), you must also use regedit to delete the Windowsregistry keys LM_LICENSE_FILE and WRSD_LICENSE_FILE inHKEY_LOCAL_MACHINE\SOFTWARE\FLEXlm License Manager.The registry keysare used to cache the license keys used for license management.

NOTE: If you wish to use command-line tools, or to invoke GUI tools from thecommand line on Windows, you must execute torVars.bat, which is located ininstallDir\host/x86-win32\bin.

getStart.book Page 10 Friday, April 25, 2003 11:55 AM

Page 27: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

2

2Installation and License Management

11

Uninstalling Tornado

Should you need to do so, Tornado can be easily uninstalled.

Solaris

Before you remove Tornado, first stop the Tornado registry and any target serversthat are running by killing the wtxregd and tgtsvr processes. Then run thefollowing command:

% installDir/SETUP/UNINST installDir

If you plan to re-install Tornado afterwards, also remove the installDir/.winddirectory.

Windows

Before you remove Tornado, you must shut down all Tornado tools andcomponents, including those you may have arranged to start automatically, suchas the target server and Tornado registry. Use standard Windows Control Panelfacilities or the Tornado Uninstall program.

To use the Windows Control Panel facilities to uninstall Tornado:

1. Select Start>Settings>Control Panel.

2. Double-click Add/Remove Programs.

3. Select Tornado 2.2.1 from the list.

4. Click the Add/Remove button.

To use the Uninstall program to uninstall Tornado:

1. Select the Tornado program folder from the Start menu under the Programsfolder (this is the default folder name and location; another may have beenselected at installation.)

2. Select Tornado 2.2.1 Uninstall.

! WARNING: Before uninstalling Tornado, make copies of any Tornado files youhave modified. Uninstalling Tornado removes all files that were part of the originaldistribution list. If you uninstall Tornado 2.2.1 from a Windows host, and you werepreviously using another version of Tornado 2.x with the Tornado registry runningas a service, the old registry service will not be automatically restored.

getStart.book Page 11 Friday, April 25, 2003 11:55 AM

Page 28: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

12

2.3 Installing and Administering a License Server

A license server must be installed and configured before Tornado or any otherlicensed products can be used, unless you have configured your system with anode-locked license.

A license server manages a pool of licenses for use by Tornado installations onother hosts on a shared network. More than one license server can be set up tomanage separate pools of licenses, which can be useful for dividing licenses amongdevelopment teams, for server load-balancing or redundancy, and so on.

License management software for Tornado 2.2.1 is FLEXlm 8.8 (b) fromMacrovision. This package offers a full complement of tools for administeringlicense management. Documentation is available on the Web at:

http://www.macrovision.com/solutions/esd/index.html

Installing and Configuring a License Server

You install the Wind River license server with the same SETUP program used byTornado and other products. The SETUP program provides instructions on how toproceed with each step of the installation process.

Administering a License Server

The license server must be started in order to make licenses available to Tornadoinstallations on a network.

Solaris

To start up the license manager, perform the following steps manually or add themto a system startup script so that the server is started automatically when thesystem is rebooted:

NOTE: This section is relevant for system administrators who need to install thenetwork license server, and not for typical end-users of Tornado. It is not part ofstandard product installation.

NOTE: To install only license management binaries and utilities files, you caninvoke SETUP with the -F or /F option.

getStart.book Page 12 Friday, April 25, 2003 11:55 AM

Page 29: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

2

2Installation and License Management

13

1. Change directory to the location where the license utilities are installed:

% cd installLic/host/sun4-solaris2/bin

2. Issue the startup command:

% ./lmgrd -c installLic/.wind/license/WRSLicense.lic -linstallLic/.wind/license/lmgrd.log [-x lmdown]

In the above example, the optional switch -l directs output to a log file,lmgrd.log. The optional parameter -x lmdown prevents the shutdown of thelicense manager by the lmdown utility.

To stop a license manager process, do the following:

1. If you did not use -x lmdown, issue the shut-down command:

% lmutil lmdown -c installLic/.wind/license/WRSLicense.lic

2. If you did use -x lmdown, determine the process ID (pid) of the licensemanager process:

% ps | grep lmgrd

3. Kill the process:

% kill pid

Windows

Use the license manager utility to start the license manager:

1. Use Windows Explorer to open the folder for the license manager utilities.

2. Double-click lmtools.exe, and then go to the Start/Stop/Reread tab.

You can also start the license server from a command line. Follow the steps below,substituting for installLic the directory where the license manager was installed.

1. Change directory to the location where the license utilities are installed:

c:\> cd installLic\host\x86-win32\bin

2. Issue the startup command:

c:\> lmgrd -z -c installLic\.wind\license\WRSLicense.lic -linstallLic\.wind\license\lmgrd.log [-x lmdown]

getStart.book Page 13 Friday, April 25, 2003 11:55 AM

Page 30: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

14

To stop a license server that has been started manually using the above steps, dothe following:

1. Open the Windows Task Manager (CTRL+SHIFT+ESC).

2. Choose the Processes tab.

3. Select the process named lmgrd.

4. Click the End Process button.

UNIX License Server Lock File Permission Issues

On UNIX systems, the license server uses a lock file, which is created in /var/tmpby default. For example, the file listing looks like this:

% ls -l /var/tmp/lockwrsd-rw-r--r-- 1 tornado other 0 Sep 12 18:16 /var/tmp/lockwrsd

When the license manager (lmgrd) is started for the first time, the lock file iscreated with the permissions of the user who starts the daemon. You may need tomodify the file permissions to ensure that other users can start the server.

Getting Help With License Management

If you encounter license management problems, they may be resolved byconsulting the license management support Web page:

http://www.windriver.com/windsurf/LMSupport/

Or the Tornado 2.2.1 Support Web page:

http://www.windriver.com/support/resources/tornado22_bulletin.html

getStart.book Page 14 Friday, April 25, 2003 11:55 AM

Page 31: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

15

3Tornado Tutorial

3.1 Introduction

This tutorial is designed to introduce you to key features of Tornado using theintegrated VxWorks target simulator. It does not require any target hardware orspecial configuration of your host system. It is not a programming tutorial; thesample program was written to exercise Tornado in illustrative ways.

While simply reading the tutorial may be edifying, we encourage you to performthe steps described in this chapter so that you can experience Tornado first hand.In the course of the tutorial, you will:

■ Use the project facility to create a workspace and project for a sample program.

■ Build the program from the project facility GUI.

■ Download the program to the VxWorks target simulator on your host system.

■ Use the Tornado shell to run the sample program.

■ Use the browser to observe memory usage on the target simulator.

■ Use the WindView software logic analyzer to graphically display the executionflow of the sample program and to identify a problem with task prioritization.

■ Use the debugger to identify a runtime application error.

Naturally, you will have several opportunities to modify the program to correct itsruntime behavior, rebuild it, download it, and run it again.

getStart.book Page 15 Friday, April 25, 2003 11:55 AM

Page 32: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

16

The tutorial assumes minimal knowledge of multi-threaded programming in C,and basic Windows usage.

You might approach the tutorial with the following scenario in mind:

A colleague has abruptly announced that he is going on vacation, and the VP ofEngineering has handed you the delinquent’s portion of The Project. You are alarmed.His code is typically cryptic, poorly documented, and full of run-time mischief. Thethought of reading his source gives you a headache. And the target hardware seems tohave gone on vacation with him. You decide to use Tornado’s target simulator andanalytical tools to see how the code behaves...

3.2 Start Tornado

To start Tornado, select Start>Programs>Tornado2.2.1>Tornado (with a defaultinstallation), or select the Tornado desktop shortcut (if you have created one).

If Tornado is unable to connect to a Tornado registry, you will be prompted to startone. You can start a registry manually by selecting the Tornado Registry option fromthe Tornado program group menu.

NOTE: This tutorial is intended for use with the integrated VxWorks targetsimulator. The results may differ if used otherwise (with target hardware, forexample).

getStart.book Page 16 Friday, April 25, 2003 11:55 AM

Page 33: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

3

3Tornado Tutorial

17

The main Tornado window appears with the Create Project dialog box open bydefault:

You can use the toolbars as floating palettes or dock them on the sides, top, orbottom of the main Tornado window.

getStart.book Page 17 Friday, April 25, 2003 11:55 AM

Page 34: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

18

3.3 Create a Project

If the Create Project in New/Existing Workspace dialog box is not displayed, clickFile>New Project.

Then select the option for a downloadable application:

Click OK to continue.

The Tornado application wizard appears. This wizard guides you through thesteps of creating a new project. In the first step, the wizard prompts you for:

■ A name for the project.

■ The full path and name of the directory you want to use for the project files.

■ An optional description of the project.

■ The name and location of the workspace file, which contains informationabout the workspace, including which projects belong to it.

A project consists of the source code files, build settings, and binaries that are usedto create an application.

A workspace is simply a grouping of one or more projects, which provides a usefulmeans of working with related material, sharing code between projects, andassociating related applications. Once a project and workspace have been created,a workspace window displays information about the projects that it contains.

You can accept the wizard’s defaults for the project and workspace, but it ispreferable to set them up outside of the Tornado installation tree. (If you do so, youwon’t have to untangle your work from the Tornado tree when you upgradeTornado.)

getStart.book Page 18 Friday, April 25, 2003 11:55 AM

Page 35: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

3

3Tornado Tutorial

19

In the wizard dialog (displayed below):

■ The project name is gizmo.

■ The project directory is c:\projects\gizmo.

■ The project description is lightning gizmo.

■ The path and file name for the workspace are c:\projects\lightning.wsp:

Click Next to continue.

In the second wizard dialog, you identify the toolchain with which thedownloadable application will be built.

A toolchain is a set of cross-development tools used to build applications for aspecific target processor (preprocessor, compiler, assembler, and linker).

The default toolchain names for target simulators take the form SIMhostOsgnu (forexample, SIMNTgnu).

NOTE: The directory path for the workspace must exist—or at least match the path(or an initial segment thereof) defined in the project Location field—for the wizardto complete project creation.

getStart.book Page 19 Friday, April 25, 2003 11:55 AM

Page 36: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

20

Select A toolchain and the option for the target simulator from the drop-down list,as illustrated below:

Click Next to continue.

The final wizard dialog confirms your selections:

getStart.book Page 20 Friday, April 25, 2003 11:55 AM

Page 37: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

3

3Tornado Tutorial

21

Click Finish to continue.

The Workspace window appears. The workspace window title includes the nameof the workspace, and the window itself includes a folder for the project:

NOTE: Context menus provide access to all commands that can be used with theobjects displayed in, and the pages that make up, the Workspace window. Use theright mouse button to display an object’s context menu.

getStart.book Page 21 Friday, April 25, 2003 11:55 AM

Page 38: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

22

3.4 Add the Sample Source File to the Project

The sample program for this tutorial is cobble.c. It is a simple multi-taskingapplication that simulates a data collection system in which data is retrieved froman external source (for example, a device that generates interrupts as data comesin). The four cobble tasks are:

■ tCosmos, which simulates an interrupt service routine (ISR) and generatesnew data.

■ tSchlep, which collects the data.

■ tCrunch, which performs calculations on the data to obtain a result value.

■ tMonitor, which monitors the results and prints a warning message if they areoutside of the safety range.

The cobble program also includes the progStart( ) and progStop( ) routines. Laterin the tutorial, you will use these routines to start and stop the program.

Before you add the sample program to the project, copy it from the Tornadoinstallation tree to another location, such as the project directory you have set upwith the Tornado project wizard.

The sample file cobble.c is located in installDir\target\src\demo\start.

In the examples provided thus far in the tutorial, c:\projects has been used as thebase directory for our project work, and subsequent examples are based oncobble.c being copied to that directory.

getStart.book Page 22 Friday, April 25, 2003 11:55 AM

Page 39: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

3

3Tornado Tutorial

23

After you have copied cobble.c to another location, add it to the project. Select AddFiles from the context menu in the File view of the workspace:

Then use the file browser that appears to select cobble.c.

Open the Object Modules folder in the Files view so you can see the names of theobject files that are built from the project:

getStart.book Page 23 Friday, April 25, 2003 11:55 AM

Page 40: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

24

The Tornado project facility automatically creates the file projectName.out as asingle, partially linked module when a project is built. It comprises all of theindividual object modules in a downloadable application project, and provides fordownloading them all to the target simultaneously.

3.5 Build the Project

To review the default build settings defined when you created the project, selectthe Builds tab on the Workspace window, open the gizmo Builds folder, anddouble-click on the default build name (for example, SIMNTgnu).

The properties sheet for the build appears, which you can use to review makefilerules and macros, as well as the compiler, assembler, and linker options used forthe build.

When you display the C/C++ compiler page, you will note that the Include debug infocheckbox is selected by default. This selection ensures that optimization is turnedoff when the project is compiled with debug information:

getStart.book Page 24 Friday, April 25, 2003 11:55 AM

Page 41: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

3

3Tornado Tutorial

25

Close the property sheet by clicking on the Cancel button.

Build the project by selecting Build 'gizmo.out' from the context menu:

The option Build 'projectName.out' builds all project modules as a single, partiallylinked module that is optimal for downloading to a target.

Before Tornado builds the project, the Dependencies dialog box warns you thatmakefile dependencies have not been calculated for cobble.c:

Click OK to continue.

getStart.book Page 25 Friday, April 25, 2003 11:55 AM

Page 42: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

26

Tornado calculates makefile dependencies and proceeds with building the project.If any external dependencies are found, they are automatically included in theproject and listed in the External Dependencies folder in the Files view of theworkspace.

The build output window displays any errors and warnings. In this case, there arenone:

Close the Build Output window with the window control.

3.6 Download the Project to the VxWorks Target Simulator

You can download your project from the Files view of the workspace, and start theintegrated simulator, all as part of the same process.

First display the Files view of the workspace window.

getStart.book Page 26 Friday, April 25, 2003 11:55 AM

Page 43: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

3

3Tornado Tutorial

27

Then select the project folder name with the right mouse button and select theDownload 'gizmo.out' option from the context menu:

Tornado prompts you to start a simulator:

Click Yes to continue.

getStart.book Page 27 Friday, April 25, 2003 11:55 AM

Page 44: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

28

The VxSim dialog box appears:

Leave Standard Simulator selected, and click OK to continue.

The target simulator window opens, and Tornado prompts you to start a targetserver. Click OK in the VxSim-Lite Launch dialog to continue:

getStart.book Page 28 Friday, April 25, 2003 11:55 AM

Page 45: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

3

3Tornado Tutorial

29

A target server manages all communication between Tornado host tools, such asthe debugger, and the target. The convention for target server names istargetName@hostName. In this example, the name of the target is vxsim (the defaultfor the integrated simulator), and the name of the PC host is ala-tau.

The name of the target server is displayed in the Tornado launch toolbar:

The toolbar includes buttons for starting Tornado tools such as the browser, shell,and debugger. The buttons are activated when the target server is started.

3.7 Run the Application from the Tornado Shell

Before you run an application, it is often useful to configure and start the Tornadodebugger, so that the debugger can respond automatically to any programexception.

The Tornado debugger (CrossWind) combines the best features of graphical andcommand-line debugging interfaces. The most common debugging activities, suchas setting breakpoints and controlling program execution, are available throughconvenient point-and-click interfaces. Similarly, program listings anddata-inspection windows provide an immediate visual context for the crucialportions of your application.

NOTE: Only one instance of the integrated VxWorks target simulator (VxSim-Lite)can be run at a time. To stop the simulator, close the VxWorks Simulator window.

NOTE: Both the browser button and the shell button both have the letter i in them,which may be confusing. The i in the shell button follows the -> shell commandprompt, where it is a shell command that displays target system information. Thei in the browser button stands for information about the target.

getStart.book Page 29 Friday, April 25, 2003 11:55 AM

Page 46: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

30

To configure the debugger, select Tools>Options>Debugger from the main Tornadowindow. When the Options dialog appears, select Always under Auto attach to tasks,so that the debugger will automatically attach to a task when an exception occurs:

Click OK to continue. For more information, see the Tornado User’s Guide: Debugger.

To start the debugger, use the debugger button in the Tornado launch toolbar.The back trace and variables windows open (you may close them), and the statusline at the bottom of the main Tornado window announces that the debugger isrunning:

The Tornado shell (also known as WindSh) is a C-language command interpreterthat allows you to invoke any routine from the shell command line that has beendownloaded to the target. The shell also includes its own set of commands formanaging tasks, accessing system information, debugging, and so on.

getStart.book Page 30 Friday, April 25, 2003 11:55 AM

Page 47: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

3

3Tornado Tutorial

31

You can run the program from the shell command line. To start a shell, click theshell button .

When the shell window opens, run the program by entering the name of the mainroutine, progStart, at the command line:

3.8 Examine Target Memory Consumption

The Tornado browser is a system-object viewer that is a graphical companion tothe Tornado shell. The browser provides display facilities to monitor the state ofthe target system, including summaries of active tasks, memory allocation, and soon.

To start the browser, click the browser button in the Tornado launch toolbar.

getStart.book Page 31 Friday, April 25, 2003 11:55 AM

Page 48: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

32

When the browser appears, Select Memory Usage from the drop down list and clickthe periodic refresh button . This will update the display every few seconds,and you will note that cobble.c has a voracious appetite for memory:

Stop the browser with the window control in the title bar.

3.9 Examine Task Activity

WindView is the Tornado logic analyzer for real-time applications. It is a dynamicvisualization tool that provides information about context switches, and the eventsthat lead to them, as well as information about instrumented objects such assemaphores, message queues, and watchdog timers.

getStart.book Page 32 Friday, April 25, 2003 11:55 AM

Page 49: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

3

3Tornado Tutorial

33

Click the WindView button in the Tornado launch toolbar to display theWindView Control window. The WindView Collection Configuration dialog box alsoappears. Select Additional Instrumentation from the drop-down list and click OK:

To begin data collection, click the GO button in the WindView Control window.

Wait a few seconds, and then click the update button in the WindView Controlwindow to update the status of data collection:

NOTE: Except where otherwise specified, the default configuration of WindViewis used for this exercise. If WindView settings have been changed during anothersession, the behavior may vary from the description below.

getStart.book Page 33 Friday, April 25, 2003 11:55 AM

Page 50: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

34

When the Buffers value listed under Current Content reaches at least two, click theStop button to end data collection.

You may notice a certain sluggishness in your machine’s performance, which isdue to the sample program’s runtime misbehavior on the integrated simulator.

Before you upload the WindView data from the simulator target to the host, stopthe sample program by entering progStop at the shell command line.

Then use the upload button to upload the data. A view graph is displayedwhile the data is uploaded.

When you maximize the view graph window, the data display should looksomething like the following:1

You can use the zoom buttons on the WindView toolbar to enlarge ordecrease the size of the scope of the display, and scroll bar at the bottom of the viewgraph to display the rest of the data. (The zoom 100% button displays all of the

1. The color of the view graph display can be changed with Tools>WindView>Options.

getStart.book Page 34 Friday, April 25, 2003 11:55 AM

Page 51: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

3

3Tornado Tutorial

35

data at once.) The flag-shaped icons indicate semaphore gives and takes. Thehorizontal lines indicate task states (executing, pending, ready, and so on). Forinformation about the meaning of the WindView icons, selectHelp>WindView Help>Legend.

Note that tCrunch, the task that processes data and removes nodes from a linkedlist, never runs.

Close the view graph and click No in response to the dialog that prompts you tosave the data with: Save changes to hostName?

Close the WindView Control window as well.

3.10 Fix Task Priorities and Find the Next Bug

Open the source code in the editor by double-clicking on cobble.c in theworkspace Files view. Then find the progStart( ) routine, where you’ll discover thattCrunch is assigned a lower priority (240) than tMonitor (230), which never allowsit to run. As a consequence, data is never processed, and nodes are never deletedfrom the linked list.

Edit the source file to reverse the priorities between the two tasks:

■ Change the 240 argument in the taskSpawn( ) call for tCrunch to 230.

■ Change the 230 argument in the taskSpawn( ) call for tMonitor to 240.

Then save the file.

Use the context menu in the Files view of the workspace, select theReBuild All (gizmo.out) option to rebuild the project. When it is done, close theBuild Output window.

Then download the project to the target with the Download 'gizmo.out' option fromthe context menu.

Start the program again from the Tornado shell with the command progStart.

NOTE: Do not forget to download the new gizmo.out to the target! And if youhave stopped the debugger, restart it with the debugger button .

getStart.book Page 35 Friday, April 25, 2003 11:55 AM

Page 52: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

36

Both the simulator and shell windows soon announce an exception and thenumber of the task in which it occurred:

In addition, the debugger opens the editor window automatically with a contextpointer marking the position in the crunch( ) routine where the error wasgenerated:

Before you proceed, reboot the target simulator: in the shell window, pressRETURN to display the prompt, and enter reboot.

A message box announces that the target connection has been lost, and that thedebugger is being stopped. Click OK.

getStart.book Page 36 Friday, April 25, 2003 11:55 AM

Page 53: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

3

3Tornado Tutorial

37

If you use the i command in the shell window after you have rebooted thesimulator, you see that only VxWorks system tasks are now running:

3.11 Fix the Last Bug and Take it for a Spin

Open the cobble.c file in your editor by double-clicking on the file name in the Filesview of the workspace window. Fix the source of the exception error in thecrunch( ) routine by using the commented code immediately below the divisionoperation—or something more interesting. Save the file and close the Source viewwindow.

Then use the context menu in the Files view of the workspace to select theReBuild All (gizmo.out) option. When the build is done, close the Build Output window.

Download the application to the target with the Download 'gizmo.out' option fromthe context menu.

To be sure that everything is working, start the debugger with the debugger button.

Start the program again from the Tornado shell with the command progStart.

Click on the Windview button to display the WindView Control window. Thenclick the GO button in the WindView Control window to begin data collection.

Wait a few seconds, and click the update button in the WindView Control windowto update the status of data collection.

getStart.book Page 37 Friday, April 25, 2003 11:55 AM

Page 54: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

38

When the Buffers value listed under Current Content reaches at least two, click theStop button to end data collection.

Then use the upload button to upload the data. A view graph is displayedwhile the data is uploaded.

Maximize the view graph window and scroll through the WindView data. Youshould find that all tasks, including tCrunch, are running in an orderly manner,and the view graph data should look like the following:

You can check memory consumption once again with the browser by clicking thebrowser button in the Tornado launch toolbar.

When the browser appears, select Memory Usage from the drop-down list and clickthe browser’s periodic refresh button . Every few seconds the display will beupdated.

getStart.book Page 38 Friday, April 25, 2003 11:55 AM

Page 55: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

3

3Tornado Tutorial

39

Notice that memory consumption fluctuates modestly within a constant range:

Moreover, output in the simulator window indicates that the program is hummingalong nicely, providing you with information about when it’s hot and when it’snot:

Stop the program by entering progStop at the shell command line.

Bye! Tschuess! Adieu!

getStart.book Page 39 Friday, April 25, 2003 11:55 AM

Page 56: getStart.book Page i Friday, April 25, 2003 11:55 AM 2.2read.pudn.com/downloads153/doc/669701/tornado... · The Tornado Getting Started Guide (this manual) provides instructions on

Tornado 2.2.1Getting Started Guide

40

3.12 What Next?

For detailed information about using features of the Tornado IDE such as theproject facility, shell, browser, and debugger, see the Tornado User’s Guide. Theguide also provides information about setting up your Tornado developmentenvironment with target hardware.

For information about VxWorks itself, see the VxWorks Programmer’s Guide, theNetwork Programmer’s Guide, and the VxWorks API Reference.

The Tornado documentation set is available online in HTML format from the mainTornado menu Help>Manuals Contents, or directly from the top level HTML fileinstallDir\tornado\docs\books.html.

getStart.book Page 40 Friday, April 25, 2003 11:55 AM