Wr Workbench Vxworks 6 by Example 3.3



Comments



Description

Wind River Workbench (VxWorks 6 Version) By Example, 3.3 Wind River Workbench ® BY EXAMPLE 3.3 VxWorks 6 Version Edition 2 Copyright © 2011 Wind River Systems, Inc. All rights reserved. No part of this publication may be reproduced or transmitted in any form or by any means without the prior written permission of Wind River Systems, Inc. Wind River, Tornado, and VxWorks are registered trademarks of Wind River Systems, Inc. The Wind River logo is a trademark of Wind River Systems, Inc. Any third-party trademarks referenced are the property of their respective owners. For further information regarding Wind River trademarks, please see: www.windriver.com/company/terms/trademark.html This product may include software licensed to Wind River by third parties. Relevant notices (if any) are provided in your product installation at one of the following locations: installDir/product_name/3rd_party_licensor_notice.pdf installDir/legal-notices/ Wind River may refer to third-party documentation by listing publications or providing links to third-party Web sites for informational purposes. Wind River accepts no responsibility for the information provided in such third-party documentation. Corporate Headquarters Wind River 500 Wind River Way Alameda, CA 94501-1153 U.S.A. Toll free (U.S.A.): 800-545-WIND Telephone: 510-748-4100 Facsimile: 510-749-2010 For additional contact information, see the Wind River Web site: www.windriver.com For information on how to contact Customer Support, see: www.windriver.com/support Wind River Workbench By Example 3.3 VxWorks 6 Version Edition 2 8 Jun 11 Contents PART I: INTRODUCTION 1 Overview ...................................................................................................... 1.1 1.2 1.3 Introduction ...................................................................................................................... How This Guide is Organized ...................................................................................... Related Documentation ................................................................................................. 3 3 3 4 PART II: SETTING UP YOUR ENVIRONMENT 2 Getting Started With Workbench ............................................................... 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 Introduction ...................................................................................................................... The Benefits of Projects ................................................................................................. Deciding on a Kernel Image ......................................................................................... Writing Applications in Workbench ............................................................................ Creating a Library to Use With an Application ......................................................... Loading and Booting a Kernel Image .......................................................................... Customizing a Board Support Package ....................................................................... Deploying an Application with a System Image ...................................................... Using the Wind River Workbench New Project Wizard .......................................... Walkthrough Examples .................................................................................................. Workbench Example Projects ........................................................................................ 9 9 10 10 11 12 12 13 13 13 14 15 iii ..........................................................................6 Introduction ........ Creating an Experimental Default BSP ..........4 4...................3 3.............................................................................................................................................................................................................. Configuring Custom VxWorks Libraries ..................... Booting a Target with VxWorks ..............................................................8 4..........................................3 3 Setting Up Your Host & Target ................................................................................. Before You Begin Creating a Kernel Image .......................................................... 5.............. 3... Example: Customizing a BSP ........................................................................... Creating a Custom VxWorks Image ................................................................................................. 17 17 18 18 20 23 25 PART III: CUSTOMIZING THE OPERATING SYSTEM 4 Configuring and Building VxWorks ..... Creating a VxWorks Source Build Project .........5 3............ Configuring Your Target ..........................7 4................. Example: Building a VIP With Sources in a Subdirectory ....................... Rebasing VSB and VIP Projects ............................................. Configuring VxWorks ................................3 Introduction ..............................11 Introduction ..1 3.................................................................................................................Wind River Workbench By Example..................................................................................................................... 4..10 4.......................................... Loading the VxWorks Image onto the Target ................... 3...................................... What Should Your Development Environment Look Like? .....2 4.2 3.......1 4.........5 4.............................................1 5..................................................................................4 3...... Configuring Your Host Machine ........................................ 31 31 32 32 37 41 43 47 49 50 53 54 5 Working with Board Support Packages ....3 4.. 59 59 59 61 PART IV: DEVELOPING AND DEBUGGING APPLICATIONS iv ..............................2 5.. Importing and Migrating Existing VxWorks Image Projects ........................6 4............................... Example: Customizing VxWorks Libraries as a Base For a VIP .................................9 4....... Troubleshooting VxWorks Boot Problems ............................................................... .............................................................. Creating a Project For Your Application ........................... Example: Adding IPNet Support to a DKM ...............................................4 6.........................2 6....1 8.......................................... Example: Creating and Passing a Build Target ................................Contents 6 Building Applications and Libraries .............. 95 95 96 97 99 Example: Connecting a Target Server to a Target Agent ...........4 7........................ 109 8......................................................................................................................................................................5 6........ 106 Troubleshooting Target Server Connections ..............................................................................................................................1 6...............................9 6............3 7.........11 6..................... 6.......................................................4 Introduction ....... What Are Target Servers and Target Agents? .........................6 7......................... and Plug-Ins .................. Example: Discussion of PowerPC Build Spec Variants ......................................... Defining a New Target Server Connection ........................................................................................................................2 8..............................10 6.................................8 6...................... Running Applications on a Hardware Target .................................................. Reconfiguring Your Project Later in the Development Cycle ........................................................ 104 Defining a New Remote Connection ....................3 8....................................... 106 8 Running and Debugging VxWorks Applications .................. Shared Libraries........................................................5 7................... Creating a VxWorks Simulator Connection .......... 109 How Do I Create a Launch Configuration? .........6 6............................... 110 Running Your Applications ......7 6...............................................................................................................................13 Introduction ....................................... Example: Working with RTPs....................... Creating Shared Libraries .................................................................................................................................... Creating Plug-Ins ....... 67 67 68 69 71 72 75 81 82 82 83 84 85 93 7 Connecting to VxWorks Targets ........... 113 v ....... Creating Statically Linked Libraries ............ 7...... Using RTP Overlapped Virtual Memory ..........3 6...................... 109 How Can Workbench Help Me Run My Code? .................................12 6............................................2 7............... Deciding on an Application Type ...............................1 7.........7 Introduction .............. .........................................3 9..3 B..................................................................................................................................................................Wind River Workbench By Example..............................3 A.............. and Plug-ins ....... 123 Adding Kernel Applications to a VxWorks Image ................................................................................................................. 137 Files Common to Many Project Types ..... 125 Example: Bundling RTPs and Libraries with a VxWorks Image ...................5 DKM Project ....5 B............................. 123 9.......................1 9..... 138 Project Files in VxWorks Image Projects ............. 123 Reconfiguring VxWorks for Deployment .....................................2 9..................... 151 B....................... 148 Project Files in Shared Library Projects ............... 142 Project Files in Downloadable Kernel Module Projects ............ 116 Monitoring Semaphores During Debugging ......................................... 128 PART VI: REFERENCE A What Are All These Project Files For? .................6 A......................................................................................8 Introduction ...............................................2........4 Introduction ..........5 8............ 157 vi .......................................5 A............ 139 Project Files in VxWorks Source Build Projects ..... 146 Project Files in Boot Loader/BSP Projects ................6 Introduction .............................. 3.......................................................................................... 151 Before You Begin ....................................3 8.................................4 B........ 153 Launching a Kernel Task and Attaching the Debugger ..............1 A................................4 A..... 137 A................................................................... Shared Libraries............................ 118 PART V: DEPLOYING APPLICATIONS 9 Deploying VxWorks Systems ........................2 A........................7 Debugging Your Applications ...2 B........................7 A.................................................. 153 Using Existing Tornado 2.............5 Target ..................1 B....................... 115 Example: Debugging RTPs......................... 144 Project Files in Real-Time Process Projects ......................................................x Projects ...................... 151 Creating a VxWorks 5................ 152 Creating a VxWorks 5........................................................................ 149 B Debugging a VxWorks 5...........5.............x Target Server Connection ...........6 8.............................................................. Contents C Glossary ..................................................................................................... 159 C.1 C.2 C.3 Introduction ...................................................................................................................... 159 Searching for Terms in Online Documentation ........................................................ 159 Terms .................................................................................................................................. 160 Index ..................................................................................................................... 167 vii Wind River Workbench By Example, 3.3 viii PAR T I Introduction 1 Overview ................................................................................... 3 1 3 2 .Wind River Workbench By Example. 3. 2 How This Guide is Organized This guide is organized so that it follows the develop. By performing these tasks.1 Introduction 3 1. and deploy project life cycle. For information about how to accomplish this.windriver. The following task map lists the topics covering each life-cycle development phase.1 Introduction Welcome to Wind River Workbench By Example for the VxWorks target operating system. refer to the installation and licensing guides on the following Web site: http://www.3 Related Documentation 4 1. The purpose of this guide is to provide real-world examples of accomplishing tasks and solving problems that can occur during daily development. and deploy VxWorks images and applications. 3 . and shows where you can find the relevant information. debug. debug. install your Wind River platform.2 How This Guide is Organized 3 1.com/support/site_configuration 1. you learn how to use Wind River Workbench to develop. and complete all licensing requirements. NOTE: This guide does not cover installation and licensing issues. Before using this guide.1 Overview 1. including Workbench. and deploy VxWorks images and applications.3 VxWorks By Example Task Map Topic Description Where to Find the Information 2. Running and Debugging VxWorks Applications Deploying How to reconfigure VxWorks 9. and a glossary of terms. Deploying VxWorks Systems and add kernel applications to an image in the process of deployment. 4. Wind River Workbench By Example Guide This guide provides solutions to common VxWorks-related issues that can occur in everyday development. Developing How to create various projects. Building Applications and Libraries Debugging How to run and debug applications on your host system and target. how to debug a VxWorks 5. debug.5 target. 7. What Are All These Project Provides information on Files For? VxWorks project file types.5 B. and how to Workbench to get started using 3. Getting Started With Setting up your How to set up your host environment system and target. By working through the tasks in this guide. Debugging a VxWorks 5. Setting Up Your Host & Target Workbench. Glossary Reference 1. Target C. 3. 4 . you learn how to use Wind River Workbench to develop. 5. Connecting to VxWorks Targets 8. and VxWorks libraries. Working with Board Support Packages 6.3 Related Documentation The Wind River Workbench documentation set includes the following: Wind River Workbench By Example (this guide) Wind River Workbench User’s Guide Context-sensitive help.Wind River Workbench By Example. Configuring and Building build applications. A. 1 Overview 1.3 Related Documentation Wind River Workbench User’s Guide Refer to the Wind River WorkbenchUser’s Guide for general information about Workbench, including how to work with projects, build your applications, connect to and download your applications to targets, and work with version control systems, such as ClearCase. The User’s Guide also includes troubleshooting information and a glossary of terms. Context-Sensitive Help You can display context-sensitive help for a Workbench feature, and perform a keyword search for information about a feature. To find information about a Workbench feature, complete the following steps: 1. 2. In Workbench, navigate to the view, dialog, or feature for which you want help or information. Press the help key for your host: On Windows, press F1 On Linux and Solaris, press CTRL-F1 The Help view opens and displays a list of links to related documentation. To perform a keyword search, complete the following steps: 1. 2. In the Workbench menu, click Help > Search. In the Help view, search Expression field, type a term or phrase; then click GO. The Help view displays a list of links to related documentation. 5 Wind River Workbench By Example, 3.3 6 PA R T II Setting Up Your Environment 2 3 Getting Started With Workbench ............................................ 9 Setting Up Your Host & Target ................................................ 17 7 3 8 . 3.Wind River Workbench By Example. 1 Introduction 9 2. many of the views in the Basic Device Development perspective are empty. or import an existing one from one of your team members? Are you responsible for writing kernel or user space applications? Do you want a pre-built VxWorks image on which to run your applications.7 Customizing a Board Support Package 13 2. Subsequent chapters show you how to use Workbench to attain your development goals.11 Workbench Example Projects 15 2. answer the following questions: Do you want to build a new VxWorks image.2 Getting Started With Workbench 2. Before you start using Workbench.3 Deciding on a Kernel Image 10 2. you will 9 .10 Walkthrough Examples 14 2. Workbench opens to the Basic Device Development perspective. or a customized VxWorks kernel image that automatically starts your application at boot time? By default.9 Using the Wind River Workbench New Project Wizard 13 2.8 Deploying an Application with a System Image 13 2.5 Creating a Library to Use With an Application 12 2.1 Introduction This chapter discusses the decisions you need to make before you start to work with a development project in Workbench.2 The Benefits of Projects 10 2.4 Writing Applications in Workbench 11 2. As you work through the examples in this guide. When you first launch Workbench.6 Loading and Booting a Kernel Image 12 2. 13.3 Deciding on a Kernel Image A kernel image is necessary for a target to function properly. you must create a new project. Your Platform ships pre-built VxWorks kernel images for all supported board support packages (BSPs). which varies from one project type to another. p. 2.Workbench projects provide specific build support. see 2. you must understand when to use pre-built or custom kernel images. When to Use a Pre-built Image When to Use a Custom Kernel Image When to Rebuild VxWorks Libraries and Build a Kernel Image When to Use a Pre-built Image If your application does not require a specially configured kernel image. This means that you cannot change the type of a project after you create it.3 learn the purpose and function of these views.Wind River Workbench By Example. It allows you to create build targets with different build-related settings (called build specs). images. If. If you are responsible for writing applications. you can build the same sources for different target architectures or different toolchains by changing the active build spec of a project. or pre-built. and when to rebuild VxWorks libraries and build a kernel image.2 The Benefits of Projects Workbench supports a variety of project types. Using a build spec. hierarchical. 2.9 Using the Wind River Workbench New Project Wizard. 10 . Workbench provides a New Project Wizard that guides you through the steps required to create Workbench projects. 3. and if necessary. each of which creates a supportive framework for a specific task. after creating a project. Before you choose a kernel image. you can use one of the default. as well as the views in other perspectives. structures. you find that you chose the wrong project type. The examples in this guide show you the type of project best suited to the tasks they demonstrate. The Workbench project structure helps you to perform the following tasks: It allows you to manage your source code files by collecting them into logical. you need a kernel to test and run your applications. 2 Getting Started With Workbench 2.4 Writing Applications in Workbench You can find the pre-built kernel images, which are tested and ready to run, in the following location: installDir\vxworks-6.x\target/proj\bsp-toolchain\default\vxWorks The installDir variable in the path refers to the directory where Workbench is installed, and the bsp-toolchain variable corresponds to the board support package and compiler that are compatible with your target board. For more detailed information about how to use default images, see 3.5 Booting a Target with VxWorks, p.23. When to Use a Custom Kernel Image Use a custom kernel image if, for example, your application requires a bootable VxWorks operating system image to provide support for real-time processes. In this case, the Workbench structure you create to contain your sources is a VxWorks image project (VIP). Using a VIP based on the default VxWorks libraries, you can create a VxWorks image that you can link with kernel modules, or that you can configure to include a ROM file system (ROMFS) and real-time processes. Fore more information about projects in general, see 2.2 The Benefits of Projects, p.10. For more information about VxWorks image projects in particular, see 4. Configuring and Building VxWorks. When to Rebuild VxWorks Libraries and Build a Kernel Image Build VxWorks libraries and build a kernel image if you want your kernel image to support products, such as networking or security products, that are shipped with your Platform. If you want to reduce the size of a VxWorks kernel image, you can build a kernel image and exclude components you do not need. To rebuild libraries and build a kernel image, create and configure a VxWorks Source Build project (VSB) and then base your VIP on that project. For information about VxWorks Source Build projects, see 4.7 Creating a VxWorks Source Build Project, p.47. 2.4 Writing Applications in Workbench You can develop kernel space and user space applications in Workbench using similar develop-debug-deploy workflows. Workbench requires that you create project types based on the kind of application you are developing—kernel applications and user applications use different project types. 11 Wind River Workbench By Example, 3.3 About Kernel Applications Kernel applications run in kernel mode, with no barriers between the memory used by the kernel application and the memory used by the kernel itself. You can configure kernel applications to link statically into the kernel at build time, or as freestanding modules that download and link dynamically to the kernel at run time. If you are developing kernel applications, then a Downloadable Kernel Module (DKM) project provides the build support you need. For more information about DKMs, both static and dynamic, see Writing Kernel Applications, p.68. About User Applications User applications run in user mode, and are completely separate from the memory space used by the kernel. Wind River user applications are also known as real-time process (RTP) applications. If you are developing user applications, use a Real-Time Process project (RTP project). For more information about RTPs, see Writing Real-Time Process Applications, p.69. 2.5 Creating a Library to Use With an Application The type of application you are developing and its associated library determine the kind of Workbench project you must create. Use the following guidelines to decide on the project type: If you are developing a library that links statically to a kernel application at build time, create a Downloadable Kernel Module (DKM) project. If you are developing a library that links statically to a user application at build time, create a VxWorks Real-Time Process project. For information about how to do this, see 6.9 Creating Statically Linked Libraries, p.82. If you are developing a library that links dynamically to a user application at run time, create a VxWorks Shared Library project. For information about how to do this, see 6.10 Creating Shared Libraries, p.83. 2.6 Loading and Booting a Kernel Image To load and boot a kernel image, you can use the default boot loader that matches the BSP you installed with your Platform. You can also customize a boot loader to suite your specific needs. 12 2 Getting Started With Workbench 2.7 Customizing a Board Support Package Wind River provides default boot loaders with your Platform to boot your target automatically with VxWorks. For more information, see VxWorks Kernel Programmer’s Guide: Boot Loader. A custom boot loader can include a driver for a specific piece of hardware, or support for a new target board. To create a custom boot loader, create a VxWorks Boot Loader/BSP project. For information about how to do this, see 4.11 Loading the VxWorks Image onto the Target, p.54. 2.7 Customizing a Board Support Package Some projects might require features that are not included in the board support packages (BSPs) that shipped with your Platform. For such projects, you can create a VxWorks Boot Loader/BSP project and work with copies of existing BSP source files. This gives you a starting point from which to develop a custom BSP, speeds up development, and allows you to experiment without altering the VxWorks installation tree. For more information about customizing BSPs, see 5. Working with Board Support Packages. 2.8 Deploying an Application with a System Image In preparation for deployment, you can create a a read-only memory file system (ROMFS) that includes your RTP application, libraries, and other files. Incorporate the ROMFS into a VxWorks kernel image and deploy the application and kernel image as a single unit. To do this, create a VxWorks ROMFS File System project and configure the system to run your application automatically at boot time. For more information about how to do this, see 9.4 Example: Bundling RTPs and Libraries with a VxWorks Image, p.128. You can also deploy a kernel application with your VxWorks system. Link the application directly with the kernel and then configure the system to start it automatically at boot time. For details, see 9.3 Adding Kernel Applications to a VxWorks Image, p.125. 2.9 Using the Wind River Workbench New Project Wizard This section shows you how to create a new project using the Wind River Workbench New Project wizard. 13 click File > New > Wind River Workbench Project. then click Next. then click Browse to locate a directory outside your workspace. Create project in workspace with content at external location. you must have write permission for that location. Click Finish. click File > New. To use the shortcuts for creating projects if you work in this perspective. On the Project page. in the Workbench menu. Platform developers have access to kernel source and kernel tools. 2. in the Project name field.3 Workbench manages all application code in projects of one type or another. On the Target Operating System page. type a unique name for your project. Workbench opens the New Wind River Workbench Project wizard. On the Build Type page. press F1 On Linux and Solaris. To gain access to context-sensitive help from the New Project wizard. from the Target operating system drop-down menu.10 Walkthrough Examples The following list shows the examples in this guide that illustrate procedures common in many development environments: 14 . then click Next. choose one of the following options: Create project in workspace Create project in external location. from the Build Type drop-down menu. In the Workbench menu. 5. 4. 6. You can create projects in any location. complete the following steps: 1. select a build type. then click Browse to locate a directory outside your workspace.Wind River Workbench By Example. but usually you create them in a workspace directory—the directory where Workbench stores all of your work. Under Location. press CTRL-F1 To create a project using the New Project wizard. 3. The build type options available to you depend on your installed software. press the help key for your host: On Windows. whereas application developers do not. select a target operating system. Workbench shows your new project in the Project Explorer. NOTE: The Advanced Device Development perspective provides shortcuts for creating common project types. Workbench saves project administration files in the project directory. 3. so if you create projects outside the workspace. 2. 61 6.7 Example: Adding IPNet Support to a DKM. p.50 5.2 Getting Started With Workbench 2.85 7. p.4 Example: Bundling RTPs and Libraries with a VxWorks Image.3 Example: Customizing a BSP. p. click File > New > Example. p.5 Example: Connecting a Target Server to a Target Agent. In the New Project Sample dialog.6 Example: Debugging RTPs. 15 . and Plug-ins. In the New Example dialog.5 Target 2. p.72 6. p. then click Next. 2. click an example program.5 Example: Building a VIP With Sources in a Subdirectory. under Available Examples. p.11 Workbench Example Projects Workbench provides several sample projects that you can use to gain experience with the development environment.81 6.41 4.5 Example: Creating and Passing a Build Target.12 Example: Working with RTPs. p. Shared Libraries. in the Wizards list. complete the following steps: 1. In the Workbench menu.4 Example: Discussion of PowerPC Build Spec Variants.71 6. click a project type.11 Workbench Example Projects 4. then click Finish. 3.128 B. Debugging a VxWorks 5.104 8.9 Example: Customizing VxWorks Libraries as a Base For a VIP. p.116 9. To locate and open a Workbench sample project. and Plug-Ins. p. Shared Libraries. Wind River Workbench By Example.3 16 . 3. 20). p. p. 17 .5 Booting a Target with VxWorks 23 3. Substitute the actual path to your Workbench installation directory.4 Configuring Your Target. you need to configure your host and target: The network software on the host must be correctly configured (see 3. that will run on another system.18). The boot loader must be loaded onto your target (see 4.54). NOTE: Paths to Workbench directories and files are prefixed by installDir in this guide. Windows.4 Configuring Your Target 20 3. Your target must be connected and powered up (see 3. or Solaris) and produce applications that run on hardware that you would have no other convenient way of programming.11 Loading the VxWorks Image onto the Target.3 Configuring Your Host Machine 18 3. including how to download a prebuilt VxWorks image and boot your target.6 Troubleshooting VxWorks Boot Problems 25 3. or libraries. known as a host.3 Configuring Your Host Machine.2 What Should Your Development Environment Look Like? 18 3. such as a chip destined for a mobile phone. p. Cross-development allows you to write code on a system that you have available to you (such as a PC running Linux.3 Setting Up Your Host & Target 3. known as a target. kernel images. This chapter explains how to do these tasks. In order to work with VxWorks applications.1 Introduction Cross-development is the process of writing code on one system.1 Introduction 17 3. 18 . 3. Set up FTP on the host. also known as self-hosted. since this is not shipped with Workbench. 1. and resolved all licensing requirements. including Workbench. As mentioned earlier. development (in other words.windriver. see http://www. In addition.2 What Should Your Development Environment Look Like? The most common cross-development environment consists of a host machine where you do your development work. consult your operating system documentation or your local system administrator. Regardless of what your development environment looks like. For information on how to do that. you must start an FTP server on the host that the target is connected to.com/support/site_configuration/. If you need help configuring the networking on your host. Before you can continue. Step 2: Configure TCP/IP. You generally need to do these tasks only once per host. 3.3 Configuring Your Host Machine The first configuration tasks you need to complete are on your host machine. Install Workbench and other Platform products. 3.3 3. Before you can boot VxWorks over the network. a target board or simulator where you run your VxWorks kernel image and application(s). If you want to do native.Wind River Workbench By Example. Configure TCP/IP. Step 3: Set up FTP on the host. a compiler and other development tools (such as those shipped with your Platform) that are designed for cross development. this guide does not address installation and licensing issues. you want to develop applications that will run on your development machine rather than on a target) you must acquire a native tool chain. make sure you have all the necessary hardware and software elements configured before you begin your development work. you or someone in your organization must have installed your Wind River platform. Decide whether to enable logging. you must create a user ID and password in the FTP server application that matches the user ID and password that you will assign to the VxWorks boot loader on your target. preferably GNU. Step 1: Install Workbench and other Platform products. 2. This allows the host to recognize the target when it tries to download the VxWorks kernel image. 4. and one or more communication connections running between the host and the target. Your password must not be an empty string. e. leave the FTP server running.5 Booting a Target with VxWorks.23. 2. then click OK. Be sure to use this same user ID when you assign the user VxWorks boot parameter described in 3. such as C:\TEMP (WFTPD refuses to connect to a client unless you specify a home directory). p. Start the FTP server on the host by selecting Start > Programs > Wind River > VxWorks 6. Before an FTP client can connect to the FTP server. you can use the rsh utility on Solaris instead of FTP. and rsh is not available on Windows. as long as you permit sufficient disk access for the VxWorks boot loader to read the boot image on your Windows disk. select Security > Users/rights. When you have finished configuring your FTP settings. 1. If it is. 2. WFTPD. enter a user ID. Close the User / Rights Security Dialog by clicking Done. you must have an FTP daemon running on the host. enter and verify a password. Be sure to use this same password when you assign the ftp password VxWorks boot parameter. click New User. If you like. c. click OK. b. In the Change Password dialog. 19 . d. It must be running when the boot loader on your target tries to access the VxWorks image on your host. Configure a user name and password for the VxWorks boot loader on the target. From the WFTPD toolbar. the boot loader will try to use the UNIX rsh utility instead of FTP to load the kernel image. Step 4: Decide whether to enable logging. On Windows Hosts Your Platform includes an FTP server application.3 Configuring Your Host Machine On Linux or Solaris Hosts To use the default VxWorks configuration and boot VxWorks over the network. then click OK.3 Setting Up Your Host & Target 3. f. In the User/Rights Security Dialog. g. If you want to log FTP activities.x and General Purpose Technologies > FTP Server. Any directory is fine. you must complete the following steps: 1. select Logging > Log Options and select the types of activities you want to log. h. When you are finished. The log file will be saved in the home directory you specified above. Back in the User/Rights Security Dialog. enter a valid path for Home Directory. and the network must be able to authenticate the user ID and password that you assign to the VxWorks target. In the New User dialog. a. CAUTION: You should always discharge the static electricity that may have collected on your body before you touch integrated circuit boards. suppose your host system is called mars and has Internet address 90. and you want to name your VxWorks target phobos and assign it address 90. leading to intermittent errors or hardware failure. Failure to take proper ESD precautions can degrade target hardware over time. you can map machine names to IP addresses in a hosts file (on Linux and Solaris it is /etc/hosts.0. Placing your equipment on. Step 1: Assign the VxWorks target a name and IP address. ! Assign the VxWorks target a name and IP address.Wind River Workbench By Example. 2. including targets and network interface cards (NICs). or standing on. The hosts file must then contain the following lines: 90. 1.0. 5.4 Configuring Your Target The next configuration tasks you need to complete are on your target. Configure the Terminal view to open a serial connection. 6. Each line consists of an IP address and the name (or names) of the system at that address.50 mars phobos 20 . Set up a serial connection between the host and target. Using a Hosts File If you do not have a DNS server at your site.0. you would have to identify targets by IP address).0. you can configure your computer to use the DNS server to translate system names to network IP addresses. Connect a power supply.3 3. on Windows it is C:\Windows\system32\drivers\etc\hosts). Set board switches and jumpers. Set up an Ethernet connection between host and target.0. This file records the names and IP addresses of systems accessible on the network from the local system (otherwise. Using a DNS Server If you have DNS at your site.0. For example. an anti-static mat. 3. The way you coordinate target names and IP addresses depends on whether your site runs a Domain Name Service (DNS) or not. 3. Electrostatic discharge (ESD) precautions include: Touching the metal enclosure of a plugged-in piece of electrical equipment (such as a PC or a power supply in a metal case).1 90. You need to perform these tasks for each new target you want to connect to.50. Consult your operating system documentation on how to configure your system to take advantage of DNS.0. 4. Wearing an ESD wrist strap.1.0. You can use the Terminal view to open a serial connection from within Workbench. so if it has been misconfigured (if.x subnet Another entry that should appear in your hosts file is for localhost. minicom.0. use a non-crossover cable The host uses the network connection to transfer files. or telnet. 2. and wtxregd. as they could be assigned to someone else.1. start Workbench. Step 4: Configure the Terminal view to open a serial connection. for example. use a crossover cable when connecting your board to a LAN. 21 . Contact with your system administrator for available IP addresses. Step 2: Connect a serial cable between the serial ports on the host and target.0. the debugger. Step 3: Set up an Ethernet connection between host and target. Workbench expects localhost to resolve to 127.0.3 Setting Up Your Host & Target 3. ! CAUTION: If you are in a networked environment. it points to the IP address of the development machine) you may have problems with the interaction between Workbench. The host uses the serial connection to communicate with the boot loader on the target.0. If it is not already running.0. 1.0. Always make sure you use the correct cable: when connecting your board directly to your host. Set up a serial connection between the host and target. Stop any other program already using the serial port. do not pick arbitrary IP addresses for your host and target. Figure 3-1 Boot Configuration Example c:\temp\vxWorks HOST TARGET mars user: fred 90.1 phobos 90. including the VxWorks system image.4 Configuring Your Target This configuration is represented in Figure 3-1.0.0.50:ffffff00 Ethernet 90. Most targets include at least one on-board serial port. just as you would open a connection with any other terminal emulation program such as hyperterminal. Click Toggle Command Input Field to open a text inset field at the bottom of the Terminal view where you can enter and edit text.3. The contents of the text field are sent to the target when you press ENTER. To reopen the connection with the existing settings.x/target/config/bsp/target. Configure the terminal settings as appropriate for your system. Open the Terminal view (select Window > Show View > Terminal). issue the following command: $ . The view will expand to fill the Workbench window. For information about each option. Step 6: Connect a power supply. and you can use the up and down arrows on your keyboard to navigate through previously entered text. click Disconnect. These jumpers must be set correctly for your particular development environment before VxWorks can boot successfully. 9. You are now ready to boot a prebuilt VxWorks kernel image. make sure your path environment variable is set to include the path to your compiler. use the power supply recommended by the board manufacturer. 6.sh 3. which gcc should yield /usr/bin/gcc. 22 ./startWorkbench. You can determine the correct jumper configuration for your target CPU from the target reference for your BSP (such as installDir/vxworks-6. 7. press the help key for your host. Click Toggle Command Input Field to hide the text inset field again.3 On a Windows host. click Connect. Many CPU and Ethernet controller boards still have configuration options that are selected by hardware jumpers. To adjust the settings for your connection. For standalone targets.3 > Workbench 3. To get a better view of what is happening in the Terminal view. To disconnect from your target. select Start > Programs > Wind River > Workbench 3.Wind River Workbench By Example.ref) and the documentation provided by your target system’s manufacturer. 3. click the square Settings button to open the Terminal Settings dialog. 8. Typically. Then. On a Linux or Solaris host. NOTE: If you are using a Wind River ICE or Wind River Probe emulator to connect to your target. click OK to open a connection to your target. When you are finished. 4. from your Workbench installation directory. although this is less common than in the past. see the Wind River ICE SX for Wind River Workbench Hardware Reference or Wind River Probe for Wind River Workbench Hardware Reference for information about how to connect to your target. 5. Step 5: Set board switches and jumpers. double-click the tab at the top of the view. With your target connected to your host and a serial connection open in the Terminal view (see 3. you are ready to boot VxWorks on the target. p. 4. To print the current (default) boot parameters. 5. Press any key on the keyboard during that seven-second period to interrupt the boot process..18 is still running on the host where the VxWorks image is stored.0. then interrupt. the boot process on the target.4 Configuring Your Target. the boot process on the target.20). Reset your target by pressing the reset button. You must start and then interrupt the default boot loader on the target in order to get a VxWorks Boot prompt.50:ffffff00 host inet (h) : 90. 2. type p at the boot prompt: [VxWorks Boot]: p A display similar to the following appears. Boot the target with new parameters. and then starts a seven-second countdown.0. type c at the boot prompt: [VxWorks Boot]: c 23 . 3. 1. To change the boot parameters to match the settings for your system. Step 2: Enter new boot parameters. Initiate. Enter new boot parameters. click Connect on the Terminal view toolbar. The boot program displays a banner page in the Terminal view. make sure the FTP server you started in Step 3:Set up FTP on the host. from there. you can provide new boot parameters and download a new VxWorks kernel image. Here is a summary of the steps you will follow: 1. Step 1: Initiate.1 user (u) : fred ftp password (pw)(blank=use rsh) :secret target name (tn) : phobos This example corresponds to the configuration shown in Figure 3-1.0. If you are using a VxWorks image configured for a network connection (which is the default). 1. available in the Workbench help system. boot device : ln unit number : 0 processor number : 0 host name : mars file name : c:\temp\vxWorks inet on ethernet (e) : 90. or by powering off the target then powering it on again. 3.5 Booting a Target with VxWorks Once you have configured your host software and target hardware. Each of these parameters is described in VxWorks Kernel Programmer’s Guide: Boot Loader.3 Setting Up Your Host & Target 3.0. p.5 Booting a Target with VxWorks 3. The boot program displays the VxWorks boot prompt: [VxWorks Boot]: 2. then interrupt. – – – – If a particular field already has the correct value. Boot the target with new parameters. sometimes accompanied by other messages about optional VxWorks facilities. see Assign the VxWorks target a name and IP address. To back up and change the previous parameter. so press ENTER a couple of times to get past the first few parameters. In the target name field. p.Wind River Workbench By Example. and the boot process begins. In the host inet field. You will see the following information during the boot process: a. Press ENTER. p. ). type the password you created in 3. 8. it begins just as the boot loader did. To clear a field. 7. Step 3: In the ftp password field. type the IP address of the host. On a UNIX host. The boot program first initializes its network interfaces. then a colon. The first parameter you probably need to change is the host name. the network-initialization messages appear again. initiate booting by typing the @ command: [VxWorks Boot]: @ The VxWorks boot program prints the boot parameters you entered.3 Configuring Your Host Machine. 9. After the system is completely loaded.rhosts file (~userName/. c. When VxWorks starts up. In the file name field. then the subnet mask. On a Windows host. p. 5. If you want to quit before completing all parameters. type the full host side pathname of the VxWorks image you want to boot on the target (if you want to use one of the pre-built VxWorks images.equiv file.rhosts). 1. 4. press ENTER. the user must be granted access by adding the user ID to the host's /etc/host. 6. type the user ID used to access the host for the purpose of loading the VxWorks image file specified in the file name parameter.3 2. Use the user name you created in 3.18. For rsh. type CTRL+D.18.3 Configuring Your Host Machine. then type in the name of the host machine to boot from. by initializing its network interfaces.20). the user must have either FTP or rsh access. or more typically to the user's . 3. 3. or those known to your DNS server (for details. type a hyphen (-).x/target/proj/bsp-toolchain/default). the user must have FTP access to the host. The boot program prompts you for each new parameter. For rsh access leave this field blank. type the IP address of the target. type a period ( . Remember that the host and target IP addresses must match those in your hosts file. In the user field. After entering the boot parameters. In the inet on ethernet field. then press ENTER. they are located in installDir/vxworks-6. b. 24 . then press ENTER.. type the name of the target. the boot loader displays the entry address and transfers control to the loaded VxWorks system. A NULL modem cable may be necessary. VxWorks is up and ready to attach to the Workbench tools. Check that the RS-232 cables are correctly constructed In most cases. What to Check Most often. Limit the number of variables Start with a minimal configuration of a single target. Rebooting by any of these methods also restarts the attached target server on the host. Turn the target’s power off and on. 3. Hardware Configuration If you are using an emulator See the Wind River ICE SX for Wind River Workbench Hardware Reference or the Wind River Probe for Wind River Workbench Hardware Reference for information on troubleshooting those connections. This section discusses the most common sources of error.3 Setting Up Your Host & Target 3. Step 4: Reboot VxWorks when necessary. your hardware configuration. a problem with booting and connecting to VxWorks can be traced to configuration errors in hardware or software. After this point.6 Troubleshooting VxWorks Boot Problems 2. you can locate the problem just by re-checking the installation steps. if that is what your target requires. Invoke reboot( ) from the host shell. there are many possible causes. – – – – Type CTRL+X in the Terminal view. Please read this section before contacting Wind River customer support. Often. you will see a [VxWorks Boot] prompt. Consult the following checklist to locate a problem. and so forth. Other Windows terminal emulators do not pass CTRL+X to the target. 25 . there are several ways you can reboot it. because of its standard Windows meaning. When VxWorks is running. When you reboot VxWorks in any of these ways. Press the reset button on the target system.6 Troubleshooting VxWorks Boot Problems If you encountered problems booting or exercising VxWorks. the auto-boot sequence begins again from the countdown. the documentation accompanying your target system describes its cabling requirements. If Loading.. 3. If the line Starting at is printed and there is no further indication of activity from VxWorks. this generally indicates there is a problem with the boot image. Press the RESET button if required Some system controller boards do not reset completely on power-on. Check the boot ROM(s) for correct insertion If the target seems completely dead when applying power (some have front panel LEDs) or shows some error condition (for example. a bad host or gateway Internet address). NULL modem cables tend to have same gender connectors on each end. red lights). this may indicate problems with the Ethernet cable or connection. verify that the system controller is configured properly and the network interface card is properly jumpered.3 NOTE: If you need to use a gender converter to connect your serial cable. 26 . Straight through cables tend to have one male and one female connector. Verify IP addresses An IP address consists of a network number and a host number. This error may also indicate a problem with the network driver in the newly loaded VxWorks image. p.24 assumes that the host and target are on the same network— they have the same network number. Changing the gender of a cable rarely has the desired results. but in all cases. you must reset them manually. Booting Problems Check the VxWorks boot display If Attaching network interface is displayed without the corresponding done. Consult the target documentation if necessary.. connect a known working system to the Ethernet cable and check whether the network functions. The simple configuration described in Boot the target with new parameters. the VxWorks boot program displays the following message: Error loading file: errno = 0x33. such as both female or both male.Wind River Workbench By Example. is displayed for more than 30-45 seconds without the size of the VxWorks image appearing. or an error in the network configuration (for example. it is most likely not the right kind of cable. Check the Ethernet transceiver site For example.. There are several different classes of Internet addresses that assign different parts of the 32-bit Internet address to these two parts. If the target Internet address is not on the same network as the host. the boot ROMs may be inserted incorrectly. the network number is given in the most significant bits and the host number is given in the least significant bits. Make sure all boards are jumpered properly Refer to the target information reference for your BSP and the target documentation to determine the correct dip switch and jumper settings for your target and Ethernet boards. .3 Setting Up Your Host & Target 3. p. Check the WFTPD Server Log The WFTPD server log displays very helpful plain text messages.. p. Verify FTP server permissions Check the FTP server configuration. See Set up FTP on the host. Otherwise. For information about how to enable logging FTP activities.6 Troubleshooting VxWorks Boot Problems For a discussion of VxWorks error status values. consult your system documentation on the FTP Server shipped with it. see the errnoLib reference entry by typing errnoLib into the help view’s Search field. 27 .18 for more information on configuring the FTP server if you are using WFTPD (shipped by Wind River).19. see Decide whether to enable logging. 3.Wind River Workbench By Example.3 28 . ......................PA R T I II Customizing the Operating System 4 5 Configuring and Building VxWorks ................................ 59 29 ........... 31 Working with Board Support Packages ......... Wind River Workbench By Example.3 30 . 3. applications.4 Configuring and Building VxWorks 4. 31 .3 Creating a Custom VxWorks Image 32 4. If you need only a basic VxWorks kernel to boot your target.8 Configuring Custom VxWorks Libraries 49 4.9 Example: Customizing VxWorks Libraries as a Base For a VIP 50 4. source analysis. configuring. Start by creating a VxWorks Image project in Workbench.6 Importing and Migrating Existing VxWorks Image Projects 43 4. A VIP can contain only the files needed to create a kernel image.7 Creating a VxWorks Source Build Project 47 4.4 Configuring VxWorks 37 4. and building a kernel image.11 Loading the VxWorks Image onto the Target 54 4. use one of the pre-built images shipped with your Platform.10 Rebasing VSB and VIP Projects 53 4.1 Introduction 31 4. You need to include a component inVxWorks to enable one of the products shipped with your Platform.5 Example: Building a VIP With Sources in a Subdirectory 41 4. and other settings that streamline tasks such as creating.1 Introduction A VxWorks Image project (VIP) provides build. or you can add a VxWorks ROM file system (ROMFS) project and kernel modules. see 2. libraries. and data files to link a complete system into a single image.3 Deciding on a Kernel Image. Consider configuring and building VxWorks if the following conditions apply: You are a kernel developer tasked with tailoring VxWorks to your particular system requirements.2 Before You Begin Creating a Kernel Image 32 4. For details on 32 . 3. For instructions about how to use these images. a corresponding VxWorks Image project (VIP).11 Loading the VxWorks Image onto the Target. p.3 Creating a Custom VxWorks Image In this section you learn how to create a custom VxWorks image.23.3 p. see 4. p. The only exception to this rule is that RTP application executables can be run on both UP VxWorks and VxWorks SMP (when all else is the same). and how you can change the build spec and build target for an existing VIP. 64-bit VxWorks. and answer the following questions: Do you want to run your image on the VxWorks simulator. Prerequisites Consider the following questions before you create a custom VxWorks image: Upon what is your project based? Project creation is faster if you base your project on an existing VIP. 4. or for a VxWorks system based on variant libraries produced with a VxWorks source build (VSB) project—or for any supported combination of these variants. For more information about Boot Loader/BSP projects. because the project facility copies configuration information instead of regenerating it from BSP configuration files. VxWorks SMP. ! CAUTION: Code built for variants of VxWorks or for different releases of VxWorks is not binary compatible between variants or releases.37. 4.10.Wind River Workbench By Example.5 Booting a Target with VxWorks.4 Configuring VxWorks. 32-bit VxWorks. Code must be built specifically for uniprocessor (UP) VxWorks. consider the kernel image you plan to build with the project. For details. see 3.54. see 4. or on an actual target board? Do you have an existing project in your workspace whose settings you want your new VIP to inherit? Do you want to include debugging or networking support from the start? Or has one of your team members used a VxWorks Source Build (VSB) project to rebuild VxWorks to include or remove particular components? You can save time by answering these questions before you create your project although it is possible to configure some VIP project settings at a later stage. p.2 Before You Begin Creating a Kernel Image Before you create a VxWorks Image project. 47. You must create a new project with the correct BSP. Creating a Custom VxWorks Image and VIP This task shows you how to create a custom VxWorks image and a corresponding VIP. change to the Advanced Device Development perspective. For details. Once the VIP is created. you cannot change the BSP it is based upon.4 Configuring VxWorks.7 Creating a VxWorks Source Build Project. and so on) that Workbench uses to build projects. Is a kernel configuration profile right for your project? Your BSP and address mode choices determine the profiles that Workbench offers. do the following: 1. To create a custom VxWorks image. The options you select in the VxWorks Source Build (VSB) project determine the BSP and tool chain options available for your VIP. see 4. Do you want networking and multiprocessing support? Options available to you can vary depending on the Platform you installed and the BSP you chose for your project. and the address mode in turn determines the tool chain you can use.6 Importing and Migrating Existing VxWorks Image Projects. The following are a few options that might be available: IPv6 enabled kernel libraries—Creates IPv6 support. 33 . For information about the settings and options of the BSP validation test suite.43.3 Creating a Custom VxWorks Image importing a VIP into your workspace from another workspace or from a team member. Workbench manages its UI components. SMP support in kernel—Creates a symmetric multiprocessing configuration of VxWorks. In Workbench. Once your VIP is created.37). but you do not need to select one now—you can create the same configuration using the Kernel Configuration Editor (see 4. see the VxWorks BSP Validation Test Suite User’s Guide. IPv6_only enabled kernel libraries—Creates IPv6_only support. and presents only the settings appropriate for your BSP and address mode choices. see 4. Using a profile can save you work. NOTE: It is not necessary to make a selection on every screen. The address mode (ILP32 support or LP64 support in the kernel) you choose for your VIP depends on the BSP on which you want to base your project.4 Configuring and Building VxWorks 4. you cannot change it to a uniprocessor or asymmetric multiprocessor configuration. p. p. p. If you base your VIP on a BSP you must also select a tool chain (the compiler. Do you want support for the BSP validation test suite? Support for the BSP validation test suite is available for all non-simulator BSPs. linker. Profiles are preconfigured collections of kernel components that provide the described capabilities. 4. or the Intel C++ Compiler (icc) if your project is based on an Intel CPU. such as the GNU compiler (gnu).3 If you have not opened this perspective before. or if you plan to create or import sources later. select linux On a Solaris host. On the Project page. select Create project at external location. select a project in your workspace or click Browse to select a similar project from another location. To create the project in the current workspace. You. To base a VIP on a VxWorks source build (VSB) project. then click Browse to navigate to the new location. In the Workbench menu. type a name for your project. click Browse to locate the package. To create the project outside your workspace. This is a good idea if you do not have write permission to the location of your source files. To base your VIP on another VIP or a Boot Loader/BSP project. select Create project in workspace. 3. 3. Under Location. This step defines the location from which Workbench retrieves the build settings and other settings for the project. then click Next. select solaris To use a BSP provided by someone in your organization or a third party. then from the Project drop-down list. 34 . or if you plan to add your project to source control and the sources are outside your workspace. select a location to store your project files. then from the Project drop-down list. or someone on your team. In the Address mode drop-down list. then from the BSP drop-down list select the VxWorks simulator on which to run your image. select the project type or package on which to base your project. On a Windows host. 2. select a project in your workspace or click Browse to select a similar project from another location. in the Workbench menu click Window > Open Perspective > Advanced Device Development. the Wind River Compiler (diab). select one of the tool chains you have installed. Choose this option if you have write permission to the location of your sources (so you do not have to import them later). 5. select an existing project. select a board support package that supports your target hardware. select simpc On a Linux host. On the Project Setup page. To base a VIP on a BSP. must have created the VSB project and rebuilt your VxWorks source libraries. Workbench starts the New VxWorks Image Project wizard. select the address mode support you want to use in the kernel— either 32-bit kernel or 64-bit kernel. From the Tool chain drop-down list.Wind River Workbench By Example. click File > New > VxWorks Image Project. from the Based on drop-down list. under Set up the project. select a source build project. 6. select one of the following kernel configuration profiles: PROFILE_COMPATIBLE This profile provides a minimal configuration. The WDB Target agent is disabled by default unless you are working with a simulated target. Press the help key for your host for more information about selecting settings and configuring the indexer. in the Profile drop-down box. then click Options. click Add support to project. (Optional) Under BSP validation test suite.3 Creating a Custom VxWorks Image NOTE: The address mode you can choose for your project depends on the BSP on which your project is based. b. NOTE: SMP support is available only if it is supported by your product activation file (*. (Optional) On the Options page. then under Select indexer. (Optional) On the Indexer page. If you see an option but cannot select it. Click Browse to navigate to the location in which to store the test results. select a test suite and provide board and host configuration information.install. then click Next. choose an indexer and the settings you want to use. and the address mode in turn determines the tool chain you can use. The WDB Target Agent is a software component that resides on your target system and that makes it possible to use Workbench debugging tools with your target applications. If you do not see the option you want. then click Next. 8. 35 . click Enable project specific settings.txt) and the BSP you selected. select a different BSP. 7. Click Close. but the option is not enabled in your product activation file. PROFILE_BOOTAPP This profile adds boot loader capabilities to a default VxWorks image.4 Configuring and Building VxWorks 4. This step includes support for the BSP validation test suite. c. Click Configure Workspace Settings to examine these settings. click Enable WDB Target Agent if you plan to use Workbench debugging tools to debug your target applications. (Optional) Under Target Agent. 9. (Optional) On the Configuration Profile page. PROFILE_DEVELOPMENT This profile creates a VxWorks image that includes development and debugging components. select the networking and multiprocessing support you want to use in your VIP. Most projects work properly if you use the general indexer settings applied to all projects. 10. a. under Options. In the dialog box. your BSP supports the feature. PROFILE_ENHANCED_NET This profile adds to the default image the components appropriate for typical managed network client host devices. then click New > Build Target. see Creating a Custom VxWorks Image and VIP. For example.54 and the Customizing and Building Boot Loaders section in VxWorks Kernel Programmer’s Guide: Boot Loader. The target node name includes the suffix (default). In the Project Explorer. see the VxWorks Kernel Programmer’s Guide. to build a vxWorks_rom image successfully. and shows both project files and linked resources. Changing the Image Type for a VIP This section shows you how to change the build spec and build target for an existing VIP. This gives you an opportunity to fix just the setting that caused the problem. For more information. If you do not want to fix the problem and would rather create the project now. When you create a VIP. see Specifying a Non-Default Driver. vxWorks and a vxWorks target node appear in the project. p. the build spec default_rom must be used with the build target vxWorks_rom.11 Loading the VxWorks Image onto the Target. rather than resetting all the selections in the wizard. click Cancel. Doing so creates a different image type for the project. you might have specified the diab tool chain.Wind River Workbench By Example. There are four types of vxWorks images: vxWorks (default) vxWorks_rom vxWorks_romCompress vxWorks_romResident For more information about these image types. Workbench sets the default build spec and build target to default. see 4. For more information about profiles. right-click the project name. 36 .41. 3. Click Finish. To change the image type for a project. You must have an existing VIP before you begin this task. complete the following steps: 1. For information about selecting non-default drivers. p. which shows that the default build spec is set for the project. NOTE: The build spec and build target must match for any given image type. Workbench displays your new project in the Project Explorer. see VxWorks Kernel Programmer’s Guide: Kernel Facilities and Kernel Configurations and the help page for vxprj::profile. p. Click OK to reopens the New Project wizard complete with all the settings you chose while creating the project. NOTE: If Workbench encounters a problem while creating the project (for example. but the selected BSP supports only gnu) Workbench displays an error that describes the problem.33. For more information about boot loaders.3 11. enable the WDB Target Agent in the Kernel Configuration Editor. NOTE: A mismatched spec and build target result in a build failure. For example.33. on the Build Target page. then click Finish. include. since you no longer need the Workbench-target connection. If you receive a build failure message. If you are working with an existing VIP. p. You can configure. But you might want to remove it when you deploy the system. right-click the project name. 3.1 Configuring VxWorks Using the Kernel Configuration Editor. or specify a non-default driver for your system. p. type a new name for the build target (for example. This service provides full access to VxWorks memory. see Creating a Custom VxWorks Image and VIP. Workbench needs the WDB target agent to communicate with the target. Wind River recommends removing WDB from VxWorks for production systems. To enable the WDB Target Agent.4. unless you are working with a simulated target.4 Configuring and Building VxWorks 4. then click Build Options > Set Active Build Spec > vxWorks_rom. NOTE: The WDB Target Agent is disabled by default. Workbench displays the new target node in the Project Explorer. This step sets the build spec that is appropriate for the build target you just created. then click Build Target. you might need to change a port number or timeout setting for a networking component. see 4. 4. depending on the requirements and stage of development of your application. During the development cycle. In the Project Explorer. or exclude components. in the Build target name text field. 4. it is enabled on UDP port 17185.4 Configuring VxWorks The VxWorks kernel is a flexible operating system made up of many different components. For example.38. ! CAUTION: When VxWorks is configured with the WDB target agent. Right-clicking the new target name (for example. vxWorks_rom for example).4 Configuring VxWorks 2. repeat Step 2 and Step 3 to make sure that the build target and build spec are compatible. to build a vxWorks_rom image successfully. 37 . and allows for writing to memory as well as for calling routines. Or you might find it useful to configure VxWorks with components to provide POSIX support. The build spec and build target must match for any given image type. the build spec default_rom must be used with the build target vxWorks_rom. vxWorks_rom). In the Build Target dialog. then double-click the Kernel Configuration node. click Check to open a Check dialog that provides information about the component — its type and whether or not it is installed and available for use.9 or later) hypertext links to the CDF file. A family name appears in bold type if any of its components are included.x/target/config/comps/vxWorks and then reopen the Kernel Configuration editor. 4. such as those needed for specific kernel shell configurations or POSIX functionality. and then reopen the Kernel Configuration editor for the CDF changes to take affect. in the context menu. it is highlighted. Pale icons and grey italics indicate that a component is not installed. In such cases. you must delete the CxrCat. to see a component in context.3 NOTE: When CDF files are modified outside Workbench. 3. Pale icons and plain type indicate that a component or family of components is not included in the image. delete the file.txt file in installDir/vxworks-6. click the hypertext link. either intentionally or automatically when a patch is installed. The Components tab Displays a tree of bundles and. at the leaf nodes of expanded bundles. The Bundles Tab Allows you to add or remove entire bundles of components. Configuring VxWorks Using the Kernel Configuration Editor. double-click your VIP. including BSP and toolchain information and estimated size of the image. or files. When you click a component. individual components and their parameters. right-click it and select Show in Component Configuration. that define the component.Wind River Workbench By Example.txt file must be regenerated. You can also right-click a component and. p. Clicking a bundle shows you the components it contains (and that will be included in your kernel image by adding this bundle). but is installed and available. The availability and status of a component or family is indicated by its typeface: Bold icons indicate that a component is included in the image. You will see three tabs arranged along the bottom edge of the view: The Overview Tab Provides a read-only summary of the configuration. 38 .1 Configuring VxWorks Using the Kernel Configuration Editor Workbench provides the Kernel Configuration Editor as a quick way to customize your kernel. To open it. The Synopsis tab shows a brief description of the purpose of the highlighted component and (if you are working with VxWorks 6. which does not happen automatically when changes are made to CDF files outside Workbench.4. To open a CDF file in a text editor at the line that defines the component.38 This action is necessary because the CxrCat. indicating that ping will be included in your kernel image the next time you build it. right-click the PING Components folder and select Include. You can search for ping in two ways: by name and by description. But if you are not sure where it is. 2. see the Wind River VxWorks Platforms User’s Guide. you can use the Find dialog. so click Select All. If you know where ping is located you can navigate to it using the Editor’s tree structure. and the parent nodes for the folder appear in the Component tree pane. To include ping in your image. You will also see a star-shaped overlay icon. Open the Kernel Configuration Editor. The tree structure opens and the folder is highlighted. you want both the IPCOM ping commands and the PING client. If you accept the changes. indicating that your changes have not yet been saved. then click Next. 2. 3. Include the component in your image. 4. To navigate to the folder. Search for the component to include. 1. To do that. click Finish to complete the configuration. type ping. or just for convenience. For this example. Build your project. Building your project saves the changes automatically. type CTRL+F or right-click and select Find. follow these steps: 1. 3. Step 1: Open the Kernel Configuration Editor. 4. Double-click the Kernel Configuration node of an existing VxWorks Image project to open the Kernel Configuration Editor. 39 . Step 2: Search for the component to include. select Description at the top of the dialog. In the Include dialog. double-click it or select it and click Find. The PING Components folder and its contents appear in the Matching pane. such as Wind River Firewall and Wind River Network Stack. Workbench determines if there are any dependent components that it must also include to support ping.4 Configuring VxWorks NOTE: You must configure and build certain products. In the Kernel Configuration Editor you will see that the PING Components folder is now bold.4 Configuring and Building VxWorks 4. and displays them along with the estimated change in the size of your image from including these components. In the Pattern field. Step 3: Include the component in your image. From the Components tab. 3. For details. but 4. before you can include them in your image. 1. Including Components in a Kernel Image Say for example that you would like to include ping functionality in your kernel image. 2. leave all components selected. Build your project. click Finish. Double-click the Kernel Configuration node of an existing VxWorks Image project to open the Kernel Configuration Editor.Wind River Workbench By Example. This means that the networking components are still installed and available. you could clear components at this point. p. To complete the configuration. 3. Step 4: Build your project. right-click your project and select Build Project. Select the component to exclude. or you can press CTRL+S to save them without closing the view. the Project Explorer must include an existing VxWorks Image Project (VIP) in its list of projects. Step 1: Open the Kernel Configuration Editor. For now. then click Next. Step 2: Select the component to exclude. but it is no longer bold. Open the Kernel Configuration Editor. Creating a Custom VxWorks Image. To do this. Step 3: Build your project. 2. follow these steps: 1. 1. The Exclude dialog appears. and displays them. Workbench determines if there are any dependent components that must also be excluded along with the networking components. or click the Build Projects icon on the toolbar. You will also see an overlay icon indicating that the component has changed. but the change has not yet been saved (it will be saved automatically when you build your project). but shows you how to exclude networking components from an image.32. The Exclude dialog displays all the networking components that will be excluded from the kernel image. 3. 3. or click the Build Projects icon on the toolbar. The ping components are included in the resulting VxWorks kernel image. In the Kernel Configuration Editor you will see that Network Components is still visible. For information about how to create a VxWorks Image project. This task is similar to the task for including components. Excluding Components from a Kernel Image You can exclude components from a kernel image to decrease its size and streamline performance. but they are not included in your kernel image. 2. 40 . Since Networking Components is a top level component. Right-click it.3 you can save them manually by closing the Editor view and selecting Yes when Workbench asks to save your changes. it is immediately visible. If you wanted to keep any components in the image. The networking components will be excluded from the resulting VxWorks kernel image. then select Exclude. In the Project Explorer. To complete this task. In the Project Explorer. right-click your project and select Build Project. 2.x/target/config/bspName/config. p. and then clicking Next. choose one of the following options: Refer to Including Components in a Kernel Image. complete the following steps: 1. For information about the VxBus drivers available for your system. open it and press the help key for your host. click File > New > VxWorks Image Project. see installDir/vxworks-6.c. In the Workbench menu. Create a VIP project by selecting File > New > VxWorks Image Project.5 Example: Building a VIP With Sources in a Subdirectory For more information about kernel components. Specifying a Non-Default Driver Your system might require a supported driver that is not provided as the default.h before you create a VxWorks image project. or a driver that is not VxBus-compliant. select a location to store your project files. then click Next. see the VxWorks BSP References. Workbench starts the New VxWorks Image Project wizard. In Workbench. 4. Add or remove drivers that are not compatible with VxBus (only) in installDir/vxworks-6. For more information about the Kernel Configuration Editor.x/target/src/hwif/util/cmdLineBuild.4 Configuring and Building VxWorks 4.40 to add or remove VxBus-compatible drivers in the same way you include or exclude other components from a kernel image. see the VxWorks Kernel Programmer’s Guide: Kernel. For information about non-VxBus drivers supported for a given BSP. NOTE: Make changes to config.39 and Excluding Components from a Kernel Image. To build a VIP with sources in a subdirectory. change to the Advanced Device Development perspective.h using the #define or #undef preprocessor directives to define or undefine the respective macros.5 Example: Building a VIP With Sources in a Subdirectory This example shows you how to create a VIP with sources in a subdirectory that contains a makefile fragment. Under Location. On the Project page. type a name for your project.h after you have created a VIP. specifying a location. 5. If you have not opened this perspective before. 4. entering a name for the project. in the Workbench menu click Window > Open Perspective > Advanced Device Development. p. 3. To specify a non-default driver. The project does not recognize any changes you make to config. 41 . select the project type or package on which to base your project. p.4.makefile: 42 . or if you plan to add your project to source control and the sources are outside your workspace. p. In the New File dialog.Wind River Workbench By Example. right-click your VIP. b. select the simpc BSP and the diab tool chain. unless you are working with a simulated target. 6. 3. then click Finish.h" void helloworld(void) { printf("helloworld"). Create a makefile fragment: a. from the Based on drop-down list. then click Browse to navigate to the new location. Create a new project folder: a. 9. select Create project in workspace. Press CTRL+S to save the file. The new hello. To enable the WDB Target Agent. Choose this option if you have write permission to the location of your sources (so you do not have to import them later). c.makefile. To create the project outside your workspace. Right-click the dummy folder.c: /**************************/ #include "stdio. This is a good idea if you do not have write permission to the location of your source files. type hello.33. In the New File dialog.38 7. then click Finish. The new hello. On the Project Setup page. 10.makefile file opens in the editor.c file opens in the editor. select Create project at external location.c. type dummy. then click New > Folder. In the Folder name field. Add the following content to hello. type hello.1 Configuring VxWorks Using the Kernel Configuration Editor. If you are working with an existing VIP. In this case. in the File name field. NOTE: The WDB Target Agent is disabled by default. In the Project Explorer. 8. b. then click Finish. Click Next to step through subsequent dialogs pages. Add the following content to hello. or if you plan to create or import sources later. } /**************************/ d. Create a new source file: a. under Setup the project.3 To create the project in the current workspace. in the File name field. then click New > File. Right-click the VIP root directory. You do not need to adjust any other settings. see 4. c. b. see Creating a Custom VxWorks Image and VIP. enable the WDB Target Agent in the Kernel Configuration Editor. then click Finish. then click New > File. then click Build Project.6 Importing and Migrating Existing VxWorks Image Projects Importing and migrating projects into your workspace achieve similar results. You can adjust the link order of object files in the Build Properties dialog.\ ccpentium hello. right-click your project. In the Project Explorer. Adding Existing Sources to a VIP If you add existing source files to a VIP.4 Configuring and Building VxWorks 4. Workbench automatically adds the object file to the bottom of the link order. The file moves up or down in the list and link order accordingly. under Object files.c -o hello. 4. click the name of the file whose link order you want to change. choose one of the following steps: Select the source files and drag and drop them into the VIP. Select the source files and copy and paste them into the VIP. Right-click the VIP project name. The following rules apply to these operations: Importing a project—Workbench copies an existing project from its original location into your workspace without changing any files inside the project.\ rm hello. 2. 11.o d. 3.6 Importing and Migrating Existing VxWorks Image Projects # Makefile all % : cd dummy. In the Properties dialog.o object file that Workbench later links into the final vxWorks kernel image.o. To adjust link order. On the Content tab. Press CTRL+S to save the file. 4. Adjusting Link Order When you add source files to a VIP. then click Properties > Build Properties. complete the following steps: 1.c source file and creates a hello. then click Up or Down. The Content page of the Build Properties dialog allows you to manage object files that are directly linked into the VxWorks kernel image as part of the VIP. click the Content tab. To add existing sources to a VIP. 43 . Workbench can change project files. Click OK. the VIP picks up the new files next time you build the project. but when migrating projects. to save the build properties. on the Build Properties page. These steps build the dummy/hello. and if it is appropriate for your task. 5. On the Import Projects page. In the Import dialog. If a team member used Workbench to export a project to an archive file. A member of your team wants to share a project with you.3 Migrating an older project—Workbench automatically updates its Workbench-specific files to be compatible with the current version of Workbench.Wind River Workbench By Example. To import a project from a file system. Click Finish. rather than importing it into your workspace. click Select root directory. You created a VIP using vxprj on the command line and now you want to gain access to it from Workbench. Workbench creates a reference to the project. you can import that project into your workspace. click General > Existing Projects into Workspace. 3. You want to test the capabilities of a prebuilt VIP. 2. complete the following steps: 1. Project Explorer now displays the imported project. If you do not select this check box.wpj file). 4. such as the SMP-enabled VIP projects provided with the UP version of VxWorks. In the Projects pane. and creates (or recreates) any project files that might have been added or whose format has changed since the version of Workbench that created the project. click Browse to locate the project’s directory (the directory that contains the project’s *. In the Workbench menu. then click Next. This section describes both of these tasks. so that you will not have to recreate everything manually. select the project. 44 . For details on using vxprj to create projects. see the VxWorks Command-Line Tools User’s Guide: Working with Projects and Components and the vxprj API reference entry. You created a VIP using a previous version of Workbench or VxWorks and now want to use it with the current version. Importing Projects You can import a project from another location in the file system. under Select an import source. click File > Import. select Copy projects into workspace. on the Select page. then click OK. Why Import or Migrate a Project? There are several reasons why you might want to import or migrate a VIP into your workspace: You created a VIP in another workspace and want to incorporate it into your current workspace. 3. x Image Project into Workspace. and then click Finish. In the Projects pane. To migrate a project with unmodified Makefile templates. The project disappears from the Project Explorer. Select File > Import > VxWorks 6. if changes were made to the .wrmakefile and the vxWorks. you must manually migrate your changes to the new version of the file. click General > Existing Projects into Workspace. click Open. Only with this wizard are both the . Migrating Projects You can use several methods to migrate a project. In the Import dialog. but the project files and sources remain in their original location.wrmakefile template for the project. updated to work with the new version of Workbench. In the dialog that appears. remove it by right-clicking the project in the Project Explorer and selecting Delete. click File > Import. Project Explorer now displays the imported project. 2.4 Configuring and Building VxWorks 4. on the Select page.makefile templates (re)created so that they will work properly with the current build system. In the Workbench menu. On the Import Projects page.6 Importing and Migrating Existing VxWorks Image Projects To import a project exported by a team member. click Select archive file.x > Existing VxWorks 6.wpj file.wrmakefile template for the project. If you have not changed anything in the project’s . 4. Click Next. If the project is part of the current workspace. If you made changes to the Makefile. 3. you can migrate the project to Workbench using the same process. then click OK. navigate to the project’s *. select the project. 45 . 4. make sure Delete project contents on disk is not selected. complete the following steps: 1. if no changes were made to the . The method you choose depends on the following conditions: Whether or not the Makefile template was modified. you can directly migrate the project. Your project appears in the Project Explorer. then click Open. under Select an import source. click Browse to locate the file. do the following: 1.wrmakefile template. then click Next. 2. Migrating Projects with Modified Makefile Templates Use this task to manually migrate your project. Whether or not the project is a prebuilt VxWorks image. Whether or not the project was created using vxprj on the command line. then click Finish. If it was. Migrating Projects with Unmodified Makefile Templates Use this task to directly migrate your project. 3. Migrating Projects from One Version of VxWorks to Another To upgrade a VIP from a previous version of VxWorks. remove it by right-clicking the project in the Project Explorer and selecting Delete.makefile are created. then Finish. Select File > Import > VxWorks 6. then click OK.makefile. you must use the tcMigrate command-line migration utility. but you can find the information in the Workbench help. and then click Finish.wrmakefile and vxWorks. and run your multi-threaded applications on them.wpj file under its directory in installDir/vxworks-6.x Image Project into Workspace.makefile templates (re)created so that they will work properly with the current build system. Command-line utilities are not covered in this guide.x > Existing VxWorks 6. make sure Delete project contents on disk is not selected. Your project appears in the Project Explorer. as they would overwrite the old files. 2.Wind River Workbench By Example. In the dialog that appears. and then save the file. manually migrate the customizations from the renamed old file. Rename your customized . Open the new version of the . 7. 3. and then save the file. 2.x > Existing VxWorks 6. but the project files and sources remain in their original location. 5. Click Next. Select File > Import > VxWorks 6.wrmakefile and manually migrate the customizations from the renamed old file.3 To migrate a project with modified Makefile templates. Click Open. but you cannot build them. Click Browse. The project disappears from the Project Explorer. If the project is already part of the current workspace. VxWorks provides prebuilt projects so you can see the actual kernel configuration.wrmakefile and the vxWorks. and then click Next. To migrate a prebuilt VxWorks image. You can examine and modify the kernel configuration of these projects to learn how they work.makefile. 4. click Open.x/target/proj. Migrating Prebuilt VxWorks Images Use this task to experiment with one of the prebuilt SMP-enabled VIP projects provided with the UP version of VxWorks. NOTE: These SMP-enabled VIP projects are provided in the UP product for evaluation purposes only.wpj file in the project. 46 . 3. 6. navigate to the *. The migrated project appears in the Project Explorer. 3. This prevents against losing your customized changes when the new . do the following: 1. Only with this wizard are both the . All SMP-enabled projects have directory names that end in _smp. then navigate to the project’s *. If your modifications affected VxWorks image-specific instructions.x Image Project into Workspace. do the following: 1. updated to work with the new version of Workbench. open the new version of the vxWorks.wrmakefile and vxWorks. Through this link. and then base a VxWorks kernel image on the modified libraries. do the following: 1. 47 . 4. you can also change and rebuild the sources in their original location. as necessary. In the Help view Search field. Select > Help. This section shows you how to create a VSB project. Creating a VSB Project Use a VxWorks Source Build (VSB) project if you want to modify and recompile VxWorks source code libraries. Before You Begin a VSB Project Before you create a VxWorks Source Build (VSB) project. However. it is important that you understand your project requirements so you can calculate the changes that need to be made to the VxWorks libraries.7 Creating a VxWorks Source Build Project For information on how to use tcMigrate. Deciding these issues before you create your project will save you time in the development phases of your project.7 Creating a VxWorks Source Build Project You should use a VxWorks Source Build (VSB) project if you want to modify and recompile the VxWorks source code libraries. The changes that are made to the VxWorks libraries carry down to the VIP project upon which the VSB is based. Instructions on how to modify and recompile VxWorks source code libraries follow in “Configuring Custom VxWorks Libraries” on page 49. 2. it is possible to configure some VSB project settings after the project is created. if your deployed kernel image does not need to connect to Workbench tools. You should be able to answer the following questions before you begin creating a VSB project: Do you want to include support for networking. and then base a VxWorks kernel image on the modified libraries. enter tcMigrate and click Go. Do you have specific footprint or performance requirements? Do you know the board support package or CPU type used by your target hardware? Do you want to link to VxWorks sources? Creating a link to VxWorks sources from your project allows you to access the sources without adding them to your project. security. you can remove WDB components.4 Configuring and Building VxWorks 4. and other products shipped with your Platform? Do you want to make your kernel image smaller by removing some unneeded VxWorks components? For example. 9. The sources remain in their original location. you can also edit the VxWorks sources in their original location (outside of your project). This allows you to use the VSB project with multiple BSPs that are based on that processor and that support the specified configuration. Your new project appears in the Project Explorer. Click Finish to create your project. The link allows you to browseVxWorks source code. or if your project will be version-controlled and the sources are outside your workspace. 7. If necessary. Select the BSP or CPU type your project will be based on by choosing one of the following options: A board support package Select a BSP from the drop-down list that supports the target hardware of the VIP projects that will be based on this VSB. 3. leave this selected. To use a BSP provided by someone in your organization or a third party. 3. 4. This is good when you have write permission to the location of your sources (so you will not have to import them later). Switch to the Advanced Device Development perspective. select Window > Open Perspective > Advanced Device Development. do the following: 1. and are not copied into your project. Create project at external location If you want to create the project outside your workspace. Specify a location by selecting one of the following options: Create project in workspace If you want to create the project in the current workspace. and so on from your project. Click Next and accept the defaults or configure source code indexer settings. (Optional) To reference sources outside your project. A link is created to sources outside your project. Click Next. 6. select the Link in sources check box. Most projects work fine if you use the general indexer settings applied to all projects (which you can examine if you click Configure Workspace Settings). 8. 5. This is a good idea if you do not have write permission to the location of your source files. The Project screen of the wizard appears. 48 . Enter a name for your project.3 To create a VSB project. click Browse and navigate to its location. APIs. For more information about selecting settings and configuring the indexer. press the help key for your host. A CPU type Select the correct processor for your target hardware. select this then click Browse and navigate to a different location.Wind River Workbench By Example. Select File > New > VxWorks Source Build (Kernel Library) Project. or if you will create or import sources later. but if you need to customize your indexer settings. select Enable project specific settings and then adjust the indexer settings as appropriate. or if it is not open. 2. p. Also lists default values for this option.8 Configuring Custom VxWorks Libraries This section shows you how to configure the components that are included in the VxWorks libraries that you will use with your project. Option Tabs The following tabs are arranged below the Option pane: Help Provides information about the option. A round red N icon indicates that an option is not (or will no longer be) included in the image. Using the VxWorks Source Build Configuration Editor The Source Build Configuration editor is an easy-to-use tool for customizing libraries. 49 . Option Display Icons The icon associated with an option indicates the status and type for that option. The same icon with an I indicates an integer value. such as additional functionality made available to a future VIP by selecting this option. Two small circles overlaid on the icon indicates a mutually exclusive choice. Click the plus to view the options in that family. This process is similar to configuring a VxWorks kernel image. as well as the other options (if any) that depend on this option.4 Configuring and Building VxWorks 4. Configuring Custom VxWorks Libraries.49. A round blue S icon indicates a string value. A square white C icon indicates a comment on the parent item. and so on. and an H indicates a hexadecimal value. A round green Y icon indicates that an option is (or will be) included in the library. selected from a drop-down list in the n/m/y column.8 Configuring Custom VxWorks Libraries Where to Go Next To modify and recompile VxWorks source code libraries for your project. continue on to the next section. default values. 4. Dependencies Lists the options (if any) that this option depends on. The following rules apply: A multicolored cube indicates a family of options. except you make your selections using the Source Build Configuration editor (instead of Kernel Configuration editor). you should become familiar with the Source Build Configuration editor and its options. Before you begin configuring custom libraries. This example contains the following tasks: Task 1: Create a VSB project. 3. you create a VSB project based on the MIPSI32R2 CPU. create and configure a source build project. Task 4: Create a VIP based on the VSB project. 50 . Task 2: Configure the VSB project.Wind River Workbench By Example. before you can include them in your image. individual components and their parameters. To open the Source Build Configuration editor. Before You Begin This example assumes the following conditions: The resulting VxWorks kernel image will have a small footprint and good performance and debuggability. You have an understanding of both the Wind River compiler and your target hardware. To achieve this.9 Example: Customizing VxWorks Libraries as a Base For a VIP This example shows you how to identify your requirements. Task 3: Build the VSB project.3 Kconfig Displays a tree of bundles and. do the following: 1. NOTE: You must configure and build some products. You use this option because your memory controller is excellent at bursting in code and the footprint/performance trade-off is optimum for your system. The target uses the MIPSI32R2 CPU. Double-click your VSB. 4. Task 1: Create a VSB project. 2. see the Wind River VxWorks Platforms User’s Guide. such as Wind River Firewall and Wind River Network Stack. In this task. and then base a custom VxWorks kernel image on that project. you must accept not having System Viewer or RTP support. You use the -Xalign-functions=32 option to compile the VxWorks libraries. Double-click the Source Build Configuration node. For details. Task 5: Build the VIP project. at the leaf nodes of expanded bundles. and your new VSB_mipsI32R2 project appears in the Project Explorer. click the plus next to VxWorks Global Configuration Options for CPU MIPSI32R2 to expand it. Right-click optional compiler flags for MIPSI32R2_TOOL and select Change value. 51 . 3.4 Configuring and Building VxWorks 4. 3. then scroll to the right (if necessary) and from the drop-down list select n to deactivate System Viewer support. 4. enter VSB_mipsI32R2. or by closing the editor and selecting Yes when prompted to save. select y. 5. 8. then double-click the Source Build Configuration node to open it in the editor. Click Finish. do the following: 1. Task 2: Configure the VSB project. select A CPU type. In this task. In this case typing an S displays Enable System Viewer Instrumentation. select Window > Open Perspective > Advanced Device Development. or if it is not open. 2. right-click Set advanced options and select Change value. Because you know the specific CPU of your target system. This task disables support for selected functionality and compiler flags. you configure the VSB project you created in the previous task. 7. 6. you build the VSB project you created and configured in the previous tasks in this example. This accepts the default indexer settings. Type a letter or two of the option’s name into the Pattern field. 2. 5. and click Next. A blinking cursor appears in the Value column where you can type -Xalign-functions=32. then from the drop-down menu select MIPSI32R2. The Project screen of the wizard appears. At the top of the Option pane. Click Next. Task 3: Build the VSB project. but any changes you make will require that you recompile the project again. then select Find. In this task. In the Project name field. You can change the VSB’s build options or compiler flags in the future without needing to create a new project. using wildcard characters if necessary. Right-click it in the Option pane and select Change value. do the following: 1. 4. 6. 7. To configure a VSB project. From the drop-down list.9 Example: Customizing VxWorks Libraries as a Base For a VIP To create a VSB project. so right-click in the Option pane. You want to disable System Viewer support. Save your configuration by pressing CTRL+S. Leave Create project in workspace selected. Select it and click Find. To set advanced options such as compiler options. Select File > New > VxWorks Source Build (Kernel Library) Project. Switch to the Advanced Device Development perspective. deactivate Enable Real-Time Process (RTP). Double-click your project to expand it. In the same way. In the Address mode drop-down list. In this task. 3. If you want to use a VSB built by a team member. If the project builds successfully. Select Build Project. Click Finish. this can take awhile. Switch to the Advanced Device Development perspective. 7. do the following: 1. 3. Right-click the project in the Project Explorer.3 Creating a Custom VxWorks Image. To create a VIP based on a VSB project. you build the VIP project you created in the previous tasks in this example. If there are variants available for the BSP or tool chain. 4. Right-click the project in the Project Explorer. The settings in the BSP and Tool chain fields change to reflect the settings inherited from the VSB project you select. To configure the remaining VIP project screens. Leave Create project in workspace selected. On the Project Setup screen. select the address mode support you want to use.Wind River Workbench By Example. Your new VIP_VSB_mipsI32R2 project appears in the Project Explorer. Task 5: Build the VIP project. p. then click Next. type VIP_VSB_mipsI32R2. click Browse and navigate to it. it would not appear in the Project list because it was not built in the same workspace. do the following: 1. Select Build Project. In this task. it appears as an option in the VIP’s Project drop-down list. Select File > New > VxWorks Image Project. click the Based on drop-down list and select a source build project. 52 . 6.32. Workbench uses your custom VxWorks libraries in place of the default libraries. or if it is not open.3 To build your VSB project. do the following: 1. select Window > Open Perspective > Advanced Device Development. you may choose one of them from the drop-down list. Build Finished in Project ‘VSB_mipsI32R2’ appears in the Build Console. Since you are recompiling the VxWorks libraries. Task 4: Create a VIP based on the VSB project. The Project screen of the wizard appears. 2. 8. 2. Select VSB_mipsI32R2 from the Project drop-down list. When you have successfully built a source build project. To use it. 2. To build a VIP project. 5. In the Project name field. see 4. you create a VIP that is based on the VSB project you created in the previous tasks in this example. Right-click your VSB project in the Project Explorer. you change the BSP or CPU that your VSB is based on. click Change and make a selection from the dialog. Build Finished in Project ‘VIP_VSB_mipsI32R2’ appears in the Build Console.10 Rebasing VSB and VIP Projects You can change the configuration of an existing VSB project without having to recreate the project. It also displays the BSP or BSPs supported by that configuration. NOTE: Basing your VSB project on a new CPU or BSP may invalidate any VIPs that are based on it. select Properties. To base your project on a different CPU or BSP. If you originally based your project on a CPU. then select Source Build Info. so selecting one clears the entry in the other field. However. To base a VSB on a different BSP or CPU. 3. 2. and hen double-clicking the Kernel Configuration node. p. as long as their CPU or BSP types match. you validate VIPs that are based on a VSB that has changed. 53 . continue to Basing a VIP on a Different VSB Project. the Base configuration section displays the CPU or BSP that you based your project on. do the following: 1. as long as their configuration settings match. This can be useful when requirements change for a project.53. you cannot have entries in both fields.10 Rebasing VSB and VIP Projects If the project builds successfully. This means you have a VxWorks kernel image that is optimized to your requirements. 3. Verify the build by double-clicking the project to expand it. All of the options you disabled in the VSB should be disabled or unavailable in your VIP. 4.4 Configuring and Building VxWorks 4. In addition to the project name. To validate VIPs after changing a VSB. Basing a VIP on a Different VSB Project You can retarget an existing VIP to use a new VSB. This procedure is useful when requirements change for a project. Click OK. you can change to a BSP (and the opposite is also true). In this task. You can also base a VIP on a different VSB project. This section covers the following tasks: Basing a VSB Project on a Different BSP or CPU Basing a VIP on a Different VSB Project Basing a VSB Project on a Different BSP or CPU In this task. then select VxWorks Info. if you are trying to base a VIP that requires SMP to a VSB that was built without SMP). select the file. and TFTP file download protocols) to keep the kernel image size small. you create a VxWorks Boot Loader/BSP project. If you have NVRAM space problems. However. a VxWorks Boot Loader/BSP project will generate a smaller image so it can fit into flash memory. 5. When you have successfully retargeted your VIP to a new VSB project. where you can store both the boot loader and operating system image on a disk. Right-click the VIP. 2. A boot loader is useful during development. If the CPU.3 To base a VIP on a different VSB project. you must rebuild the VIP and its DKM subprojects. and the RSH. 3. if you need to repeatedly modify and rebuild your VxWorks image.11 Loading the VxWorks Image onto the Target Once you have a VxWorks kernel image stored on your host machine. though they are not required for standalone VxWorks systems stored in ROM. 54 . click Change.Wind River Workbench By Example. and click OK. Navigate to the directory that contains the new VSB project’s vsb. if the configuration settings do not match (for example. FTP. 3. The Select Source Build Configuration dialog opens. Creating a Default Boot Loader This section covers the following methods for creating a bootloader for your kernel image: Creating a VxWorks Boot Loader/BSP Project Creating a VxWorks Image Project Using the PROFILE_BOOTAPP Configuration Profile The VxWorks Boot Loader/BSP project type uses a special build of a basic network stack (that includes support for the IPv4 protocol. For more information about boot loaders. do the following: 1. an error appears telling you what the problem is. the VIP will be retargeted to the new VSB project. Boot loaders can also useful on production systems. and other configuration settings match. you can use a boot loader to load it onto a hardware target. select Properties. In the bottom right corner of the VxWorks Info screen. To the right of Kernel libraries. Creating a VxWorks Boot Loader/BSP Project In this task. 4. BSP. see the VxWorks Kernel Programmer’s Guide: Boot Loader and the VxWorks BSP References entry for your BSP.config file. 4. click Validate. or if it is not open. This is good when you have write permission to the location of your sources (so you will not have to import them later). Creating a VxWorks Image Project Using the PROFILE_BOOTAPP Configuration Profile Creating a VxWorks image project with the PROFILE_BOOTAPP configuration profile uses a build of the network stack that provides a larger set of networking facilities. p.4 Configuring and Building VxWorks 4. Click Finish. select Window > Open Perspective > Advanced Device Development. For format. Specify where to create your project by selecting one of the following options. and (ROM-)Resident At High Address. 2. such as IPv6 and DHCP support. see 4. select this then click Browse and navigate to a different location. Choose the BSP that you want to base your project on. 5.32. or if you will create or import sources later. 3. or Hex. choose from ELF. or if your project will be version-controlled and the sources are outside your workspace. Select File > New > VxWorks Boot Loader/BSP Project. Create project at external location If you want to create the project outside your workspace. then click Next: Create project in workspace If you want to create the project in the current workspace.11 Loading the VxWorks Image onto the Target Boot loader images come in the following styles: Compressed. These are functionally the same but have different memory requirements and execution times. Creating a Customized Boot Loader You can customize various features of the boot loader in the following ways: 55 . you can change the Style by right-clicking the project and selecting Set Active Build Spec. Switch to the Advanced Device Development perspective. do the following: 1. To create a VIP with the PROFILE_BOOTAPP profile. 7. To create a VxWorks Boot Loader/BSP project. Select The Style and Format of the Boot loader/BSP image. leave this selected. In the new project wizard. BSP documentation specifies which types are available for a specific target. 8. Workbench displays all your installed BSPs in the drop-down list. This is a good idea if you do not have write permission to the location of your source files. type a name for your project. Select the tool chain you want to use. Uncompressed. After the project has been created. 4. (ROM-)Resident. 6. Bin. The VxWorks Kernel Programmer’s Guide: Boot Loader chapter provides detailed information on Style and Format.3 Creating a Custom VxWorks Image. The available options match the BSP you selected. The new project appears in the Project Explorer. For information about boot parameters. as described in 4. Select Build Options > Set Active Build Spec > build_spec. In this task. p. or . For more information.3 Adding or removing VxWorks components. you can exclude networking components if you are not going to use the network to boot your system. see Selecting Boot Loader Drivers. 56 . 2.4 Configuring VxWorks.Wind River Workbench By Example.[type] [format] type can be empty (the default RAM-based image). For example. To switch build specs. you navigate to the config. p. To create new build targets with user-defined make rules. see the VxWorks Kernel Programmer’s Guide: VxWorks Configuration. For example. the build spec default_rom must be used with the build target vxWorks_rom to build a vxWorks_rom image. or for deployed systems. Right-click the project in the Project Explorer. Boot Loader Build Targets In a VIP project (except one configured to run on the VxWorks simulator) you can use a build spec to specify one of three types of VxWorks images. Setting boot parameters that are appropriate for your development environment. such as vxWorks_rom. the location of the VxWorks image to boot. FTP user names and passwords. and so on. Boot parameters specify the IP addresses of the host and target systems. Navigate to the installDir/vxworks-6. Choose New > Build Target. Selecting non-default drivers.hex (Motorola S-Record output). do the following: 1. _rom.bin (binary output). Modify the configuration as necessary. . A VxWorks image s specified by its type and format: vxWorks. Right-click the project in the Project Explorer. you need to change the driver selection for the boot loader. NOTE: The build spec and build target must match for any given image type. The build spec format can be empty (the default ELF image). To change the default configuration of a boot loader. 2. If the boot loader’s default drivers are not appropriate for your target.58.37. 3. _romCompress.x/target/config/bsp/config. see VxWorks Kernel Programmer’s Guide: Boot Loader. Enter an appropriate Build target name. 2. or _romResident. Click the config.h file and change the default configuration of a boot loader.h file in the Project Explorer. 3. 3. do the following: 1. do the following: 1. For more information about VxWorks images.h file to open it in an editor. If they are not already there. and so on) is RAM_LOW_ADRS.x/target/config/bsp/config. In the Project Explorer.cdf. 5. If link address definitions are not made in the correct file. comment out those definitions.cdf. it uses RAM_LOW_ADRS as the link address even if you are creating a boot loader image with the PROFILE_BOOTAPP configuration profile. and the boot process will fail. That is. you must change the link address used for the project to specify the correct address for a boot loader. To change the link address for a target. This file is usually 20bsp.h. uses RAM_LOW_ADRS as the link address regardless of the type of image you are creating. The link address for a VxWorks image of any type (vxWorks.h override definitions in CDF files. Therefore you must substitute the BSP’s value for RAM_LOW_ADRS with the BSP’s value for RAM_HIGH_ADRS when you create a boot loader based on PROFILE_BOOTAPP. The following example of CDF parameter definitions uses conditional statements to set the link addresses: Parameter RAM_HIGH_ADRS { NAME Bootrom Copy region DEFAULT (INCLUDE_BOOT_RAM_IMAGE)::(0x01E00000) \ (INCLUDE_BOOT_APP)::(0x02000000) \ (0x01C00000) } Parameter RAM_LOW_ADRS { NAME Runtime kernel load address DEFAULT (INCLUDE_BOOT_RAM_IMAGE)::(0x01C00000) \ (INCLUDE_BOOT_APP)::(0x01E00000) \ (0x00100000) } 57 . but for some may be 10bsp. Be careful. Set RAM_HIGH_ADRS to (RAM_LOW_ADRS + maxBootAppImageSize).h if they were not provided in a CDF file. add the link address parameters to the BSP’s CDF file. however. Set RAM_LOW_ADRS to the config. and the link address for a boot loader image of any type is RAM_HIGH_ADRS. 2.h file to open it in an editor. Redefining the Link Address for a PROFILE_BOOTAPP Project When you create a standard VIP using the PROFILE_BOOTAPP configuration profile. A VIP. click the config.11 Loading the VxWorks Image onto the Target 4. select (User-defined) and click Finish. 4. From the Build tool pull-down menu. it will not load to the correct place in RAM. using the values from config. You must do so because definitions in config. do the following: 1.h value of RAM_HIGH_ADRS.4 Configuring and Building VxWorks 4. the boot loader will not be configured properly. If the RAM_LOW_ADRS and RAM_HIGH_ADRS link addresses are defined as macros in installDir/vxworks-6. 3. vxWorks_rom. The following task shows you how to do this. h). Any changes made to config. see installDir/target/src/hwif/util/cmdLineBuild.c.h to define the macro for the correct driver. 58 . For more information about boot loaders. 3. see the VxWorks BSP References entry for the BSP.Wind River Workbench By Example. see the VxWorks Kernel Programmer’s Guide: Boot Loader and the VxWorks BSP References entry for your BSP. whereas the names for non-VxBus drivers do (for example. DRV_SIO_NS16550). and undefine the macro for the one you do not need. For information about non-VxBus drivers supported for a given BSP. NOTE: Changes to config. For More Information For information about the VxBus drivers available for your system (and the macro names to use in config.h must be made before you create a VxWorks Image project. see VxWorks Kernel Programmer’s Guide: Kernel Customization. INCLUDE_ELT_3C509_END).3 For more information about working with CDF files.h after a VIP is created are not picked up by the project.x/target/config/bsp/config. you must edit installDir/vxworks-6. The macro names for VxBus drivers do not have the leading INCLUDE_ element (for example. Selecting Boot Loader Drivers If a boot loader requires a (supported) driver that is not provided as the default. 2 Creating an Experimental Default BSP The easiest way to begin working on your own BSP is to create a project and copy the BSP sources. and then modify and build it to meet your project needs. you learn how to do the following: Create a project and pull in the sources for a selected BSP.5 Working with Board Support Packages 5. and so on. For more information about those topics. 59 . Customize a BSP for use as the basis for a VIP. then customize them without changing the VxWorks install tree.1 Introduction 59 5.1 Introduction A Board Support Package (BSP) consists primarily of the hardware-specific VxWorks code for a particular target board. NOTE: This chapter does not. In this task. 5. discuss what information should be included in a BSP or how to write a BSP from scratch. You can start with any default BSP. see the VxWorks BSP Developer’s Guide. mapping of local and bus memory space. Workbench displays a list of BSPs that were shipped with your VxWorks Platform product.2 Creating an Experimental Default BSP 59 5. A BSP includes facilities for hardware initialization. In this chapter. hardware clock and timer management. you create a default BSP.3 Example: Customizing a BSP 61 5. Workbench provides a VxWorks Boot Loader/BSP project that makes it easy to copy the sources for one of the existing BSPs into your project. interrupt handling and generation. This is a good idea if you do not have write permission to the location of your source files. on the Project Setup page. You may also benefit from this method if your target hardware is not yet ready. This is good when you have write permission to the location of your sources (so you will not have to import them later). or if your project will be version-controlled and the sources are outside your workspace. or if it is not open. The new project appears in the Project Explorer. Click Finish. Using a Wind River BSP If your BSP was installed with Workbench 3. 3. select a BSP for your project from the Board support package drop-down list.3. do the following: 1. select Window > Open Perspective > Advanced Device Development.3 To create a default BSP. NOTE: You cannot use the VxWorks simulator BSP in a VxWorks Boot Loader/BSP project to create a boot loader. Using the Simulator BSP You can base your VxWorks Image project on the VxWorks simulator BSP to develop a custom BSP and application code for your product in parallel. Select Copy files to project to create a standalone copy of the BSP directory. 3. This allows you to modify the sources without changing the originals in your VxWorks installation tree. For more information. see 4. Select the tool chain you want to use. Choose the BSP that you want to work with. In the New VxWorks Boot Loader/BSP Project wizard. and then type a name for your project. or if you will create or import sources later. Select File > New > VxWorks Boot Loader/BSP Project. 7. Workbench displays all your installed BSPs in the drop-down list. Create project at external location To create the project outside your workspace. 6. leave this selected.4 Configuring VxWorks. select this then click Browse and navigate to a different location. you can create a VxWorks Image project from it directly.37. 2. Specify where you want to create your project by selecting one of the following options. 4. The simulator BSP contains default VxWorks functionality sufficient for supporting most applications. 60 .Wind River Workbench By Example. Switch to the Advanced Device Development perspective. 5. The available options change to match the BSP you selected. and then click Next: Create project in workspace To create the project in the current workspace. p. If you have a custom.97.3 Example: Customizing a BSP Once you create a default BSP. In turn. p. you may want to begin application development on the VxWorks Simulator. verify that it builds properly before creating a project for it. This example shows you how to customize a BSP using the following methods: Creating a Custom BSP Basing a VxWorks Image Project on a Customized BSP 61 . non-compliant BSP to meet these specifications.59. 5.3 Creating a VxWorks Simulator Connection. Workbench will not be able to provide project-based support for customizing. see 7. Once you have modified your custom. you can customize its sources. For more information.x compliant. p. To develop the BSP and the application code in parallel. see the VxWorks Migration Guide for information on migrating to Workbench. see the VxWorks Command-Line Tools User’s Guide. you can base a VIP on your customized BSP. You can create downloadable projects to hold your application code and download them to a target booted with a non-compliant BSP. Using a Pre-Existing BSP with the Workbench Project Facility If you have a custom BSP that is Tornado 2. you need to modify it to conform to the guidelines outlined in the VxWorks BSP Developer’s Guide to be able to use it with the Workbench project facility. NOTE: If you do not modify your BSP to make it Workbench compliant. or building it. Using a BSP Outside of Workbench You may use a non-compliant BSP by managing its configuration manually. configuring. For information on using manual methods. see the VxWorks BSP Developer’s Guide and 5. non-compliant BSP.3 Example: Customizing a BSP Using a Custom BSP for Custom Hardware This section covers the following topics: Creating a BSP Using a Pre-Existing BSP with the Workbench Project Facility Using a BSP Outside of Workbench Creating a BSP To create your own BSP.2 Creating an Experimental Default BSP.5 Working with Board Support Packages 5. 2. In this task. type ROM_SIZE.h file. Increase the value of ROM_SIZE. double-click the BSP project to expand it. do the following: 1. for example from 0x00200000 to 0x00300000 (or as appropriate for your needs). Task 1: Check that config. create a new VxWorks image project based on your modified BSP. 62 .h file in an editor and customize values.h is not read-only. 3.59. Close config. Task 2: Modify a value in config. Task 3: Build your project. Task 2: Modify a value in config.3 Creating a Custom BSP In this example. Click OK.h file to successfully complete this example. Search for the definition of ROM_SIZE by pressing CTRL+F to open the Find/Replace dialog. In the Find text field. To integrate the changes into your project.h file is writable.h and click Yes when you are prompted to save the changes.h. 2. Before You Begin Before you begin this example. To verify that the config. then double-click the BSP directory to view its contents. do the following: 1. Double-click config. and view the kernel configuration to verify that the change was reflected in the VIP.h and select Properties. In the Project Explorer. select it to clear the check mark. You must have write permissions for the config.h to open it for editing. you must perform a build. as described in Creating an Experimental Default BSP. If the box is checked.Wind River Workbench By Example. 5. you verify that the conifg. Right-click config.h file is not read-only. To modify a value in the config. You can open the config. Task 3: Build your project. This example includes the following tasks: Task 1: Check that config. 4. 4.h. then click Find. p. you must have successfully created a default VxWorks Boot Loader/BSP project containing BSP sources. 3.h is not read-only. In the Properties dialog make sure the Read only check box is not selected.h. you modify an existing project to increase the size of ROM space assigned in config. some BSPs in the Platform are shipped read-only. 3. Task 3: Verify that the modified ROM_SIZE appears in the VxWorks image. From the Project drop-down list.32. To start a new VxWorks Image project. For this example. This task shows you how to base your new VIP on a custom BSP project. unless you are working with a simulated target. you should have successfully completed the tasks outlined in Creating a Custom BSP. Click Finish. specifying a name and location for the new project. do the following. and then type a name for your project.62. From the Based on drop-down list.3 Creating a Custom VxWorks Image. do the following: 1. Select File > New > VxWorks Image Project. To base a new VIP on an existing BSP. Before You Begin Before starting this procedure.3 Example: Customizing a BSP To build the BSP project. Click Next. p. select the custom BSP project you developed in Creating a Custom BSP. see 4. p. Task 2: Base a new VIP on an existing BSP project. To enable the WDB Target Agent. select An existing project. right-click the project and select Build Project. Task 1: Start a new VxWorks Image project. 4.5 Working with Board Support Packages 5. This list contains suitable projects in your workspace. 3. 1.62. The new project appears in the Project Explorer. Switch to the Advanced Device Development perspective. 2. select Window > Open Perspective > Advanced Device Development. NOTE: The WDB Target Agent is disabled by default. p. 63 . If you wanted to base your VIP on a project outside the workspace. you could do that by clicking Browse and navigating to it. leave Create project in workspace selected. or if it is not open. do the following: In the Project Explorer. 3. Basing a VxWorks Image Project on a Customized BSP Once you have customized a BSP project. This example includes the following tasks: Task 1: Start a new VxWorks Image project. you can use it as the basis for a VxWorks Image project. 2. Task 2: Base a new VIP on an existing BSP project. This task shows you how to start a new VxWorks Image project (VIP). then select Find. do the following: 1. 3. In the value column. 6. or as appropriate for the change you made). you verify the customizations you made to the BSP project were carried over to the new VxWorks image. see the VxWorks BSP Validation Test Suite User’s Guide.3 Task 3: Verify that the modified ROM_SIZE appears in the VxWorks image. 5. Double-click the Kernel Configuration node to open the Kernel Configuration Editor. start typing ROM_SIZE. you should see the modified value (0x00300000 instead of 0x00200000. Where to Go Next For additional information about working with BSPs. Double-click it in the list to find it in the Component Configuration pane. the list of matches will have narrowed so you can see ROM_SIZE. see the VxWorks BSP Developer’s Guide. 2. In this task. right-click in the Component Configuration pane. 64 . To look for ROM_SIZE. including how to configure and run it to validate that your BSP is working properly. To verify BSP project customizations in the VxWorks image. For information about the BSP validation test suite. In the Pattern field. 3. Close the editor when you are finished. 4.Wind River Workbench By Example. By the time you have typed ROM. ..PA R T I V Developing and Debugging Applications 6 7 8 Building Applications and Libraries ..................... 67 Connecting to VxWorks Targets ............ 109 65 ................................................................ 95 Running and Debugging VxWorks Applications ..... Wind River Workbench By Example. 3.3 66 . This chapter does not.12 Example: Working with RTPs. Shared Libraries.9 Creating Statically Linked Libraries 82 6.6 Building Applications and Libraries 6.2 Deciding on an Application Type 68 6. as well as the static or shared libraries or plug-ins that you can develop to support them.8 Using RTP Overlapped Virtual Memory 82 6. cover how to write code for applications or libraries.10 Creating Shared Libraries 83 6. see the VxWorks Kernel Programmer’s Guide and the VxWorks Application Programmer’s Guide. whether you are creating applications that will run in kernel space or user space. and Plug-Ins 85 6.13 Running Applications on a Hardware Target 93 6.1 Introduction The workflow for creating applications in Workbench is relatively consistent. 67 . It also introduces the preconfigured VxWorks-specific projects that can help you organize your code. This chapter describes how to use Workbench to manage and build your applications.7 Example: Adding IPNet Support to a DKM 81 6.6 Reconfiguring Your Project Later in the Development Cycle 75 6.5 Example: Creating and Passing a Build Target 72 6. nor does it discuss the pros and cons of running your application in kernel space as compared with user space. For more information about those topics.4 Example: Discussion of PowerPC Build Spec Variants 71 6.3 Creating a Project For Your Application 69 6.1 Introduction 67 6.11 Creating Plug-Ins 84 6. ! CAUTION: Code built for variants of VxWorks or for different releases of VxWorks is not binary compatible between variants or releases. p. 4. 32-bit VxWorks. with full access to the hardware in the system. Build and debug your projects. VxWorks can be configured to start kernel applications automatically at boot time. 3. you will want a kernel module that is statically linked to the operating system. 2. 3. 5. see the Wind River Workbench User’s Guide. you will want a kernel module that can be downloaded and dynamically linked to the operating system. 6.113. Process Overview Creating applications in Workbench follows this basic process: 1. 68 . parameter hinting. Code must be built specifically for uniprocessor (UP) VxWorks.3 For details about the editor. as described in 8. 6.4 Running Your Applications. This allows you to build. Writing Kernel Applications Kernel applications run in kernel mode. or for a VxWorks system based on variant libraries produced with a VxWorks source build (VSB) project—or for any supported combination of these variants. run.2 Deciding on an Application Type There are two basic application types you can develop in Workbench: kernel applications and real-time process applications. as discussed in the following sections. code assist and colorization. VxWorks SMP. 64-bit VxWorks. Write or import source files. If you are writing an application that runs in kernel space. Each type has specific considerations. The only exception to this rule is that RTP application executables can be run on both UP VxWorks and VxWorks SMP (when all else is the same).3 Adding Kernel Applications to a VxWorks Image. As necessary. p. or open a Workbench feature and press the help key for your host. see 9. and debug applications without having to make any changes to the operating system itself.125.Wind River Workbench By Example. For deployed systems. a lot depends on the stage of the development you are in. From the Wind River Workbench Project wizard. In the early stage of development. and other Workbench features that make coding easier. Decide on a deployment method. Decide what type of application you need. select the build type that will provide the necessary structure and build support for your project. For details. write or import libraries to support your application. making it part of the VxWorks image itself. and all tasks in the process run within the same memory-protected address space. For deployed systems. In either case. 69 . then run and debug them on a target running VxWorks—loading. When the application terminates. user-mode environment for developing applications.4 Running Your Applications. 6. they provide a protected. Writing Real-Time Process Applications Real-time process (RTP) applications are developed as VxWorks executables that will execute in user space and will have a well-defined start address. you can also use them to create library subprojects that are statically linked into other projects at build time.6 Building Applications and Libraries 6. see 9. When the executable is loaded. all the resources associated with it are freed back to the system. For example. a lot depends on the stage of the development you are in.113. p. DKM projects help you manage and build modules that execute in the kernel space.3 Creating a Project For Your Application In either case. In this task. You can build each module separately. For details. the system allocates memory address space for it. process-based. See 8. press the help key for your host or click the Help question mark icon (?) in the lower left corner of the wizard. you will create a VxWorks Real-Time Process project for your application. such as in different VIPs. p. In the early stage of development. and reloading on the fly. In addition to using RTP projects to create real-time process applications. unloading. Also known as RTP projects. you will want to store RTP applications on the host system and run them interactively. execution begins at the known start address. For more information about any of the screens. You also use DKM projects to create library subprojects that are statically linked into other projects at build time. using the same code in multiple downloadable or relinkable images. If you are writing an application that runs in user space.128.4 Example: Bundling RTPs and Libraries with a VxWorks Image. you create a project that will be the basis for an application.3 Creating a Project For Your Application The process for creating Downloadable Kernel Module (DKM) and Real-time Process (RTP) projects is essentially the same. you will want to store the RTP applications in a target file system such as ROMFS. you will create a VxWorks Downloadable Kernel Module (DKM) project for your application. What Are All These Project Files For? Adding Application Code to a Project After you create your project. 64-bit. then navigate to your source location. For information about the new files in your project. or a system based on variant libraries produced with a VxWorks source build (VSB) project.x from the drop-down menu. 4. whether uniprocessor (UP). select the type of project you want from the drop-down list. The project appears in the Project Explorer. Click Browse. On the Project screen. This is good when you have write permission to the location of your sources (so you will not have to import them later).3 ! CAUTION: VxWorks kernel applications must be built specifically for the type of system on which they will run. 32-bit. This is a good idea if you do not have write permission to the location of your source files. Create project at external location If you want to create the project outside your workspace. They are otherwise binary incompatible.Wind River Workbench By Example. Click Next. symmetric multiprocessor (SMP). or copy sources into your workspace. leave this selected. The kernel object-module loader rejects a module if it is not compatible with the VxWorks system and prints an error message. Click Finish. The New Wind River Workbench Project wizard appears. 3. Select Wind River Workbench Project from the Workbench toolbar. but often no actual application code. See the VxWorks Kernel Programmer’s Guide for more details. or if it is not open. select Window > Open Perspective > Advanced Device Development. You can add application code to a project in the following ways: Import resources Add new files 70 . it could be created in a shared directory). On the Build Type screen. see A. 6. or if you will be sharing the project with your team and several developers need access to it (in that case. select this option to keep each in its place. and click Next. Each build type displays a description to help you choose the one that is right for your task. or if your project will be version-controlled and the sources are outside your workspace. select this then click Browse and navigate to a different location. Select Wind River VxWorks 6. Create project in workspace with content at external location If you do not want to mix project files with your sources. 3. do the following: 1. To create a project for your application. Switch to the Advanced Device Development perspective. you have the infrastructure for a kernel module or a real-time process. and type a name for your project and specify the location by selecting one of the following options: Create project in workspace If you want to create the project in the current workspace. 5. or if you will create or import sources later. 2. open the Import dialog and press the Help key for your host.4 Example: Discussion of PowerPC Build Spec Variants Consider the following before choosing a build spec for a kernel module project: PowerPC. see VxWorks Application Programmer’s Guide: RTP Applications. 3. VxWorks kernel source (everything under installDir/vxworks-6. 2. Select the project and then select File > New > File. Writing Source Code Writing source code is beyond the scope of this guide. Adding a New File In this task. then select New File Wizard. 6. For more information about writing source code for kernel applications. press the help key for your host. Enter or select the parent folder. click Finish.4 Example: Discussion of PowerPC Build Spec Variants Write source code Importing Resources In this task. To add a new file to a project. see VxWorks Kernel Programmer’s Guide: Kernel Applications. Select File > Import. and supply a File name. do the following: 1. Other PowerPC build spec variants are used when building VxWorks Boot Loader/BSP and VxWorks Image projects. you import existing resources into your project. do the following: 1. see the following resources: For more information about writing real-time processes. (Optional) For a description of the available Advanced options. by copying the resource files into your project. To import a resource.x/target/src) is always built with CPU=PPC32 and TOOL=diab. Pay particular attention to the Linked resources link under Related concepts. you add a new file to an application project to create source files.6 Building Applications and Libraries 6. For details on the available options. 71 . depending on the floating point model being used. 3. or e500v2diab. Select an import source and specify related options. The file name must be unique.x/target/config. for example that RTP applications require a main( ) function. 2. sfdiab. When you have completed your selections. For more information. from code found under installDir/vxworks-6. The VIPsim project appears in the Project Explorer. 72 . NOTE: The WDB Target Agent is disabled by default.3 Creating a Custom VxWorks Image. Task 4: Create a new source file in hello_VxWorks. Leave Create project in workspace selected. To enable the WDB Target Agent. unless you are working with a simulated target. select Window > Open Perspective > Advanced Device Development. Switch to the Advanced Device Development perspective. 4. type VIPsim. 3. Task 5: Add the source file to your build target.32. Task 6: Add the DKM project as a subproject of the VIP project. do the following: 1. or if it is not open. then click Next. Select File > New > VxWorks Image Project. In particular.3 For more information about PowerPC and other supported architectures. 6. 2. 3. This example includes the following tasks: Task 1: Create a VIP. Task 1: Create a VIP. for a table of CPU/Tool values and a discussion of special considerations for PowerPC processors.5 Example: Creating and Passing a Build Target This example shows you how to create a kernel module project that passes its build output to a VxWorks image project. Task 10: Test whether the Hello-Sort build target was passed to VIPsim. In the Project name field. see 4.Wind River Workbench By Example. Task 3: Create a second DKM project from which to import a source file. Task 9: Create a custom VxWorks simulator target connection. In this task you create the VIPsim project. Task 2: Create a DKM project. then click Finish. p. 5. To create a VIP project. Leave the VxWorks simulator BSP and default toolchain selected. see the VxWorks Architecture Supplement available in the Workbench help system. Task 7: Build the VIPsim project. see the Defining the CPU and TOOL Make Variables section in Appendix A. Task 8: Find the location of the kernel image file. Building Applications. then click Next until you get to the Build Target screen. you create a second DKM project that will contain the source file you then import into another project. highlight DKM_pass_tgt (the default name) then type Hello-Sort. type hello_VxWorks. you create a DKM project using specific options. you create a file that you will later import into another project. In the Project name field. This is important when the DKM is a subproject of a VIP. then click Finish. In the New File dialog. right-click anywhere. In the Project Explorer. The hello_VxWorks project appears in the Project Explorer. select File > New > VxWorks Downloadable Kernel Module Project. select Wind River C source template from the drop-down list. do the following: 1. To create a second DKM project to hold a source file. Task 3: Create a second DKM project from which to import a source file. the Binary output name is also changed. Add the following code below the comment lines: #include <stdio. 3. In the Project name field. but is not necessary when the DKM is a subproject of any other type of project.c. Leave Create project in workspace selected. Click Finish. In the Use template drop-down list. Task 4: Create a new source file in hello_VxWorks. The hello. select File > New > VxWorks Downloadable Kernel Module Project. In this task.c file opens in the editor. 6. then click Finish. The DKM_pass_tgt project appears in the Project Explorer. then click File > New > File from Template. type DKM_pass_tgt. Change the Build tool from Linker to Partial Image Linker. As you type. 4. 2.c in the hello_VxWorks DKM project. In the Build target name field. To create a DKM project. From the Advanced Device Development perspective. then in the File name field type hello.6 Building Applications and Libraries 6. Select Pass build target to next level. 4. From the Advanced Device Development perspective. 7. select the hello_VxWorks parent folder. In this task. 5.5 Example: Creating and Passing a Build Target Task 2: Create a DKM project. To create a new source file in a project. You create the file hello. do the following: 1.h> int dmain(void) { 73 . 2. 3. do the following: 1. 2. In this task. but if you expand VIPsim you will see it there. Select hello. do the following: 1. This ensures that DKM_pass_tgt is built when VIPsim is built. To see hello_VxWorks. Right-click Hello-Sort. 2. 3. 6. click Show all projects. you find the location of the newly built kernel image file. To add a DKM project as a subproject. Click Finish. If Hello-Sort is not already visible. Task 8: Find the location of the kernel image file. DMK_pass_tgt seems to disappear from the project list. you add a project reference to make the DKM a subproject of the VIP. 3. In this task. Press CTRL+S to save the file. Double-click the path shown as Location. The file appears under Hello-Sort in the DKM_pass_tgt project. } 5.3 printf("Hello World!\n"). In this task. With the project reference in place. Right-click DKM_pass_tgt and select Project References > Add as Project Reference. Task 6: Add the DKM project as a subproject of the VIP project. By default. To add a source file to your build target. building VIPsim now automatically builds the Hello-Sort build target and passes the output up to VIPsim. do the following: Right-click the VIPsim project and select Build Project. just the project you are working with appears in the Workspace pane.c. Under vxWorks (default). To build a VIP project. then right-click it and select Copy. Click the plus next to hello_VxWorks to open it (you cannot double-click it in this case. return 0. 5. Task 5: Add the source file to your build target. so it is built with the DKM_pass_tgt project. 2.Wind River Workbench By Example. double-click DKM_pass_tgt and then double-click Build Targets. then click OK. right-click vxWorks and select Properties. you import the source file you just created into the Hello-Sort build target. 2. 4. To find the kernel image file. then select Edit Content. do the following: 1. you build the VIP project. The file appears in the Content pane. In this task. Task 7: Build the VIPsim project. Select VIPsim from the list of possible superprojects. since that adds the entire project to your build target). The Content Definition dialog opens. do the following: 1. In this task. 74 . then click Add. To verify that a build target successfully passed to a project. you should see Hello World! in the VxWorks simulator window. To create a VxWorks simulator connection. In this task. as described in Adding Kernel Applications to a VxWorks Image. Configure and build the VIP.x Simulator Connection. then click Next. For example.6 Building Applications and Libraries 6. running the vxWorks kernel image file from VIPsim. then right-click in the text field and select Paste to paste in the location of the vxWorks kernel image file. as described in Configuring and Building VxWorks. A new VxWorks simulator window opens. In this task. 2. Click OK to close the dialog. do the following: 1. In the Remote Systems view. 6. Task 9: Create a custom VxWorks simulator target connection. p. Task 10: Test whether the Hello-Sort build target was passed to VIPsim. you create a VxWorks simulator connection using the vxWorks kernel image file you just created. You do not need to adjust any other settings for this example. 2. Select Wind River VxWorks 6. Linking a Kernel Module to a VxWorks Image In this task.6 Reconfiguring Your Project Later in the Development Cycle 3. p. 75 . do the following: 1. To link a kernel module to a VxWorks image. click Define a connection on the left of the toolbar. you verify that the Hello-Sort build target successfully passed to the VIPsim project. Select Custom simulator. so click Finish. you might want to change the build tool or build specs so you can build the application for another target architecture.31. as the needs of your application change during the course of the development cycle.6 Reconfiguring Your Project Later in the Development Cycle You can adjust the configuration options.125. If the build output from the subproject was correctly passed to its superproject. do the following: 1. 2. 3. Type dmain at the VxWorks simulator prompt. Create a VxWorks Image project. you link a kernel module with a kernel and turn it into a bootable application that starts when the target is booted. filtered according to project type. Task 6: Specify libraries. press the help key for your host. so it is enabled by default. To access build properties for your project. In this task. It is the one that is saved in the project file. Task 5: Specify build paths. The build specs pane lists all the build specs that are available to Workbench. Task 3: Select build tools. To specify build support and specs options. meaning that if you share your project with your team. Build Macros. do the following: 1. The default build spec is also used to set the initial active build spec for the project. and specify options as needed. 2. select Build Properties. 3. Task 2: Select build support and build spec options. Both kernel module and process projects automatically use Workbench build support. and they import it into their workspace. Task 1: Access build properties. you set options to configure the build command and build specs for your project. Right-click the project in the Project Explorer and select Properties. In the Properties dialog. so each team member can temporarily change it without needing to check out any project files. Select a build support type. You can perform the following tasks to reconfigure your project: Task 1: Access build properties. because RTPs run only in the user space. and Build Paths tabs. Continue with the following tasks. they automatically use the same build spec that you did. This page automatically checks for and corrects backward slashes (\) that can result in errors. For general details about build properties. For example. do the following: 1. RTP projects do not provide build specs for any PPC variants other than PPC32. The Active build spec setting is not stored in the project. You will see several tabs. The build specs for your project type are selected and therefore enabled by default. If you enable more than one build spec.Wind River Workbench By Example.3 NOTE: All library paths should be specified on the Libraries page of the Build Properties dialog to avoid introducing errors. 3. you open the Build Properties dialog and display the existing build settings for your project. Task 2: Select build support and build spec options. In this task. 76 . Task 4: Define build macros. the one in the Default build spec field is used for most builds. A change to the Active build spec field is propagated to the appropriate fields on the Build Tools. This automatically uses the VIP’s build spec when building the application or library. if necessary. if there is a reason why you want to retain the build spec of the subproject (even if it means the subproject will not be built). because if you want to include a kernel module in a VxWorks image. click Disabled.6 Building Applications and Libraries 6. This is useful. The Subprojects tab of the VIP’s Build Properties dialog controls which build spec is used for its DKM. For example. select No Mapping instead. Edit the build command to add or change any arguments required by your application. If you enabled one build spec for this project. the build spec architecture and tool chain of the DKM and VIP projects must match (if they do not. 2. 4. Let Workbench calculate best matches is selected. 3. or reset the project’s build properties to their default settings. click Copy. By default. in the following ways. type in a name for your build spec. Click Managed build to re-enable build support. Include or exclude debug information. and ensures all subprojects are built. there must be a check in the check box to enable the build spec. 77 . Another way to change the active build spec is by selecting Build Options > Manage Active Build Specs. click Import and select the source of the build settings. considering the following options: You can select a different Active build spec for a particular build. Highlighting the name of the build spec is not sufficient. depending on whether you want the build output to include debug information or not. click Disable All and then select the check box next to the build spec(s) you want to enable.6 Reconfiguring Your Project Later in the Development Cycle If you are creating a project just so you can browse symbol information and you are not interested in building it. The new build spec appears at the bottom of the list. Enable or disable build specs. This allows you to apply a new active build spec (selected from a drop-down list of the project’s enabled build specs) to a set of projects rather than changing them one at a time. 5. you would add the -j option after the make command. Select Build Options > Set Active Build Spec or Build Options > Manage Active Build Specs. To import a build spec that you defined in another project. Update the build command. the subproject will not be built). To show only the build specs for your project. then click OK. and shared library subprojects (RTPs and shared libraries would be in a ROMFS file system). it appears in both the Default build spec and Active build spec fields. However. To use an existing build spec as the basis for creating your own. in the following ways: Select or clear the Debug Mode check box. Select default and active build specs. if you wanted to take advantage of the parallel jobs functionality of make to increase build performance. RTP. You can change the active build spec by right-clicking the project in the Project Explorer and selecting Build Options > Set Active Build Spec. If you choose one of the compiler tools. build output generation. 4. you select build tools. and build flags for your project. Specify the type of build output for Workbench to generate. this tool produces a single. 3. such as the C. unlinked object files. 78 . You can specify whether the build target should be passed or not. Select an option from the Options list in the center of the dialog. and you can configure all build tool settings to fit your needs. add or remove entries from the Command field. the build output will be a build target. To define your own build tool.Wind River Workbench By Example. unlinked object files can be passed. as well as any output received from projects further down in the hierarchy Librarian: The Librarian output can be passed up to superprojects. Partial Image Linker: Available for kernel modules projects. For these tools. Task 3: Select build tools. click New and enter a build tool name. Debug mode. Select one of the following build tools from the drop-down list. Assembler: These tools translate source code into machine code. select the tool from the Build tool drop-down list.3 6. it is not intended for download. 2. although the current project’s own. Linker: The linker produces a single. the build output will be an object by default. as necessary. or if you have finished configuring your project. or Non Debug mode. as can the current project’s own. partially linked. then select the 5. Some tools. as well as any output received from projects further down in the hierarchy. unlinked object files. or set different options for some build tools (whether or not you can edit the options for a particular build tool depends on the build spec you are using). as can any output received from projects further down in the hierarchy. To specify options for a build tool. then click OK. The Partial Image Linker output can be passed up to superprojects. click OK. This object cannot be passed up to superprojects. partially linked object that is intended for downloading. To specify build tools for a project. this object is also munched (integrated with code to call C++ static constructors and destructors). C-Compiler. provide the opportunity to edit several types of compiler options. depending on the type of option you want to adjust. 3. For kernel modules. or define your own. You can select a new active build spec. Adjust specific build spec settings. do the following: 1. Continue with the following tasks. and click Tool Flags. In this task. but not munched object for subproject support only. as can the current project’s own. C++-Compiler.and C++-Compilers. if you choose one of the linker or archiver tools. select a category (such as Debugging or Memory) from the column on the left. Your build tools appears in the drop-down list. click OK. click New next to the table. Or click Edit and type in the new value. Click OK.82. such as from within another build macro. Debug mode. Define or edit build spec-specific build macros. p. Click OK. then enter a Name and Value for the macro. click in the Command field.6 Building Applications and Libraries 6. 3. To define a new global build macro. Your choice appears in the Selected option column on the right.8 Using RTP Overlapped Virtual Memory. leave the Value blank. or if you have finished configuring your project. Define or edit global build macros. or if you have finished configuring your project. in the following ways: To change the value of an existing build spec-specific macro. and can be used in the Tool Flags field of the Build Tools tab.6 Reconfiguring Your Project Later in the Development Cycle appropriate option from the list in the center of the dialog. do the following: 1. select the macro. or click Edit and type in the new value. select the value in the Build spec-specific settings table. For information on how to do this. then click OK. or Non Debug mode field. These macros can also be used indirectly. To define a new build spec-specific macro. click New next to the table. select the value in the Build macro definitions table and type in a new one. select the Active build spec for which the value should be applied. You can define and use global build macros even if you do not select or define any build specs for your project. if you want to use the build spec-specific macro. Continue with the following tasks. you must refer to it in the command-line options for the compiler in the Command field of the Build Tools tab. In this task. To define the value. select the Active build spec for which the value should be applied. then click OK. you define global and build spec-specific macros that are added to the build command when executing builds. select the Tools tab. 6. then press the help key for your host. click Edit and enter the New value. 7. refer to it in the Command field of the Build Tools tab. To define build macros for a project. then type in a new one. 2. To use the macro you just defined. in the following ways: To change the value of an existing global build macro. then click OK. Continue with the following tasks. Task 4: Define build macros. If you are working with RTP virtual overlapped memory. click OK. 79 . then click OK. The selected option is appended to the Tool Flags. enter a Name for the macro. you will find additional information about setting the link address in 6. open the Build Properties dialog. As with global build macros. To specify libraries for a project. you specify a redirection root directory for your build output. This task shows you how to specify a new location for the build output.Wind River Workbench By Example. rename the directory. The Redirection directory is a subdirectory of the Redirection root directory. add. click OK. Where to Go Next For more information about writing kernel applications.3 Task 5: Specify build paths. In this task. Click the Libraries tab to bring that page forward. and update include paths. By default. see the Configuring Build Paths section of Wind River Workbench User’s Guide: Building Projects. click Add to all and then browse to or type in the path. 2. For a complete walkthrough of the Generate Include Search Paths dialog. click Add. click Generate. To analyze your project and update the displayed include paths. 4. Specify a new name for the Redirection directory by entering a new directory name in the field. The Generate Include Search Paths dialog opens. a library file. Task 6: Specify libraries. or reorder the directories searched by the build tools. or to all build specs. you add a library to a particular build spec. Continue with the following tasks. To specify build paths for a project. do the following: 1. 3. Click OK. For more information about writing real-time process applications. 3. select the build spec from the drop-down list. see VxWorks Application Programmer’s Guide: RTP Applications. 5. By default this directory has the same name as the Active build spec. The Include paths table shows the paths used by the compiler to resolve include directives. Specify a new location for the build output in the Redirection root directory field. Click Add or Add to all to add a library search path. 2. or a fully qualified library file. build output is directed to a subdirectory in your workspace. do the following: 1. 80 . (Optional) To add an include path that applies to all your build specs. then click OK. In this task. 6. see VxWorks Kernel Programmer’s Guide: Kernel Applications. (Optional) To manually add an include directory for an Active build spec. and browse to or type in the path (be sure not to erase the -I at the beginning of the path). or if you have finished configuring your project. delete. do the following: 1. installDir/components/ip_net2-6. Select CC_ARCH_SPEC in the Name column. 3. To find the ENDIAN setting for your processor.x/ipcom/port/vxworks/gmake/ipcom_vxworks_make. you add the correct ENDIAN preprocessor symbol to a build spec. Task 3: Add new include search paths so Workbench can find the IPNet APIs. Task 2: Add the correct ENDIAN preprocessor symbol to each build spec. type -DIP_LITTLE_ENDIAN or -DIP_BIG_ENDIAN. At the bottom of the Variables tab. 2. To add the ENDIAN preprocessor symbol to a build spec. 81 . 2. Next to the Include Paths pane. In the Value field. after the -I. do the following: 1. 5. 2. Task 1: Find the correct ENDIAN setting for your processor. Click the Paths tab to bring it to the foreground. Task 2: Add the correct ENDIAN preprocessor symbol to each build spec. In this task. substituting the Workbench installation directory for installDir and the appropriate VxWorks version for 6. Right-click the DKM project in the Project Explorer and select Properties. Repeat these steps for the other build specs used by this project. In this task. you add include paths so that the DKM project can use the IPNet headers and correct APIs. select a build spec from the drop-down list that you want to add the preprocessor symbol to. click Add to all to add the paths to all build specs used by this project.7 Example: Adding IPNet Support to a DKM 6. and includes the following tasks: Task 1: Find the correct ENDIAN setting for your processor. After any other values in the text field. with no space between them. and then click Edit.7 Example: Adding IPNet Support to a DKM This example shows you how to set the build properties for a DKM project so that it uses IPNet APIs. If you know the correct endianess for your processor.6 Building Applications and Libraries 6. as appropriate for the processor used by that build spec. To add include search paths for IPNet APIs. 4. Navigate to the following file. Select File > Open File. Click OK. then look for the appropriate endianess setting for your processor. you can go directly to Task 2: Add the correct ENDIAN preprocessor symbol to each build spec.x: Scroll down and look for the ENDIAN section. type this path then click OK: $(WRVX_COMPBASE)/$(COMP_IPNET2)/ipcom/port/vxworks/include Be sure the -I appears before the path. do the following: 1. 3.mk 3. Task 3: Add new include search paths so Workbench can find the IPNet APIs. Complete steps 2 and 3 for the remaining required directories: $(WRVX_COMPBASE)/$(COMP_IPNET2)/ipcom/port/vxworks/config $(WRVX_COMPBASE)/$(COMP_IPNET2)/ipcom/include $(WRVX_COMPBASE)/$(COMP_IPNET2)/ipcom/config $(WRVX_COMPBASE)/$(COMP_IPNET2)/ipnet2/include $(WRVX_COMPBASE)/$(COMP_IPNET2)/ipnet2/config Your DKM project can now use the IPNet headers and correct APIs. Click the Wind River Workbench project icon. To set build options for RTP overlapped virtual memory.x and then click Next. select Wind River VxWorks 6. if the library is to be linked against a kernel module at build time. on the left end of the Workbench toolbar. do the following: 1.9 Creating Statically Linked Libraries Static libraries contain object code that is copied into the executable when your library is linked to the application at build time. enter the RTP link address in the field. 3. To create a static library. 82 . This can be useful if you want to include the same code in several downloadable or relinkable images. Click Tool Flags. Select Linker from the Build tool drop-down list. do the following: 1. select one of the following: Static Kernel Library.Wind River Workbench By Example. 3. For more information about flat and overlapped RTP virtual memory models. The linker option and address appear in the Tool Flags field. 6. In this task. p.3 4. you can specify the address of the load and execution of the RTP application. see VxWorks Application Programmer’s Guide: Real-Time Processes. 6. as described in Task 1: Access build properties. you create a static library using the Wind River Workbench Project wizard. 2. From the Target operating system drop-down list. and click the Tools tab. From the Build type drop-down list.8 Using RTP Overlapped Virtual Memory If you are using an overlapped virtual memory model. Open the Build Properties dialog. for example in different VIPs. 3. 2.. and click OK.76. use VxWorks Shared Library projects. Your project appears in the Project Explorer. The New Wind River Workbench Project wizard appears.149. To create a VxWorks Shared Library project. and other options later in the development cycle. Your shared library project appears in the Project Explorer. Specify a location for the project. build tools. see 6. 3. see A. In the Project name field. Click Next. Click Next. p. select Shared User Library from the drop-down list. 6. and later adjust its configuration options. Click Finish. you can change the project’s build specs.10 Creating Shared Libraries For libraries that you want to dynamically link to RTP applications at run-time. Select Wind River Workbench Project from the Workbench toolbar. 6. For more information. 83 . Select Wind River VxWorks 6. type a name for your project.6 Building Applications and Libraries 6. if you selected Static User Library. On the Project screen. For more information about how to choose between the location options. Specify a location for your project. 7. or a local file system on the target (including ROMFS). see 6. Click Finish. 5. Click Next. in one of the following ways: As a downloadable kernel module. type a name for your library.x from the drop-down menu.3 Creating a Project For Your Application. For example. A shared library can be stored on a host file system. if you selected Static Kernel Library.10 Creating Shared Libraries Static User Library.69. 6. follow these steps: 1. p.3 Creating a Project For Your Application. Configuring VxWorks Shared Libraries You can create a shared library project. a network file system. On the Build Type screen. For information about the new files in your project. 5. p.69. 4.8 Project Files in Shared Library Projects. As a real-time process project. 2. 4. if the library is to be linked against a real-time process application. see 6.85. 3. In VxWorks. and Plug-Ins. a plug-in is a third-party module that can deliver new functionality or tools without having to recompile or reinstall Workbench.85. do the following: 1. The output product of the shared library linker is normally passed up to superprojects. see Wind River Workbench User’s Guide: Integrating Plug-ins.so target that is dynamically linked to at run-time. and Plug-Ins. In the Properties dialog. and Plug-ins. rather than when the application is loaded.10 Creating Shared Libraries. see VxWorks Application Programmer’s Guide: Static Libraries. For instructions on incorporating these plug-ins into Workbench. and add the file system to a VxWorks kernel image. p. by configuring options for both the library and the application. 6. see 6. For an example of how to do this. 3. If you do not pass the library target up to its superprojects. The difference is in how you code and build the application that uses the plug-in. similar to a shared library. Shared Libraries. that is called by an application when it is needed. p. For more information about VxWorks plug-ins. Making Shared Libraries Available to RTP Applications You can make shared libraries accessible to your applications at run-time.12 Example: Working with RTPs. You create this type of plug-in the same way you create a shared library (for details. Shared Libraries.Wind River Workbench By Example.12 Example: Working with RTPs. The same binary can be used for both. This example also shows you how to add the shared library and application to a ROMFS file system.3 NOTE: The shared library linker produces a BuildTargetName. 2.11 Creating Plug-Ins The term plug-in has the following two meanings in Wind River documentation: In Workbench.75.83). Change the library build options as described in 6. and Plug-Ins. p. a plug-in is a type of dynamic shared object. 84 .6 Reconfiguring Your Project Later in the Development Cycle. Right-click the shared library in the Project Explorer and select Properties. see 6. For information. Shared Libraries. Shared Libraries. select Build Properties. p. references in the superprojects’ application code cannot be resolved at compile time. see VxWorks Application Programmer’s Guide: Static Libraries. For more information about working with shared libraries. To modify the configuration options of a shared library. as explained in 9.4 Example: Bundling RTPs and Libraries with a VxWorks Image. Task 4: Set the include path to the header file for fooRtpApp. b. but the procedure it describes is similar if you are working with an NFS file system. Task 7: Verify the executables. Task 1: Create the projects you need. d. Create the RTP application project that will use the shared library. Shared Libraries. and Plug-Ins This example shows you how to create a pair of RTP application projects and a shared library. by following the instructions in step 1. in the following way: a. The example accesses a non-NFS file system on the host. naming the project fooPlugRtpApp. and Plug-ins. 85 . and Plug-Ins 6. This section walks you through the process of setting up the structure for this example.128. do the following: 1. Adding the RTP applications and library to a ROMFS that is bundled with a VxWorks kernel image. or as a plug-in when needed by the application. Task 6: Build the projects for this example. Create the RTP application project that will use the library as a plug-in. 2. Switch to the Advanced Device Development perspective. or if it is not open. To create RTP application projects and a shared library. then click Finish. Shared Libraries. c. type fooRtpApp as the name for your project. p. Task 3: Set up a build target for fooRtpApp. Creating and Building RTP Applications. This example contains the following sections: Creating and Building RTP Applications. Shared Libraries.12 Example: Working with RTPs. Running RTP Applications with Shared Libraries and Plug-Ins. see the Vxworks Kernel Programmer's Guide: Network File System. Leave Create project in workspace selected. and then code and configure the applications so they call the library either as a shared library at run time. select Window > Open Perspective > Advanced Device Development. On the Project screen. For information about setting up VxWorks with NFS support. In this task. you create two RTP application projects and a shared library.6 Building Applications and Libraries 6. and Plug-ins. Task 2: Add source code to your projects. and includes following tasks: Task 1: Create the projects you need.12 Example: Working with RTPs. Shared Libraries. Task 5: Set the RTP applications to be built as dynamic executables. Select File > New > VxWorks Real-Time Process Project. In the Editor. and then click Finish. Task 2: Add source code to your projects.h> #include <barLib. 2. c. and click Yes to save the changes. type the following into barLib.c. bar(). } d. and select New > File. return(0). you add source code to the projects you created in the previous task. The new file appears under the shared library. b. select File > New > VxWorks Shared Library Project. To add source code to your projects. and click Yes to save your changes. do the following: 1. c. then click Finish. Close fooRtpApp.h.c. a. and select New > File. d. type barLib. In the Editor. In this task.h> int main() { printf("I am main() in fooRtpApp\n"). b.h: void bar(void). 86 . in the following way: a. Right-click fooRtpApp. Add a source file to your library project. 3. type the following into barLib.h> #include <stdio.c: #include <vxWorks. Add a header file to your library project. In the File name field.h. } d. type fooRtpApp. In the Editor. In the File name field.h> #include <stdio. c.c. type the following into fooRtpApp. b. in the following way: a. Create the shared library project. Leave Create project in workspace selected. From the Advance Device Development perspective.h> void bar(void) { printf("I am bar() in barLib\n"). printf("I fooRtpApp just called bar() in barLib\n"). and then click Finish.c: #include <vxWorks. type barLib as the name for your project. Add a source file to the RTP application (that will use the shared library). and click Yes to save the changes. b. In the Project Explorer right-click barLib.Wind River Workbench By Example. then click Finish.3 3. Right-click barLib. On the Project screen. in the following way: a. In the File name field. then select New > File. 3. Close barLib. Close barLib. and opens for in the Editor. type barLib.c. c. NFS is transparent. addr = dlsym(handle. } 6. that uses a shared library. #include <vxWorks. type fooPlugRtpApp. Shared Libraries. but FTP requires hostname: before the path if it is not on the same system from which VxWorks was booted. Close fooPlugRtpApp. RTLD_NOW). and so on. "bar"). 5. printf("I fooPlugRtpApp just called bar() in barLib as plug-in using dlopen()\n"). For this reason. Also.so file on your host system. and click Yes to save your changes.so". and Plug-Ins 4. Right-click fooPlugRtpApp. such as fooPlugRtpApp. such as fooRtpApp. printf("I am main() in fooPlugRtpApp\n"). /* change the path in the dlopen call to match the one in your development environment */ handle = dlopen("host:C:/workspace/barLib/SIMPENTIUMdiab_RTP/barLib/Debug/barLib. in the following way: a. 87 . b.h> int main() { void *handle. then click Finish. void * addr. Add a source file to the RTP application (that will use the library as a plug-in). dlclose(handle).12 Example: Working with RTPs.h> #include <dlfcn. you set up the build-time linkage of an application. and select New > File. This creates an ELF NEEDED record in the application with the shared object name of the shared library. the path must be prefixed by the host: string (as in the code below). Task 3: Set up a build target for fooRtpApp. funcptr().c. you would not perform this task for an application that uses a plug-in. For example.6 Building Applications and Libraries 6. NOTE: Some types of connections between target and host require modifiers to the path name. return(0).c. it is important to mention that this code does no error checking. For information about accessing remote file systems from VxWorks (including other prefix requirements). funcptr = (void (*)())addr. void (*funcptr)(). For the VxWorks simulator. type the following code and change the dlopen() call so that it matches the path to the barLib. see the VxWorks Application Programmer's Guide: I/O System. In this task.c. In the File name field. The VxWorks simulator requires host: as a prefix. The dynamic linker uses this name at run time to load the shared library when the application is loaded.h> #include <stdio. Into fooPlugRtpApp. In this task you set the include path to the header file for fooRtpApp. Verify that the Build tool is set to Linker. 2. You do not need to resolve include paths for fooPlugRtpApp. In the upper left corner of the Edit Content dialog. c. click Next. Expand all the nodes within barLib (do not double-click barLib. 2. Notice that the entry -I%Proj-barLib% appears in the lower Include search paths pane. 88 . because it uses a plug-in. d. Configure fooRtpApp in the following way: a. because that will add it to the Content list). right-click fooPlugRtpApp (fooPlugRtpApp. double-click fooRtpApp to view its contents. 4. do the following: 1.vxe) and select Edit Content. e.Wind River Workbench By Example. In the dialog that appears. 3. Select the Tools tab to bring it forward. Verify that fooRtpApp . Configure fooPlugRtpApp in the following way: a. Click Next. then click OK. To set the include path for fooRtpApp. Task 4: Set the include path to the header file for fooRtpApp. select Show all projects to see barLib. do the following: 1. 6. Click OK to close the Build Properties dialog. 3. then right-click fooRtpApp (fooRtpApp. Task 5: Set the RTP applications to be built as dynamic executables. In this task. f. Click Tool Flags to open the Linker Options dialog. 5. and therefore doesn’t need to include a header for the code it calls.so) and click Add. b. 3. 2. On the Resolve include directives screen. Select Create a dynamic executable. 4.vxe). and the active build spec is SIMPENTIUMdiab_RTP for Windows and Linux. Under the Build Targets node of fooPlugRtpApp. Click Finish to create the build target under fooRtpApp (fooRtpApp. you set the RTP applications that will be built as dynamic executables. -Xdynamic now appears in the field next to Tool Flags. To specify applications to be built as dynamic executables. Open the Build Properties dialog and click Build Tools. 7.recursive appears in the Content list. In the Project Explorer. Right-click fooRtpApp and select Build Options > Generate Include Search Paths. click Resolve All.vxe) and select Properties. Select barLib (barLib.3 To set up a build target for fooRtpApp. and SIMSPARCSOLARISdiab_RTP for Solaris. then Finish. Double-click Build Targets. do the following: 1. open your preferred shell window.6 Building Applications and Libraries 6. you build the three projects you created for this example in the previous tasks.1 are listed as NEEDED for fooRtpApp. navigate to installDir/workspace/fooRtpApp/SIMPENTIUMdiab_RTP/fooRtpApp/ Debug. do the following: 1.so provides all of the basic facilities that an application might require. in one of the following ways: On Windows. then set environment variables by typing the following command at the prompt. select Start > Programs > Wind River > VxWorks 6. You can use the program readelfarchName -d to make sure that the correct NEEDED records were created.so. readelfpentium. To build the shared library. c./wrenv. you verify that the appropriate records were created.x 2. and you selected Create a dynamic executable for both RTP applications. and click OK twice to close the dialog. Select Linker and click Tool Flags. To build fooRtpApp. To build the three projects in this example. To examine the executables for this example. Substitute the appropriate architecture name in the command.12 Example: Working with RTPs. Similar to the UNIX C run-time shared library.c to match your development environment. Open a terminal window. To build fooPlugRtpApp. All projects should build without errors. In the output that appears. In this task. For fooRtpApp. and Plug-Ins b. Task 7: Verify the executables. do the following: 1. type the following: $ readelfpentium -d fooRtpApp. you can see that both barLib. Select Create a dynamic executable. libc. The build output appears in the Build Console.so C run-time shared library. Shared Libraries. NOTE: If errors do appear in the Build Console.sh -p vxworks-6. 3. 2. At the command prompt. make sure you changed the dlopen path in fooPlugRtpApp. On Linux and Solaris. for example.so and libc. right-click the project and select Build Project and click Continue when it asks to generate include paths.x: $ .x and General Purpose Technologies > VxWorks Development Shell. substituting the correct version number for 6.vxe 3. Dynamic section at offset 0x7f38 contains 18 entries: 89 . In this task. right-click the project and select Build Project. right-click the project and select Build Project and click Continue when it asks to generate include paths. The VxWorks distribution provides the libc. Task 6: Build the projects for this example. so. navigate to installDir/workspace/fooPlugRtpApp/SIMPENTIUMdiab_RTP/ fooPlugRtpApp/Debug. This section covers the following tasks: Task1: Create and build a custom VxWorks kernel image. Dynamic section at offset 0x7e7c contains 17 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libc.so] Shared library: [libc. Task 2: Create a new VxWorks simulator target connection based on your VIP. type the following: $ readelfpentium -d fooPlugRtpApp. 90 . Shared Libraries. and Plug-ins.so. In the output that appears. 3.1] 0xc0 0x43c 16 (bytes) 0xa1c 1372 (bytes) 0x16e0 160 (bytes) REL 0x0 0x1805c 0xf78 1896 (bytes) 8 (bytes) 0x0 0x0 4. you can see that only libc. Running RTP Applications with Shared Libraries and Plug-Ins This section walks you through creating and booting a custom VxWorks kernel image. At the command prompt.1 is listed as NEEDED for fooPlugRtpApp.vxe 5. and then running applications that you created in Creating and Building RTP Applications.1] 0x00000004 (HASH) 0xc0 0x00000006 (SYMTAB) 0x418 0x0000000b (SYMENT) 16 (bytes) 0x00000005 (STRTAB) 0x968 0x0000000a (STRSZ) 1248 (bytes) 0x00000017 (JMPREL) 0x15a0 0x00000002 (PLTRELSZ) 152 (bytes) 0x00000014 (PLTREL) REL 0x00000016 (TEXTREL) 0x0 0x00000003 (PLTGOT) 0x17f9c 0x00000011 (REL) 0xe48 0x00000012 (RELSZ) 1880 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000015 (DEBUG) 0x0 0x00000018 (BIND_NOW) 0x00000000 (NULL) 0x0 Where to Go Next Continue with Running RTP Applications with Shared Libraries and Plug-Ins.so.3 Tag 0x00000001 0x00000001 0x00000004 0x00000006 0x0000000b 0x00000005 0x0000000a 0x00000017 0x00000002 0x00000014 0x00000016 0x00000003 0x00000011 0x00000012 0x00000013 0x00000015 0x00000018 0x00000000 Type (NEEDED) (NEEDED) (HASH) (SYMTAB) (SYMENT) (STRTAB) (STRSZ) (JMPREL) (PLTRELSZ) (PLTREL) (TEXTREL) (PLTGOT) (REL) (RELSZ) (RELENT) (DEBUG) (BIND_NOW) (NULL) Name/Value Shared library: [barLib.Wind River Workbench By Example. For the RTP application that uses the plug-in. you create a project using the PROFILE_DEVELOPMENT configuration profile. Task 4: Launch the RTP application that uses a plug-in. Task 6: Disconnect the VxWorks simulator. as your BSP. and then click Next. e. In this task. On the Project screen. create a target connection. p. and Plug-Ins Task 3: Launch the RTP application that uses a shared library. select linux or solaris. select Window > Open Perspective > Advanced Device Development. You will need this information for the next task.12 Example: Working with RTPs. Task1: Create and build a custom VxWorks kernel image. Since you will run your kernel image on the VxWorks simulator. Shared Libraries. and click Next. respectively.32. you should see a line similar to installDir/workspace/VIPsimpc/default. Select File > New > VxWorks Image Project. You then build the project. Your project appears in the Project Explorer. that includes development and debugging components. From the Profile drop-down list. see 4. In this task. 91 .x Simulator Connection. select PROFILE_DEVELOPMENT and click Finish. leave Create project in workspace selected. To enable the WDB Target Agent. To create and build a custom VxWorks kernel image. Create a VxWorks image project in the following way: a. On the Remote Systems toolbar. c. 2. NOTE: Near the bottom of the Build Console. click Define a connection.6 Building Applications and Libraries 6. type VIPsimpc as the name for your project. In the New Connection dialog. b. then click Next twice until you reach the Configuration Profile screen. do the following: 1. If you are running a Linux host or a Solaris host. 2. you create a VxWorks simulator target connection based on the VIP from Task1: Create and build a custom VxWorks kernel image. Switch to the Advanced Device Development perspective. NOTE: The WDB Target Agent is disabled by default. Right-click the project and select Build Project. The build output appears in the Build Console. select Wind River VxWorks 6. To create a VxWorks simulator target connection. Task 5: (Optional) Continue to debugging. d. This is the path to the vxWorks kernel image file. do the following: 1. Task 2: Create a new VxWorks simulator target connection based on your VIP. unless you are working with a simulated target.3 Creating a Custom VxWorks Image. make sure simpc and diab are selected as the BSP and Tool chain. and launch the applications. or if it is not open. vxe' . 3. To launch the RTP application. Launch fooRtpApp using the following command.1. 3. switch the host shell from the C interpreter to the command interpreter by typing cmd. remembering to substitute the correct path in your environment for installDir and the correct version number for 6.x: [vxWorks *]# rtp exec -e "LD_LIBRARY_PATH=host:installDir/workspace/barLib/SIMPENTIUMdiab_RTP/barLib/Deb ug..so. you launch the RTP application you developed in Creating and Building RTP Applications. Launching process 'host:installDir/workspace/fooRtpApp/SIMPENTIUMdiab_RTP/fooRtpApp/Debug/fooRtpA pp. Click Finish.host:installDir/vxworks-6. 2. The new vxsim# connection appears in the Remote Systems view (the # will vary. In the vxsim window. do the following: 1. One of the default settings is Immediately connect to target if possible. The prompt changes from -> to #. and Plug-ins.vxe' (process Id = 0x1173a908) launched. Process 'host:installDir/workspace/fooRtpApp/SIMPENTIUMdiab_RTP/fooRtpApp/Debug/fooRtpA pp. depending on how many previous simulator connections you created).1 from the VxWorks standard installation. Task 3: Launch the RTP application that uses a shared library. In this task.vxe This command uses the LD_LIBRARY_PATH environment variable to identify the run time location of your custom shared library barLib. In this task. you verify that the RTP application is launched and calls the shared library.. In the vxsim window. To launch the RTP application. remembering to substitute the correct path for installDir and the correct version number for 6. The LD_LIBRARY_PATH is used to provide the location of libc. then type the path to your kernel image file (such as installDir/workspace/VIPsimpc/default/vxWorks) or click Browse and navigate to the location.Wind River Workbench By Example. as well as libc.x: 92 . 4. Expand the vxsim window to see your kernel image’s symbol table being loaded near the beginning of the sequence.so. I am main() in fooRtpApp I am bar() in barLib I fooRtpApp just called bar() in barLib [vxWorks *]# Task 4: Launch the RTP application that uses a plug-in. do the following: 1. For this example you can use the remaining default settings.x/target/lib/usr/root/SIMPENTIUMdiab/bin" host:installDir/workspace/fooRtpApp/SIMPENTIUMdiab_RTP/fooRtpApp/Debug/fooRtpAp p. Shared Libraries. Click Custom simulator.3 3. launch fooPlugRtpApp using the following command. so a VxWorks simulator window opens and displays the host shell running the boot sequence for your custom kernel image. Verify that your RTP application launched and called the shared library in the output that appears. you learn the different methods for disconnecting the VxWorks simulator. I am main() in fooPlugRtpApp I am bar() in barLib I fooPlugRtpApp just called bar() in barLib as plug-in using dlopen() [vxWorks *]# Task 5: (Optional) Continue to debugging.vxe' (process Id = 0x1173b640) launched. For more information about the host shell. To disconnect from the VxWorks simulator. and Plug-ins. In this task. click Disconnect ‘vxsim#’.13 Running Applications on a Hardware Target $ rtp exec -e "LD_LIBRARY_PATH=host:installDir/vxworks-6. In this task. p.x/target/lib/usr/root/SIMPENTIUMdiab/ bin" host:installDir/workspace/fooPlugRtpApp/SIMPENTIUMdiab_RTP/fooPlugRtpApp/Debug/ fooPlugRtpApp.vxe 2. For more information about the VxWorks simulator. you must create a target connection.. On the Remote Systems toolbar. 93 .6 Example: Debugging RTPs. To continue on and debug your applications. Process 'host:installDir/workspace/fooPlugRtpApp/SIMPENTIUMdiab_RTP/fooPlugRtpApp/Debug /fooPlugRtpApp. Shared Libraries. see Connecting to VxWorks Targets. For information on how to do this. do the following: Go to 8. you learn where to find information on debugging applications. as well as in-depth information on other topics related to this example. The following information is also available: For more information about shared libraries. 6. see the Wind River Workbench Host Shell User’s Guide. see the Wind River VxWorks Simulator User’s Guide. including details about using the LD_LIBRARY_PATH environment variable and other methods for identifying the run time location of shared libraries (and the priorities of these methods).6 Building Applications and Libraries 6.vxe' . Launching process 'host:installDir/workspace/fooPlugRtpApp/SIMPENTIUMdiab_RTP/fooPlugRtpApp/Debug /fooPlugRtpApp. Shared Libraries. see VxWorks Application Programmer’s Guide: Static Libraries. do one of the following: Close the vxsim# window.116. Verify that your RTP application is launched and calls the shared library (as a plug-in this time) in the output that appears. p.. Task 6: Disconnect the VxWorks simulator. and Plug-Ins.13 Running Applications on a Hardware Target To run your application on a hardware target.95. 3 94 . 3.Wind River Workbench By Example. Configuring and establishing a connection between the host and target includes the following: Configuring the host side of the target connection (the target server) in the Remote Systems view. You must configure and establish a connection between the Workbench tools running on your host and the target system before you can test your customized VxWorks kernel image. and manage your target connections. as described in 3. you must have already completed the following procedures: Configure your host. see 4.2 What Are Target Servers and Target Agents? 96 7. or run your kernel or RTP application.1 Introduction This chapter tells you how to configure. 95 .5 Example: Connecting a Target Server to a Target Agent 104 7.1 Introduction 95 7. whether the target is an actual hardware board or the VxWorks simulator.3 Configuring Your Host Machine. start.7 Connecting to VxWorks Targets 7.6 Defining a New Remote Connection 106 7. Configuring the target side of a connection (the target agent) in the Kernel Configuration Editor. p.4 Defining a New Target Server Connection 99 7.1 Configuring VxWorks Using the Kernel Configuration Editor.7 Troubleshooting Target Server Connections 106 7. Before You Begin To set up communication between a host and a target.3 Creating a VxWorks Simulator Connection 97 7.4. p.38).18. For information on the Kernel Configuration Editor. after a breakpoint). Debugging is performed on a per-task basis: you can isolate particular tasks without affecting the rest of the target system. A self-booting system image does not need a target agent. were a single thread of execution. If you configure and build a VxWorks kernel image with a target agent interface that understands a particular communication method (network. This allows you to debug an application as if it. and so on). 7. Another drawback is that this mode is more intrusive. on the other hand. and a system-mode 96 . as described in 3. running on the host. JTAG.3 Configure your target. because the agent runs with interrupts locked when it takes control (for example. then your target server must be configured with settings that support the same communication protocol and transport layer. To support dual mode debugging. 3. and VxWorks. serial. the target server must be configured with a back end that matches the VxWorks kernel’s target agent interface. p. One of the biggest advantages of this mode is that you can single-step through ISRs. you can configure VxWorks images with both agents: a user-mode agent (INCLUDE_WDB_TASK). it adds significant interrupt latency to the system. In system mode. and dual mode.2 What Are Target Servers and Target Agents? This section explains the functions of target servers and target agents. This collection of settings is known as the target server’s back end. the agent runs as a VxWorks task. In this mode. it is more difficult to manipulate individual tasks.20. that allows Workbench tools such as shells and debuggers to communicate with the target agent running on the target. when the target encounters a breakpoint.4 Configuring Your Target. Understanding Target Servers A target server is a program. VxWorks and the application are stopped and interrupts are locked. You probably need a target agent only during development. The target agent can function in one of three modes: user mode. Understanding Target Agents A target agent is a program that runs on the target and acts as the interface between the VxWorks image on the target and the Workbench tools on the host. For host-target communication to work.Wind River Workbench By Example. system mode. In user mode. the agent runs externally from VxWorks. You must configure the target server and target agent that act as the interpreters between the Workbench tools running on the host and the VxWorks kernel image running on the target. almost like a ROM monitor. If you are working with an existing VIP.x kernel. NOTE: The WDB Target Agent is disabled by default. do one of the following: In the Remote Systems view. select Create VxWorks Simulator Connection. with only one of these agents active at a time. see 4. allowing you to proceed with your development work until a target board is available. p. and then go to step 3. the target communication path must work in polled mode (because the external agent needs to communicate to the host even when the system is suspended). On the initial page of the New Connection wizard. right-click a VIP project that has already been built.7 Connecting to VxWorks Targets 7. you create a VxWorks simulator connection in preparation for running the simulator. 7.3 Creating a VxWorks Simulator Connection To see if your program runs properly before downloading it to a target board. Solaris is not a siupported host OS for 64-bit simulation.3 Creating a VxWorks Simulator Connection agent (INCLUDE_WDB_SYS).4.38 To support a system-mode or dual-mode agent. p. In the Remote Systems view. To create a VxWorks simulator connection.32. do the following: 1. unless you are working with a simulated target. Your 64-bit host must be a supported version of Windows or Linux. This simulates a connection to a standard or customized version of a VxWorks 6.3 Creating a Custom VxWorks Image. Creating a Standard VxWorks Simulator Connection In this task. To enable the WDB Target Agent. Switching between the two can be controlled from either the Workbench debugger (see Wind River Workbench User’s Guide: Debugging Projects) or the host shell (see Wind River Workbench Host Shell User’s Guide). 2.1 Configuring VxWorks Using the Kernel Configuration Editor. you must run the VxWorks simulator on a 64-bit host operating system. right-click in the view and select New > Connection. In the Project Explorer. you can run it on the VxWorks simulator. 97 . click Define a connection on the toolbar. see 4. Immediately connect to target if possible is one of the default settings you should accept.x Simulator Connection and click Next. enable the WDB Target Agent in the Kernel Configuration Editor. select Wind River VxWorks 6. To open the New Connection wizard. NOTE: To simulate 64-bit VxWorks. The choice of communication path can affect what debugging modes are available. Specify the kernel image file and other parameters. right-click a VIP project that has already been built. in one of the following ways: In the Remote Systems view. click Define a connection on the toolbar. do the following: 1. you can adjust this if you like. For VxWorks 6. Generally. select the check box. because the target will be looking at the wrong symbols. Workbench does a checksum comparison to prevent you from attaching and debugging a target if the target kernel and host copy do not match. The target connection is created. 3. From the VxWorks Boot parameters screen. e. In the Project Explorer. Processor number displays the incrementing number that Workbench will assign to the simulator connection you are creating. Click Next. selecting this check box allows Workbench to make the connection. and set the simulator memory options. debug information.3 3. If you want to set specific VxWorks simulator boot parameters. 3. b. In the Remote Systems view. Because you are accepting all the default settings in this example. offsets.7 and earlier. and so on.x Simulator Connection. select Custom simulator. Customizing a VxWorks Simulator Connection To customize a VxWorks simulator connection. click Advanced Boot Parameters. if you understand the system very well and wish to connect anyway.Wind River Workbench By Example. then click Browse and navigate to the location of the vxWorks kernel file you want to use. you open the New Connection wizard and instead of clicking Finish from the Boot parameters screen. select Create VxWorks Simulator Connection. From the VxWorks Boot parameters screen. then click Next. 2. downloading the standard VxWorks image. c. However. in the following way: a. If you want to bypass checksum comparison. 98 . select Standard simulator. a VxWorks simulator console automatically opens within Workbench in a Target Console view. On the initial page of the New Connection wizard. click Finish. right-click in the view and select New > Connection. In this task. Each new simulator connection is named vxsim#. Open the New Connection wizard.8 and later. a shell window opens. you specify the kernel image and other parameters. downloading the standard VxWorks image. you start by creating a connection the same way as you would for a default connection. select Wind River VxWorks 6. you would customize the simulator connection if you built a custom VxWorks kernel image or you want to adjust memory. For example. and then go to step 3. d. To customize a VxWorks simulator connection. and the simulator starts in one of the following ways: For VxWorks 6. The kernel component in the following table must be configured into your VxWorks kernel image. in the following way: a. including whether you want to connect to the target now.7 Connecting to VxWorks Targets 7. Defining the connection includes the following tasks: Task 1: Open the New Connection wizard. For more information. The options on this screen allow you to manage your memory resources. see the Wind River VxWorks Simulator User’s Guide. Before You Begin Before you can create a connection with a target server. Set the simulator memory options. Task 4: Specify advanced target server options.37. Back End Description Compatible Kernel Component wdbrpc The default back end. For VxWorks target simulators. Task 5: Configure object path mappings. then click Finish. For more information about the settings on these screens.4 Defining a New Target Server Connection To run your program on a target board. Task 2: Select a target server back end. b.4 Configuring VxWorks. Task 8: Verify or modify Connection Summary settings. INCLUDE_WDB_COMM_END or Supports any kind of IP INCLUDE_WDB_COMM_NETWORK connection. Task 3: Specify the kernel image. Polled-mode Ethernet drivers are available for most BSPs to support system-mode debugging.4 Defining a New Target Server Connection 4. as well as how to use the simulator once it is running. INCLUDE_WDB_COMM_PIPE wdbpipe 99 . you first need to define a target server connection. Make sure the settings are adjusted the way you want. see 4. you must know the kernel component for your project and it must be properly configured to interface with the target server. p. Task 6: Specify how often Workbench should retrieve target status. 7. Wind River Workbench By Example. In this task. or INCLUDE_WDB_PROXY_MIPC Task 1: Open the New Connection wizard. INCLUDE_WDB_PROXY_UDP (for UDP/TCP). In the Back end settings section. you specify the kernel image to use with the target server. to manually set the processor click Select and choose your processor from the list. you bring up the New Connection wizard and specify a target server connection. Click Define a connection on the Remote Systems view toolbar.3 INCLUDE_WDB_COMM_SERIAL wdbserial For serial hardware connections. and then click Next. Supports either system-level or task-level views of the target. and clicking OK. and MIPC connections. To do so. To specify a target server back end. On the initial page of the New Connection wizard. 2. In this task. In this task. TCP. You can also specify any necessary information for the back end. do the following: 1. For example. Task 2: Select a target server back end. 2. select Wind River VxWorks 6. Task 3: Specify the kernel image. 3. To open the New Connection wizard. Workbench can usually identify the target processor.x Target Server Connection. depending on the target-agent configuration. select the back end that matches the method the target server will use to communicate with the target. How you do this depends on where the kernel image is located. enter the custom rate. Provide the necessary information for the back end. do the following: 1. or right-click in the view and select New > Connection. select Other from the Serial device speed (bit/ss) drop-down list. For connections that use a wbdserial backend setting. also choose a Host serial device and Serial device speed. you specify the back end that matches the method the target server will use to communicate with the target. Each type of back end requires you to provide additional connection information. wdbproxy For UDP. For example. With this option. 100 . INCLUDE_TIPC_ONLY. does not require SLIP on the host system. TIPC. you can now specify a custom baud rate. you must use this option to identify the kernel file location. the target server will not be able to identify the target symbols. Be aware that this also allows other users to access your host file system. if you are booting a target over a serial connection. Click the Logging tab to enable output and back end logging on the Logging tab. To specify advanced target server options. you must also include the WDB target server file system kernel component when you build your VxWorks kernel image. To avoid excessive data-transfer transactions with the target. vxWorks_romCompressed. such as allowable spawn time for kernel tasks and RTPs. and at what intervals. since this is how it uploads event data from the target to the host. time to wait for a response from the agent running on the target. or click Edit to configure the settings represented by these options. select File and navigate to the host location of the kernel image. 3. this is the workspace directory. 2. Specify the log’s location and maximum size (logs are rewritten from the beginning when they reach this maximum size. do the following as needed: 1.7 Connecting to VxWorks Targets 7. Otherwise. or any other on-board VxWorks image. c. so you may want to set the TSFS option to read-only when you are not using System Viewer. Task 4: Specify advanced target server options. select File path from target (if available). Specify timeout options. You can type them in. The options shown in the Options field are passed to the tgtsvr program on the command line. Enable the TSFS if you are using Wind River System Viewer. memory cache. 101 . to modify cache size. do one of the following: If the VxWorks image is running on the target. In this task. If you are using a target programmed with a vxWorks_rom.hex. Click the Common tab and select from the following to configure the target server file system (TSFS) and various timeout options: a.hex. You can increase this size on the Memory tab. timeout. Make the target server file system writable when you are using System Viewer. you specify options such as. and local and global symbols. By default. b. such as after a reboot).4 Defining a New Target Server Connection To identify the kernel image to use. Identify the root directory of the host file system. d. and they are deleted and recreated when the target server restarts. If the VxWorks image file is not in the same location on the host that is configured into the target (or if host and target have different views of the file system). To use the TSFS. the target server maintains a cache on the host system of up to 1 MB. how often to retry. and do the following as needed: a. logging. and Workbench can find it using the target path. or if you need to provide a target that is booted from a remote host access to files on a local host. Click the Memory tab. unstripped when yourApp. To specify object path mappings for modules without symbols. Do not use relative host paths here. uncheck Load module symbols to debug server automatically if possible. do the following: 1. Mapping pairs (in square brackets) are separated by commas. 2. a regular expression that limits the type of information logged. specify a filter. by browsing to them with a host file system browser. the mapping [*. select Create path mappings for the module based on the selected symbol file and click OK. 3. so that after the next disconnect/reconnect sequence Workbench will find the symbols.unstripped] will ensure that the debugger loads yourApp. you can create Object Path Mappings for a module that does not have symbols yet by downloading the output file (or running the executable) manually. Object path mappings are created automatically. by doing the following: 1. Click Next. Object path mappings allow the debugger to find symbol files for processes created on the target.unstripped. use square brackets to enclose each mapping of target file basenames (left element) to host file basenames (right element).3 b. right-click the file or executable and select Load/Add Symbols to Debug Server. By default. 4. Without a filter.Wind River Workbench By Example. the debug server attempts to load all of a module’s symbols each time a module is loaded. For the WTX (Wind River Tool Exchange) log file. 3. 2. At the bottom of the screen. click Add and enter the target path (for example. In most cases the default mappings that Workbench provides are correct (and are not editable). To download a module or start a process without loading the symbol file. the log captures all WTX communication between host and target. you configure object path mappings for modules with symbols or modules that do not yet have symbols. To export object path mappings to XML. Task 5: Configure object path mappings. if debug versions of files are identified by the extension *.vxe is launched on the target. In this task. Click the Symbols tab to specify whether to load global symbols (the default) or both global and local symbols. From the Load Symbols dialog. You can use an asterisk (*) as a wildcard. 102 . 4. To map a new target path prefix to a host path.*. This is done by creating a correspondence between a path on the target and the appropriate path on the host. click Export and provide a descriptive filename. Likewise you can import mappings by clicking Import and selecting an appropriate XML file. /tgtsvr/) and a full host path (for example.vxe. Create mapping pairs. You calculate target paths for processes that you want to launch. the connection sequence may fail. If you choose not to load symbols to the target server.). To specify object path mappings for modules with symbols. For example. In the Remote Systems view. separated by a semi-colon (. 5. C:\workspace\). Alternately. In a connection that is flagged as Shared. Click Next. In this task you review the Connection Summary settings and verify or modify them. click Back and update the appropriate screen. Click Next. they are left running so that other users can connect to them.7 Connecting to VxWorks Targets 7. To modify the Connection name. provided that they connect to your registry (by adding it as a remote registry on their computer. in one of the following ways: To connect to the target as soon as you finish reviewing the summary. To specify the refresh rate for the Remote Systems display. you can flag a connection as shared if you want to keep the target server (and simulator) running after you disconnect or exit Workbench. see the Wind River Workbench User’s Guide). Specify which threads Workbench should stop when breakpoints are hit. and serves the following purposes: When you define a target connection configuration. 103 . Verify or modify the Shared option (to the right of the Connection name field) is available only for certain connection types. To specify debug options. when you terminate a target connection. Normally.4 Defining a New Target Server Connection 3. In this task. In this task. Verify or modify the connection setting. do not select Listen to execution context life-cycle events when there are more than 100 contexts on the target. If you define it as Shared. 3. To prevent excessive delay in the update of the Remote Systems display. for details. this connection is normally visible only to you. leave Immediately connect to target if possible selected. In other words. Workbench kills the target server (and simulator) because you no longer need them. Click Next. you specify the debug options. 2. do the following: 1. Task 8: Verify or modify Connection Summary settings. since retrieving status information from the target leads to considerable target traffic. 2. 3. do the following: 1. or any of the settings associated with this connection. Task 7: Set the debug options. 2. Task 6: Specify how often Workbench should retrieve target status. This is important. other users can also see the configuration in your registry. do the following: 1. as needed. To review connection summary options. you specify how often and under what conditions Workbench should refresh the Remote Systems view display. Specify whether to display an error dialog on target exceptions. however. Wind River Workbench By Example, 3.3 If you do not, clear the check box; you can connect later by right-clicking the connection and selecting Connect. 4. Click Finish. Your new target server connection definition appears in the Remote Systems view connection list. If everything is set up properly, and Immediately connect to target is selected, you will see connected - target server running at the bottom of the Workbench window. If you have problems connecting, see 7.7 Troubleshooting Target Server Connections, p.106. Where to Go Next For more information about target servers and target agents, see the VxWorks Kernel Programmer’s Guide. You can also find information about target servers in the tgtsvr reference entry, available by typing tgtsvr into the Search feature of the Workbench help system. 7.5 Example: Connecting a Target Server to a Target Agent In this example, you configure a target server to connect to a target agent over an Ethernet connection. This example includes the following tasks: Task 1: Open the New Connection wizard. Task 2: Specify the target server options. Task 3: Specify the object path mappings. Task 4: Select the desired target state refresh frequency. Task 5: Set the debug options. Task 6: Review the connection summary settings. Task 7: Create the target server connection definition. Before You Begin You can specify a name for the target server only if you added it to your hosts file in 3.4 Configuring Your Target, p.20. NOTE: The WDB Target Agent is disabled by default, unless you are working with a simulated target. To enable the WDB Target Agent, see 4.3 Creating a Custom VxWorks Image, p.32. If you are working with an existing VIP, enable the WDB Target Agent in the Kernel Configuration Editor, see 4.4.1 Configuring VxWorks Using the Kernel Configuration Editor, p.38 Task 1: Open the New Connection wizard. In this task, you bring up the New Connection wizard and specify a target server connection. 104 7 Connecting to VxWorks Targets 7.5 Example: Connecting a Target Server to a Target Agent To open the New Connection wizard, do the following: 1. 2. Click Define a connection on the Remote Systems view toolbar, or right-click in the view and select New > Connection. On the initial page of the New Connection wizard, select Wind River VxWorks 6.x Target Server Connection, and then click Next. Task 2: Specify the target server options. In this task you specify the wdbrpc back end, the name or address of the target, and set output options. To specify target server options, do the following: 1. 2. Select the wdbrpc back end, and type in the name or IP address of the target. Under Advanced target server options, select Verbose target server output. Your command line should look similar to this: tgtsvr -V -R C:/installDir/workspace -RW -Bt 3 -A ipaddress_or_name 3. Click Next. Task 3: Specify the object path mappings. In this task, you configure object path mappings. Object path mappings describe the relationship between the location of executables and symbol files on the target, and their location on the host. To configure object path mappings, do the following: 1. 2. Follow the instructions, as described in Task 5: Configure object path mappings., p.102. Click Next. Task 4: Select the desired target state refresh frequency. In this task, you specify when and how you want Workbench to query the target state. To specify the refresh rate for the Remote Systems display, do the following: 1. To prevent excessive delay in the update of the Remote Systems display, do not select Listen to execution context life-cycle events when there are more than 100 contexts on the target. Click Next. 2. Task 5: Set the debug options. In this task, you specify the debug options. To specify debug options, do the following: 1. 2. 3. Specify which threads Workbench should stop when breakpoints are hit. Specify whether to display an error dialog on target exceptions. Click Next. 105 Wind River Workbench By Example, 3.3 Task 6: Review the connection summary settings. In this task you review the Connection Summary settings and verify or modify them, as needed. This screen lists all the default and customized settings associated with this target connection definition. To review connection summary options, do the following: 1. 2. Verify that the settings reflect your choices on the previous screens. Verify or modify the following setting, as needed: The Immediately connect to target if possible box is selected by default. This means that if your target booted successfully in 3.5 Booting a Target with VxWorks, p.23, Workbench will attempt to connect to your target. If you want to create this definition but your target is not running yet, clear this check box. Task 7: Create the target server connection definition. In this task, you create the connection definition. To create the target server connection definition, do the following: Click Finish. Your new target server connection definition appears in the Remote Systems view connection list. If everything is set up properly, and Immediately connect to target is selected, you will see connected - target server running at the bottom of the Workbench window. If you have problems connecting, see 7.7 Troubleshooting Target Server Connections, p.106. 7.6 Defining a New Remote Connection If you want to define a remote system connection such as FTP or SSH, see the following documents available from the Workbench help system: Wind River Workbench User’s Guide: Building: Use Cases Using Remote Connections section of RSE User Guide: Getting Started, 7.7 Troubleshooting Target Server Connections This section provides solution suggestions if you are experiencing target server connection problems. Review these suggestions before calling technical support. 106 unless you are working with a simulated target. if the target boots from a local device). By default. In some cases (for example. see 4. this default is not useful. p.1 Configuring VxWorks Using the Kernel Configuration Editor. make sure you have connected the serial cable to a port on the target system that matches your target agent configuration.38 Check Back End Serial Port If you use a WDB Serial connection to the target. TIPC Connection Does Not Function Properly Be careful not to choose TIPC (under WDB Proxy connection type) unless you have included the TIPC network stack (INCLUDE_TIPC_ONLY) component in your VxWorks image project. Verify Path to VxWorks Image The target server requires a host-resident image of the VxWorks run-time system. For more information about TIPC.7 Troubleshooting Target Server Connections NOTE: The WDB Target Agent is disabled by default. see Wind River TIPC for VxWorks 6 Programmer’s Guide: Building VxWorks to Include Wind River TIPC. In that situation. it obtains a path for this image from the target agent (as recorded in the target boot parameters). see 4. in that situation. The agent uses serial channel 1 by default.4. which is different from the channel used by VxWorks as a default console (channel 0). enable the WDB Target Agent in the Kernel Configuration Editor. If you are working with an existing VIP.3 Creating a Custom VxWorks Image. create a new Target Server Connection definition in the Remote Systems view. Use the -c filename option in the Advanced Target Server Options field to specify the path to a host-resident copy of the VxWorks image.7 Connecting to VxWorks Targets 7. To enable the WDB Target Agent.32. 107 . Your target’s ports may be numbered starting at one. p. VxWorks channel one corresponds to the port labeled serial 2. Wind River Workbench By Example.3 108 . 3. 2 How Can Workbench Help Me Run My Code? 109 8. Creating a launch configuration expedites running and debugging an application by allowing you to configure everything 109 . you can then run and debug your code. For general information about launch configurations of all types. After you have created your projects. open the launch configuration dialog and press the help key for your host. Shared Libraries. For specific information on a tab or field. and Plug-ins 116 8.4 Running Your Applications 113 8. you may run and rerun the same application many times in a single debugging session. Workbench assists you with build–connect–run–debug phase of the development cycle by providing a framework called a launch configuration.5 Debugging Your Applications 115 8. and configured a connection to your target.1 Introduction 109 8.1 Introduction This chapter explains how to create launch configurations for VxWorks kernel tasks and real-time processes.3 How Do I Create a Launch Configuration? 110 8.7 Monitoring Semaphores During Debugging 118 8. coded and built your kernel or application. see Wind River Workbench User’s Guide: Launching Programs.2 How Can Workbench Help Me Run My Code? During the development cycle. 8.6 Example: Debugging RTPs.8 Running and Debugging VxWorks Applications 8. 3 once. Understanding Launch Types Launch configurations can be of different types or modes. For example. You then initiate a launch based on a launch configuration using a specific launch type. to execute the launch on multiple targets. The standard modes are Run. Running kernel tasks and real-time processes are similar procedures. and automatically attaches the Wind River debugger.3 How Do I Create a Launch Configuration? This section provides instructions for the following tasks: Creating a Launch Configuration For an Existing Project. the launch is executed on both targets. Creating a Launch Configuration From a Target Connection. NOTE: Some launch types may only be available in one mode. Each has its own type of launch configuration. Debug-mode—connects to the target. and download launch mode. 8. 3. For example. though launches may be initiated other ways as well. Using a Multiple Launch Context You can select multiple contexts within a launch configuration. The mode defines the work that is done. launches a task or process. but there are only a few options and settings that differ between the two. or press a keyboard shortcut. Run-mode—connects to the target. the information on the Launch Context tab is for review only. Also. debug. and Download. while other may have multiple launch types. 110 . Debug. Then you just click the Run or Debug icon on the Workbench toolbar. A launch may be initiated by the Run or Debug icons in Workbench. a DKM launch type is available in run. Attaching to Running Tasks or Processes. specifying the appropriate attribute values. and cannot be changed. then launches a task or process. For Linux it is possible to transfer files in both directions. Download-mode—connects to the target and downloads a module. This launch type is available for VxWorks kernel tasks and Linux application processes. Attach Target Context launch configurations are different from the other launch configurations in that they do not actually run a program. if you select vxsim0 and vxsim1 for a DKM launch configuration.Wind River Workbench By Example. but just connect a target and attach the debugger to some context that must already exist. You create a launch configuration based on a launch type. Creating a Launch Configuration Using the Run Menu. This is because it reflects information about an actual running process. 111 . To edit them. For details on how to do this. press the help key for your host. At the top of the wizard. Configure the settings on the Launch Context tab. see Wind River Workbench User’s Guide: Debugging Projects. For details on each field. select one of the following: Run | Debug VxWorks Real-Time Process | Download VxWorks Real-Time Process. d. You do not need to adjust these settings. then select the Run or Debug command from the context menu. a. and the most recently active target connection. specify an Entry Point for a kernel task. b. In the General section. or specify multiple targets for the launch. 4. If you want any others to be built as well. the project you selected appears by default. None of the other fields are editable unless your target connection is active. and verify the Exec Path on Host for an RTP application. Verify that Workbench selected the correct target connection. b. For RTP applications. do the following: 1. select one of the following: Run | Debug | Download VxWorks Kernel Task. activate the target connect you want to use. On the Projects to Build tab. right-click the project folder and from the context menu. c. Give the launch configuration a name. (Optional) Configure the settings on the following tabs. select the appropriate command for your project type: For DKMs. You can change this name to anything you want. a Debug section appears: For a kernel task—specify whether it should break on entry and if Workbench should automatically attach spawned kernel tasks. Since kernel tasks also require you to specify an entry point. in the following way: a. for example helloworld. click Close to close the wizard. For an RTP application—specify where it should break. then right-click your project and reopen the launch configuration wizard.3 How Do I Create a Launch Configuration? Creating a Launch Configuration For an Existing Project This is the easiest way to create a launch configuration for your project.8 Running and Debugging VxWorks Applications 8. select a project. the Name field reflects the information Workbench knows about your project: the executable name.vxsim0. If this is a debug mode launch configuration.vxe . you select a project in the Project Explorer. configure the source lookup path for your program. In this task. 2. 3. unless the defaults are not optimum for your project. click Add and select them from the dialog. In the Project Explorer. The Launch Configuration wizard opens to display configuration tabs for the type of launch you are creating. On the Source tab. To create a launch configuration for an existing project. a kernel task launch configuration name will include noEntryPoint until you specify one. starting with step 2. Select VxWorks Kernel Task or VxWorks Real-Time Process. for example. then select the Run or Debug command. Creating a Launch Configuration Using the Run Menu The Workbench toolbar Run menu is another way to access the launch configuration wizard. p. and run configurations dialog box appears. Do one of the following: To run your launch configuration now. do the following: 1.111.3 c. then VxWorks Kernel Task or VxWorks Real-Time Process. To create a launch configuration from a target connection. Select Run > Run Configurations or Run > Debug Configurations. click Apply. do the following: 1. you select a target connection. specify whether this launch configuration should always appear in the Run. click Run or Debug. manage. If you are creating a kernel task launch configuration. If it should be shared. to change the target. Right-click a target connection. To save your configured launch configuration and run it later. Copy the configuration and then edit it (thereby preserving the original). you should see a Downloads tab. Click Add to include additional build targets. then click New (or double-click the launch type). type in the path or click Browse and navigate to the location where you want to store the launch configuration. Also on this tab. d. 112 . On the Common tab. 3. If Workbench finds an existing launch configuration whose settings match your selection. a dialog appears prompting you to select an action: Use the selected launch configuration. you select one of the Run or Debug commands from the Workbench Run menu. or shared with your team. 2. Creating a Launch Configuration From a Target Connection You can create a launch configuration based on a specific target connection in the Remote Systems view. The build target of the project you chose appears automatically. specify whether this launch should be available to you. then select Run or Debug. In this task. Edit the configuration. Debug (or for a kernel task. 2. 3. The Create. then Close.Wind River Workbench By Example. e. In this task. 5. Download) Favorites menu. Continue with the steps outlined in Creating a Launch Configuration For an Existing Project. To create a launch configuration using the Run menu. This tab displays a list of the build targets Workbench should download when you run this launch. then select Debug > Attach to name (this only works in debug mode).111. 4. or create a new launch configuration. then click Run or Debug. p.8 Running and Debugging VxWorks Applications 8. The debugger attaches to the task or process. select it. 3. Attaching to Running Tasks or Processes Attach Target Context launch configurations are created automatically when you attach the debugger to a process or kernel task in the Remote Systems view. Enter information that is appropriate for your program. To attach to a running process or kernel task. 4. find the task or process that you want to attach to. which appears in the Debug view. as described in Creating a Launch Configuration For an Existing Project. right-click it. and the following happens: The launch configuration starts immediately. Click OK. you can edit it in the launch configuration wizard as described in Creating a Launch Configuration For an Existing Project. The launch configuration wizard appears. In this task. you right-click a running task or process in the Remote Systems view. You can rename it by typing a new name in the Name field and clicking Apply. if you chose to use a selected launch configuration. The dialog displays one or more matching launch configurations. 8. Inside one of these nodes. 3. How to Run an Application After you have created a launch configuration. If one of them meets your needs. Select Debug > Attach to name (Task Mode). p. and includes a walk through example and troubleshooting information. 5. 2.4 Running Your Applications This section covers the numerous ways in which you can run your applications. After you Attach to Target launch. do the following: 1.111. and an Attach Target Context launch configuration appears in the launch configuration wizard under Debug Configurations. and you can add it to your Favorites menu using the Common tab. copy and edit. you can run your program in the following ways: 113 .4 Running Your Applications Create a new launch configuration. if you chose to edit. Expand your target connection down to Kernel Tasks or Real-Time Processes. Select Run to launch your program.5 Debugging Your Applications. Running a Program Example In this task. From the Workbench toolbar Run menu—by selecting Run > Run Last Launched (also available as CTRL+F11) or Run > Debug Last Launched (also available as F11). A red S over the output file icon indicates that symbol information was downloaded to the debugger. Individual tasks associated with DKMs appear under Kernel Tasks. (Optional) You can match module paths with symbol information by selecting the Create path mappings for the module based on the selected symbol file check box in the Load Symbols dialog. do the following: 1. 114 .3 From the Project Explorer—by expanding a project’s Wind River Launches node. 2. Running a Program Through Debug You can select Debug to launch your program. and press the help key for your host. To run your program. To rerun a program that was used earlier. then right-clicking a launch configuration and selecting Run or Debug. you can open the Debug view. right-clicking a launch configuration and selecting Run or Debug. see 8. right-click the module and select Load/Add Symbols to Debug Server to load the symbols from an alternate location. the debugger attaches to the task or process that then appears in the Debug view. and in addition to loading the output file or executable into target memory and downloading symbol information. you run your program andWorkbench loads the output file or executable into target memory. then expanding the type of launch configuration. Or. 3. This task assumes that you have created a launch configuration. To open the launch configuration wizard itself. Tasks associated with RTP applications appear under Real-time Processes. choose from a list of recently run launches by selecting Run > Run History or Run > Debug History. 3. For more information about debugging your programs. p. The prname and host location appear below your target connection in the Remote Systems view. Troubleshooting Execution of RTP Applications You may get an S_rtp_INVALID_FILE error when trying to execute an RTP application. click in it.Wind River Workbench By Example. select Run > Run Configurations or Run > Debug Configurations. From the Remote Systems view—by expanding a target connection’s Wind River Launches node.115. If Workbench found no symbol information. You can step through your code. Right-click the project in the Project Explorer. You may want to debug a particular task while the system and other tasks continue to execute.5 Debugging Your Applications Workbench debugger provides various types of breakpoints that allow you to stop your code at particular points or when certain conditions are met.38 Defined and established a target connection based on that kernel image.32.4 Defining a New Target Server Connection. The path to the executable file must be valid from the point of view of the VxWorks target itself. p. If you did not. To enable the WDB Target Agent. or you may want to stop the entire system when a breakpoint is hit. or when it cannot find the executable using the indicated path. as described in 7. unless you are working with a simulated target. Selected Debug mode when creating your source code projects.37).vxe 8. not from the host running Workbench. you must have completed the following tasks: Built a VxWorks kernel image that includes the WDB agent (as described in 4.5 Debugging Your Applications Workbench generates this error when the path and name of the RTP executable are not provided. RTP executable files are accessed and loaded from the VxWorks target.99). and select Properties. Select the Debug mode check box at the bottom of the Build Support and Specs tab. Before You Begin to Debug Before you can debug your code. as shown in the following example: $ host:d:/my. you can do the following: a. enable the WDB Target Agent in the Kernel Configuration Editor.1 Configuring VxWorks Using the Kernel Configuration Editor. see 4. The debugger can operate in user mode or system mode. and dynamic printf event points help you to see what the code is doing at specific locations. p.3 Creating a Custom VxWorks Image. Unlike with DKMs. see 4.4 Configuring VxWorks. then Build Properties. b. Specifying the correct path may involve including the proper device name in front of the path. NOTE: The WDB Target Agent is disabled by default. see the Wind River Workbench User’s Guide. If you are working with an existing VIP. Made the source code you want to debug accessible to Workbench. 115 . For more information on these features.4. p. p.8 Running and Debugging VxWorks Applications 8. Manually attach the debugger to a task or process. 116 . as described in Creating a Launch Configuration For an Existing Project. Task 1: Relaunch the VxWorks simulator.111. Source lookup path mappings are the mapping of source file paths retrieved from the executable’s symbol data to the correct location of the source files on the host file system. you debug one of the RTP applications and the shared library to ensure they are functioning properly by completing the following tasks: Task 1: Relaunch the VxWorks simulator. Task 4: Disconnect the VxWorks simulator. Shared Libraries.102. then you need to set the host-to-target object path mappings. you can go directly to Task 2: Create a launch configuration for your application.12 Example: Working with RTPs. then you need to set host-to-target source path mappings. and Plug-ins This example is based on the project you worked with in the 6. and configured your applications to call the library either as a shared library at run time or as a plug-in when needed by the application. p. Task 2: Create a launch configuration for your application. Attaching the Workbench Debugger To debug your code using Workbench.6 Example: Debugging RTPs.3 If you moved the module or kernel from its original compilation path. p. Object path mappings describe the relationship between the location of executables and symbol files on the target file system and their location on the host file system. Task 3: Launch and debug your application. 3. you relaunch the VxWorks simulator. see Task 5: Configure object path mappings. p. If the VxWorks simulator window you used earlier is still running. In this example. or continue with deployment. p. as described in Attaching to Running Tasks or Processes.Wind River Workbench By Example. you complete the debugging phase of that project in which you created two RTP applications and a library. You can attach the debugger to your code in the following ways: Create and run a debug mode launch configuration. In this example.. For more information. and Plug-Ins. you must first attach the debugger to your code. In this task.85. If you moved the source code for the module or kernel from its original compilation path. so the debugger can find the files in their new locations.113. Shared Libraries. 8. do the following: 1.x: host:installDir/workspace/barLib/SIMPENTIUMdiab_RTP/barLib/Debug. In this task. Click OK twice to save the new setting. click the green Play icon in the Debug view. 3. In the Edit Environment dialog click Add. and fooRtpApp. Remember that you can run more than one VxWorks simulator connection at a time. Click Debug to launch your application. do the following: 1. In this task. with the blue program counter at the first executable line of code. right-click the build target fooRtpApp (fooRtpApp. or continue with deployment. you create a launch configuration for your application. When you launch your application for debugging. To create a launch configuration. 4. and the following output appears in the Console view. using the corresponding icons on the Debug view toolbar: Step Into Step Over Step Return 3. The process finishes.host:installDir/vx works-6.6 Example: Debugging RTPs. For this reason. then click Debug VxWorks Real Time Process. and Plug-ins To relaunch the VxWorks simulator. The process launches on the target. Perform basic debugging operations such as the following. under General. Task 3: Launch and debug your application. 2.x/target/usr/root/SIMPENTIUMdiab/bin 5.8 Running and Debugging VxWorks Applications 8. do the following: Select the simulator in the Remote Systems view and click Connect. and in the Name field type LD_LIBRARY_PATH. I am main() in fooRtpApp I am bar() in barLib I fooRtpApp just called bar() in barLib Task 4: Disconnect the VxWorks simulator. you can disconnect the VxWorks simulator.vxe). To launch and debug an application. substituting the correct path for installDir and the correct version for 6. several things happen. click the Edit button next to the Environment field. On the Launch Context tab. Task 2: Create a launch configuration for your application. To run process to its end. or continue with the deployment process. the debugger attaches to it and it appears in the Debug view. Shared Libraries. The Debug Congfigurations dialog appears. 117 . In the Project Explorer. type the same path you used earlier to launch your RTP. 2. always verify the number after vxsim in the title bar of the VxWorks simulator window.c opens for debugging in the editor. you launch and debug your application. In the Value field. In this task. select Window > Show View > Kernel Objects. as well as a guide to the icons and their meanings. Click Disconnect ‘vxsim#’ on the Remote Systems toolbar.Wind River Workbench By Example. and other resources. real-time processes. In the Device Debug perspective. NOTE: Be aware that when you open a view using Show View. semaphores. you learn how to open the Kernel Objects view and view selected resources. For example. For more information about the Kernel Objects view.7 Monitoring Semaphores During Debugging During multi-process debugging. p. do the following: Follow the instructions described in 9. 2. do one of the following: Close the vxsim# window. message queues. click the Kernel Objects tab to bring it to the foreground. Connect to your target in the Remote Systems view. in one of the following ways: In the Advanced Device Development perspective. In this section. you can monitor multiple data structures such as kernel tasks. Or you can set an RTP that uses a system resource to watch that resource during Step Over system calls. Click the pull-down arrow (at the far right of the tool bar) and select your target connection.4 Example: Bundling RTPs and Libraries with a VxWorks Image. 118 . 3. Open the Kernel Objects view. Connecting to VxWorks Targets. To open the Kernel Objects view and view selected resources. To continue with deploying your application. 8. do the following: 1. you can monitor a semaphore used to control a device that two processes are using.3 To disconnect the VxWorks simulator. 3. it may appear in a different location from where it usually appears in another perspective. You can move it if you like by clicking its name tab and dragging it to your preferred location. open the view and press the help key for your host.128. as described in 7. click the plus sign to expand the entries in the tree. To see specific instances of a type of resource.7 Monitoring Semaphores During Debugging The Kernel Objects view appears.8 Running and Debugging VxWorks Applications 8. Double-click a resource to examine it in the Kernel Objects view. or to display which tasks belong to which executable. System resources are displayed in a hierarchical tree. 119 . 5. 4. Properties and their current values are displayed in the Properties view. Wind River Workbench By Example. 3.3 120 . ....................PA R T V Deploying Applications 9 Deploying VxWorks Systems ....... 123 121 ........................ Wind River Workbench By Example.3 122 . 3. or the target accesses the application on disk or on a host.1 Introduction This chapter presents the different ways you can deploy your applications. For more in-depth information about this topic. see the following documents: VxWorks Application Programmer’s Guide: RTP Applications VxWorks Kernel Programmer’s Guide: Kernel Applications 9.2 Reconfiguring VxWorks for Deployment 123 9. For example. or if you need to bundle the applications and libraries into a ROMFS inside your kernel image. You should reconfigure VxWorks before you deploy your application if the required functionality for the deployed system is different from that needed during development. You can begin planning for deployment after you have completed your development work and are satisfied that your code runs on the intended target and functions as you intended.1 Introduction 123 9.9 Deploying VxWorks Systems 9. you can remove WDB agent functionality from the image. A quick 123 .2 Reconfiguring VxWorks for Deployment The tasks in this section show you how to reconfigure VxWorks for deployment.3 Adding Kernel Applications to a VxWorks Image 125 9.4 Example: Bundling RTPs and Libraries with a VxWorks Image 128 9. How you deploy an application depends on whether there is a file system on the target. if Workbench tools do not have to communicate with the image once it is deployed. This process is described in Excluding Components from a Kernel Image. then base a VIP on your configured VSB. Select WDB agent components. then in the Pattern field. then select Find from the context menu. To complete the configuration. as well as all the supporting code from other components. p. Right-click in the Component Configuration pane.3 way to do this is to exclude the WDB components from your VIP using the Kernel Configuration Editor. and displays them.Wind River Workbench By Example. is to reduce the footprint of the application. Expand your VIP project. click Finish. Right-click WDB agent components. and is included here for convenience. Resource-constrained or performance-driven systems may require that you exclude unnecessary VxWorks functionality. 2. The dialog displays a list of matching entries. use the Kernel Configuration Editor to exclude the WDB components from your kernel image. then double-click the Kernel Configuration node to open the Kernel Configuration Editor. it is enabled on UDP port 17185. but it is no longer bold. The Component Configuration tree displays it in context. 4. 7. 3. then click Find. ! CAUTION: When VxWorks is configured with the WDB target agent. The System Viewer adds to the overall footprint of a kernel image. 3. This means that the components are installed and available. and the semaphore and other support for System Viewer increase the kernel size as well. 124 . This service provides full access to VxWorks memory. exclude the functionality. see Excluding Components from a Kernel Image. Workbench determines if there are any dependent components that must also be excluded along with the WDB components. Wind River recommends removing WDB from VxWorks for production systems. To exclude WDB agent services from a VIP. To exclude components across several components. then select Exclude. select Description. 6. To disable the WDB Target Agent. do the following: 1. The Kernel Configuration Editor shows the WDB agent components. Click Next.40. 5. The Exclude dialog displays all the WDB-related components that will be excluded from the kernel image. An example of this is System Viewer instrumentation. p. Another reason to reconfigure before deployment. Excluding Components Using the Kernel Editor In this task. type WDB. you exclude WDB agent services from a VIP using the Kernel Configuration Editor. you should create a VSB project. In the Find dialog’s Find Scope pane. and allows for writing to memory as well as for calling routines.40. or click the Build Projects icon on the toolbar. To exclude System Viewer components from a project. When you build a VIP with application subprojects. then selecting Build Project.9 Example: Customizing VxWorks Libraries as a Base For a VIP. In the Project Explorer.3 Adding Kernel Applications to a VxWorks Image but not included in your kernel image. The component appears in the Option pane. The change will be saved automatically when your project is built. Press CTRL+S to save your changes.50. you learn how to add an application to a VxWorks Image project (VIP) so that VxWorks starts the application automatically. Double-click your VSB. 4. If the project builds successfully.3 Adding Kernel Applications to a VxWorks Image In this section. typing an S displays Enable System Viewer Instrumentation Support. right-click Enable System Viewer Instrumentation Support and select Change value. There is also an overlay icon that indicates that the component has changed. Type a letter or two of the option’s name into the Pattern field. and is included here for convenience. 5. 125 . using wildcard characters if necessary. Build Finished in Project ‘project_name’ appears in the Build Console. The WDB components are excluded from the resulting VxWorks kernel image.In this case. p. you exclude System Viewer agent services from your VIP using the Kernel Configuration Editor. then select Find. Select Enable System Viewer Instrumentation Support and click Find. c. Search for System Viewer components in the following way: a. right-click your project and select Build Project. b. 6. then double-click the Source Build Configuration node. it helps assure correct linking and dependency-checking. The change has not yet been saved. Scroll to the right (if necessary) and from the drop-down list select n to deactivate System Viewer support. This process is described in 4. Since you are recompiling the VxWorks libraries. 8. 3. however. do the following: 1. Build the project by right-clicking it in the Project Explorer. Excluding Components Using a VSB Project In this task. In the Option pane. or close the editor and select Yes when you are prompted to save. 9. 2.9 Deploying VxWorks Systems 9. Right-click in the Option pane. this can take awhile. 2. because they are solely source code containers. do the following: 1. Close the file. double-click userAppInit. click the check box next to the superproject that should be the parent of your application.c to open the file for editing. you configure VxWorks to support the calls your application makes to the kernel. Then. Linking object files or object codes to the VxWorks image is done differently. This enables the application to link to your image. you can make the kernel application project a subproject of a VxWorks Image project.3 Only application projects like downloadable kernel modules or user-defined projects can be linked to a VIP this way. Task 3: Configure the VxWorks kernel to support your application. Click OK to create the link. Highlighting the project is not enough. when VxWorks boots. In the usrAppInit( ) function.Wind River Workbench By Example. you add the application routines to the VIP. Right-click the project that you want to make into a subproject and choose Project References > Add as Project Reference. Later. 3. populated them with code. 3. do the following: 1. To add application initialization routines to the VIP. In this task. In the dialog. The application project appears under the VIP in the Project Explorer. In this task. In this task. Task 1: Link the application projects to the VIP. To link applications to the VIP. 3. and successfully built the projects. Task 2: Add the application initialization routines to the VIP. Task 3: Configure the VxWorks kernel to support your application. by editing the Makefile and setting the EXTRA_MODULE or LIBS macros. NOTE: If your BSP provides a “bare-bones” VxWorks configuration. add the necessary calls to start your application. Task 4: Build the VIP. To add kernel application initialization calls to VxWorks. Before You Begin You must have created kernel application projects. Task 2: Add the application initialization routines to the VIP. you may want to use the Kernel Configuration Editor Autoscale facility to detect and add most of the VxWorks functionality you require. 126 . 2. This example includes the following tasks: Task 1: Link the application projects to the VIP. it initializes all operating system components (as needed) and passes control to the application for initialization. you establish the links between your applications and the VIP. and select Yes when prompted to save the changes. do the following: 1. For more information about Autoscale and the Kernel Configuration Editor. Task 4: Build the VIP. Some of the listed components may still be needed by your application. 2.9 Deploying VxWorks Systems 9. 5. you need to repeat Task 3: Configure the VxWorks kernel to support your application. click the check box next to them. Workbench automatically saves the changes you made in the Kernel Configuration Editor. then select Autoscale. Autoscale removes the selected components.3 Adding Kernel Applications to a VxWorks Image To configure VxWorks to support your application. do the following: In the Project Explorer. Autoscale is not infallible. click Select All. then builds your project. or it may have suggested that you remove a component that you actually need. you build the VIP you configured in this example so it links to and launches your applications There may be some components that Autoscale did not detect. 127 . right-click the VIP and deselect Build Project. and shows you the components that do not seem to be required by your application. Click OK. Do one of the following. 6. To accept Autoscale’s judgement that all are unneeded. Be careful when you elect the components to remove. You can then add the necessary additional components from the Kernel Configuration Editor. To build the VIP for this example. open the editor and press the help key for your host. build. maps them to components. click the check box next to the component. To include all of the components. and get link errors. In this task. Right-click in the Component Configuration pane. and returns to the Component Configuration pane. Autoscale next analyzes your code. Do one of the following. and shows you those components. analyzes the symbols in your object modules. 4. Double-click the VIP to expand it. Double-click the Kernel Configuration node to open the Kernel Configuration Editor. Click Yes to continue. To exclude any of those components. click Select All. Autoscale compiles your code. 3. and then click OK: To include specific components. If you Autoscale. Add the application initialization routines. Create a VxWorks ROMFS File System project. Here are the steps you will follow: 1. or as a plug-in when needed by the application. verify that the build tool is set to Linker and the active build spec is one of the following: SIMPENTIUMdiab_RTP for Windows and Linux SIMSPARCSOLARISdiab_RTP for Solaris 3.4 Example: Bundling RTPs and Libraries with a VxWorks Image In this example. You must also add initialization code. Rebuild your RTP applications. verify that Create a dynamic executable is selected. and then click OK. you bundle RTPs and Libraries with a VxWorks image. then select Properties.vxe). 8. to complete the deployment phase that follows the 6. You must do this for both applications. In the Build Properties dialog. 7. 10. 128 . Then. Rebuild your VxWorks image project Restart the VxWorks simulator and view ROMFS contents. Click Tool Flags. p. Change fooPlugRtpApp to reference ROMFS instead of the workspace.Wind River Workbench By Example. 3. because the application that uses the library as a plug-in also needs to be able to find libc. and Plug-Ins. Set the target-side run path for an application. 6. Launch the RTP applications and disconnect the VxWorks simulator. do the following: 1. you created two RTP applications and a library. select the Build Tools tab to bring it forward. 2. Verify that your application launches automatically. Shared Libraries. In this final phase. so VxWorks can start your applications automatically.3 9. 9. 2.85. In this task. Step 1: Set the target-side run path for an application. you create a way of statically identifying the run time location of your shared library. You then ran the applications manually in the VxWorks simulator. In the prerequisite example.12 Example: Working with RTPs. Set up the ROMFS target file system. instead of typing the entire LD_LIBRARY_PATH command when you launch the applications.1. In fooRtpApp. 5. right-click the build target fooRtpApp (fooRtpApp. To set the target-side run path for an application.so. you use the -rpath compiler option to set the target-side run path for the application. 4. and then configured your applications to call the library either as a shared library at run time. 3. so". you rebuild the RTP applications to incorporate your changes. Change the dlopen call to: handle = dlopen("/romfs/lib/barLib.. In the text field next to Tool Flags.129. in one of the following ways: For the Wind River Compiler.4 Example: Bundling RTPs and Libraries with a VxWorks Image 4. you modify the application so it references ROMFS instead of the workspace.c. Click Tool Flags and verify that Create a dynamic executable is selected. you create a VxWorks ROMFS file system project that you will use to create the target file system where your applications and library will reside. To rebuild the RTP applications. d. 6. type the following command: -rpath /romfs/lib For the Wind River GNU Compiler.vxe).c to open it in the editor. double-click fooPlugRtpApp. RTLD_NOW). Append the correct -rpath compiler option to the Tool Flags command. Change fooPlugRtpApp to reference ROMFS instead of the workspace. do the following: a. e. Open the build properties for fooPlugRtpApp (fooPlugRtpApp. Right-click fooPlugRtpApp and select Rebuild Project. In this task. 5. as the deployed location for the applications and library. Step 4: Create a VxWorks ROMFS File System project. and click Yes to save your changes. Rebuild your RTP applications. In this task. Step 3: In fooPlugRtpApp. Both applications should build without errors. To change the application reference to ROMFS. c. Step 2: Click OK to save your settings. b. make sure Linker and the correct build spec are selected. Right-click fooRtpApp and select Rebuild Project. Click OK to save your settings and close the dialog. 2. 3. append the directory that will hold the shared library on your target (this is known as the run path). do the following: 1.-rpath /romfs/lib /romfs is the default root directory of the ROMFS created by the VxWorks ROMFS File System project that you will create to hold your applications and library in Step 4:Create a VxWorks ROMFS File System project.9 Deploying VxWorks Systems 9. In fooPlugRtpApp. On the Build Tools tab. do the following: 1. In this task. 2. type the following command: -Wl. p. Close fooPlugRtpApp. 129 . 1. 3. and the File System Contents editor opens. under Host contents click to highlight a folder that contains files. Add your application binaries in the following way: a. NOTE: To add a folder. 4. In the Project name field. To set up the ROMFS target file system. then type bin in the Name field. Add your shared library in the following way: a. 5. Your project appears under VIPsimpc in the Project Explorer. do the following: 1. the bin directory should contain fooPlugRtpApp. In the Host contents pane. The new directories appear in the Target contents pane. You can also drag and drop folders and files from the Host contents tree to the Target contents tree. In the Project Explorer. its contents and subfolders to the target. Click Add. Step 5: Set up the ROMFS target file system. type romfsFS. 3. and click Finish. Click New Folder. 3. b.vxe). you set up the ROMFS target file system and include your applications and library. 4. 2.vxe. Click OK. then click Add Folder recursive. c. 2. open fooPlugRtpApp and select fooPlugRtpApp (fooPlugRtpApp. In the upper left corner of the File System Contents editor. Select File > New > VxWorks ROMFS File System Project. open fooRtpApp and select fooRtpApp (fooRtpApp. In this task. Click the lib directory to select it.Wind River Workbench By Example.vxe). c. If you select something in the Target contents pane and then need to unselect it.1 With the bin directory still selected. click in the pane and press ESC.3 To create a VxWorks ROMFS file system project. In the Target contents pane. Click the bin directory to select it. b.vxe and fooRtpApp. create bin and lib directories. 130 . Click New Folder again. You cannot add empty folders to the Target contents using these techniques. in the following way: a. and click Add. do the following: 1. Click OK. then type lib in the Name field. Leave Create project in workspace selected. select VIPsimpc so the new ROMFS project will become a subproject of your VIP. click Show all projects. In the editor. vxe. Click Add.vxe 4. the lib directory should contain barLib. do the following: 1. /romfs/bin/. The VxWorks simulator window opens and displays the host shell running the boot sequence for your kernel image. b. c.vxe /romfs/bin/fooPlugRtpApp. Examine the contents of the ROMFS lib directory by running the following command: [vxWorks *]# ls "/romfs/lib" 131 . 3. Rebuild your VxWorks image project In this task. 6. Select libc.so. Build output appears in the Build Console. open barLib and select barLib (barLib.1. do the following: In the Project Editor. In the Host contents pane. right-click your VIPsimpc project. Switch the host shell from the C interpreter to the command interpreter by typing cmd. With the lib directory still selected. /romfs/bin/fooRtpApp.. The prompt changes from -> to #. Step 6: Close the File System Contents editor.x/target/usr/root/cpuTool/bin. Click Add External. 2. and select SIMPENTIUMdiab for Windows and Linux or SIMSPARCSOLARISdiab for Solaris. 7.x.so.so and libc. c.so). you restart the VxWorks simulator and check the contents of the ROMFS you created earlier. In this task. Substitute the correct path for installDir. Step 7: Restart the VxWorks simulator and view ROMFS contents. Examine the contents of the ROMFS bin directory by running the following command: [vxWorks *]# ls "/romfs/bin" In the output that appears. To rebuild the VxWorks image project. and for cpuTool. Navigate to installDir/vxworks-6. To restart the VxWorks simulator and check the ROMFS. and click Connect ‘vxsim#’. In the Remote Systems view.vxe and fooPlugRtpApp.1 and click Open.9 Deploying VxWorks Systems 9. add the VxWorks standard shared library in the following way: a. you will see fooRtpApp. In the Target contents pane. then select Rebuild Project. and click Yes to save the changes. the correct version number for 6. you rebuild the VxWorks image project to include the changes you made in this example. select the vxsim# connection you created earlier in this example. /romfs/bin/.4 Example: Bundling RTPs and Libraries with a VxWorks Image b. In this task. In the vxsim window.so Step 8: Launch the RTP applications and disconnect the VxWorks simulator.Wind River Workbench By Example.. In the usrRtpAppInit( ) function. To add application initialization routines to a VIP. Click Disconnect ‘vxsim#’ on the Remote Systems toolbar. Launch fooPlugRtpApp using the following command: rtp exec “/romfs/bin/fooPlugRtpApp..h> <stdio. To disconnect from the VxWorks simulator do one of the following: Close the vxsim# window. do the following: 1.vxe" Launching process '/romfs/bin/fooPlugRtpApp. add the following commands to start fooRtpApp. you will see both libc..vxe' (process Id = 0x11739178) launched.vxe” In the output that appears. Process '/romfs/bin/fooRtpApp. you can see that your RTP application is launched and then calls the shared library..h> <errno.h> <rtpLib.vxe' .vxe' (process Id = 0x106af1a8) launched.vxe' . In this task.vxe" Launching process '/romfs/bin/fooRtpApp.. I am main() in fooPlugRtpApp I am bar() in barLib I fooPlugRtpApp just called bar() in barLib as plug-in using dlopen() 3. you start your RTP applications and then disconnect the VxWorks simulator. /romfs/lib/libc.vxe: /* Includes #include #include #include #include */ <vxWorks.3 In the output. Double-click userRtpAppInit.so. To launch RTP applications and disconnect the VxWorks simulator.1 and barLib.1 /romfs/lib/barLib.h> /*********************************************************************** * 132 . [vxWorks *]# rtp exec "/romfs/bin/fooPlugRtpApp. Process '/romfs/bin/fooPlugRtpApp. you add the application initialization routines to the VxWorks Image project.vxe” In the output that appears. /romfs/lib/.so. do the following: 1.so. 3. 2. but as a plug-in. you can see that your RTP application is launched and then calls the shared library. Step 9: Add the application initialization routines. I am main() in fooRtpApp I am bar() in barLib I fooRtpApp just called bar() in barLib 2. launch fooRtpApp using the following command: rtp exec “/romfs/bin/fooRtpApp. /romfs/lib/.c to open the file for editing. [vxWorks *]# rtp exec "/romfs/bin/fooRtpApp. to make sure your application launches automatically.vxe (errno = %#x)". 0. No environment variables are passed */ if ((rtpId = rtpSpawn (vxeName. verify that the simulator launched fooRtpApp. /* set the application's arguments */ argv[0] = vxeName. 220. you restart the VxWorks simulator. see the following documents: VxWorks Application Programmer’s Guide: RTP Applications VxWorks Kernel Programmer’s Guide: Kernel Applications. errno). */ void usrRtpAppInit (void) { /* TODO . select the vxsim# connection you created earlier in this example. /* Spawn the RTP. Step 10: Close the file and select Yes when asked to save the changes.9 Deploying VxWorks Systems 9. argv[1] = NULL. To verify that your application launches automatically. In this task. Once the boot sequence is completed. The following output should appear: -> I am main() in fooRtpApp I am bar() in barLib I fooRtpApp just called bar() in barLib Where to Go Next For more information about deploying your kernel and RTP applications. 3. 2. RTP_ID rtpId = NULL. In the Remote Systems view. and click Connect ‘vxsim#’. 4.4 Example: Bundling RTPs and Libraries with a VxWorks Image * usrRtpAppInit . do the following: 1. The VxWorks simulator window opens and displays the host shell running the boot sequence for your kernel image. argv. 0)) == NULL) { printErr ("Impossible to start fooRtpApp. Right-click the VIP and select Rebuild Project. 0x10000. char * argv[2].add your own application launch code here */ char * vxeName = "/romfs/bin/fooRtpApp. 133 .initialize the users RTP applications. Verify that your application launches automatically. NULL.vxe. } } 3.vxe". Wind River Workbench By Example.3 134 . 3. ...PA R T VI Reference A B C What Are All These Project Files For? ......... 151 Glossary .............5 Target .......................................... 137 Debugging a VxWorks 5............................................................. 159 135 ..................................... 3 136 . 3.Wind River Workbench By Example. 6 Project Files in Real-Time Process Projects 146 A. This chapter explains the function of each of these files. Filtering the display can be useful. If you should archive them with your sources If the file is generated each time the project is built. do the following: 1. and select Customize View.5 Project Files in Downloadable Kernel Module Projects 144 A. 137 .1 Introduction 137 A.1 Introduction As soon as you create a new project.7 Project Files in Boot Loader/BSP Projects 148 A.8 Project Files in Shared Library Projects 149 A.A What Are All These Project Files For? A.2 Files Common to Many Project Types 138 A. To filter your project display. before you add any files or subprojects of your own. Click the downward arrow in the upper right corner of the view. you will notice that the project contains quite a few project specific files. Filtering Your Display If you applied filters to the Project Explorer display. you may not see some of these files in your project. because it helps you focus on the files that are important to your project.3 Project Files in VxWorks Image Projects 139 A.4 Project Files in VxWorks Source Build Projects 142 A. as well as other information such as the following: Whether you can add your own code to them. 3. and platform association. . The selected file types are filtered out of the display. Eclipse and Wind River Workbench are unable to identify projects. they appear here for easy access and reuse.wrmakefile This file is a template that Workbench uses to generate the project’s Makefile. Without it.project This is an Eclipse platform project file that contains builder information and project nature. Select or clear the check boxes for particular types of files. and User-Defined projects.Wind River Workbench By Example. You can add your own build targets and make rules to this file. This section gives you an idea what these files are used for. except for VxWorks Image. . though they are still part of your project. Wind River Launches When you create launch configurations for your project. A. . Binaries Provides easy access to the project’s binaries. VxWorks Source Build. You can see them if you look in the project’s directory in your workspace. project type specification.3 2.cproject CDT project file containing CDT-specific information about the project. Container Nodes Within Your Project Build Targets Workbench creates build targets for most projects.wrproject This file contains common Workbench project properties such as build properties. and they will be automatically dumped into the Makefile. . Includes Shows the project’s include files. 138 .2 Files Common to Many Project Types Some project files appear in almost all Workbench projects. To find out more about the files that are generated when you build the project. see Files That Appear After the Project is Built.2 Files Common to Many Project Types. p.3 Project Files in VxWorks Image Projects Workbench creates the largest number of project files for VIPs. so do not add custom code to this file (add it to .A What Are All These Project Files For? A. 139 . see A. This VIP is based on the wrSbcPowerQuiccII BSP and includes support for the BSP Validation Test Suite. Figure A-1 VIP Just After it is Created For the files that are common to most projects.3 Project Files in VxWorks Image Projects Files That Appear After You Build the Project Makefile This file is regenerated each time the project is built.wrmakefile instead). A. The sections below describe what role each file plays. p. The information that Workbench uses to generate this file is taken from the build spec you selected when creating the project.138.141. Below are the files that are specific to VIPs. 4 Configuring VxWorks. To switch the build target type.bin or .37.bin (default) vxWorks. To create a . It is dynamically generated. BSP node This node links in BSP files used by the VIP. prjConfig. Kernel Configuration Double-clicking this node opens the Kernel Configuration Editor. vxWorks (default) vxWorks. VIP build targets take the form vxWorks[type]. select a new active build spec by right-clicking the build target. It is dynamically generated. It is dynamically generated. then selecting Build Options > Set Active Build Spec and selecting the type you want. or . which you can use to configure your VxWorks image.c A configuration file that includes code from the VxWorks archive by creating references to the appropriate symbols. It is dynamically generated.h A configuration file that contains component parameters.hex build target. and format can be empty (the default ELF image). 140 .3 ProjectName The icon identifies the type of project.bin (binary output). It contains symbols for components that do not have initialization routines. prjComps.h A configuration file that contains the preprocessor definitions (macros) used to include VxWorks components. the vxWorks build target will be built using the project’s default build spec (the one you chose when creating the project). where type can be empty (the default RAM-based image). p. so do not check it in to your version control system.c A configuration file that contains initialization code for components included in the current configuration of VxWorks. linkSyms. or _romResident. so do not check it in to your version control system. _romCompress. See 4.Wind River Workbench By Example. They are available for browsing purposes only. prjParams.hex (default) When you build your project.[format]. . so do not check this file in to your version control system. 3. you must build it explicitly by right-clicking it and selecting Build Target. so do not check it in to your version control system.hex (Motorola S-Record output). _rom. Workbench uses it to generate the project’s Makefile. usrRtpAppInit. usrAppInit. 141 . creation.makefile Workbench uses this makefile fragment to invoke the scripts for the BSP Validation Test Suite.wpj This file contains information about the project.A What Are All These Project Files For? A. It includes a list of components and build parameters.makefile This template contains all necessary instructions to build the VIP.c A stub where you can add DKM application initialization routines.log Provides information related to the creation of the VIP.mk This file is called from the project’s Makefile.c Along with the BSP files. Files That Appear After the Project is Built Several new files are added to the project during the build process.3 Project Files in VxWorks Image Projects romStart. this file provides the other half of the sources used by the VIP. as well as project source files such as prjConfig. It is linked in for browsing purposes only. and connects the Workbench project to the VxWorks build system. vxWorks. bspvts.c. projectName. Makefile.c A stub where you can add RTP application initialization routines. Workbench invokes it from the project’s Makefile. Do not edit this file. A.4 Project Files in VxWorks Source Build Projects Workbench also creates a large number of project files for VSBs.lst This is generated by the run-time build system during the build.3 Figure A-2 VIP After it is Built default This is the build output folder. prjObjs. named after the selected build spec. 142 . 3.Wind River Workbench By Example. and has VxWorks sources linked in.lst This is generated by the run-time build system during the build. and lists the object files linked into the kernel image. compObjs. The sections below describe what role each file plays. This VSB is based on the MIPSI64R2 CPU. A What Are All These Project Files For? A. h This directory contains the header files and other files that are generated during the configuration of the VSB. and interfaces that are used in conjunction with VIPs and DKMs.config This file is one of the files generated from the Source Build Configuration editor when changes are saved. ProjectName The icon identifies the type of project. which you can use to configure your VxWorks libraries. Sources If you linked in the VxWorks sources when creating your project. To find out more about the files that are generated when you build the project.vxconfig vsb.x/target/h and installDir/vxworks-6. vsb_bs.log Provides information related to the creation of the VSB. vsb.138. p.4 Project Files in VxWorks Source Build Projects Figure A-3 VSB Just After it is Created For the files that are common to most projects. creation. this node provides access to the installDir/vxworks-6. They contain the configuration information for the VSB used for builds. p.141.7 Creating a VxWorks Source Build Project.vxconfig These files are used as inputs to the Source Build Configuration editor.2 Files Common to Many Project Types.47.x/target/src directories. 143 . Source Build Configuration Double-clicking this node opens the VxWorks Source Build Configuration Editor. Below are the files that are specific to VSBs. see A. see Files That Appear After the Project is Built. See 4. p. tcl These are internal files used with the vxprj and Workbench interface to display and manipulate the settings of VSBs. 3. 144 .5 Project Files in Downloadable Kernel Module Projects Workbench creates a smaller set of files for DKMs than it does for VIPs.tcl vsbdefs.mk vsb_defs. objarchitectureBuildspectest This folder contains test related object files (they are not part of any existing archive).mk These make fragments are used for building the VSB. in other words the kernel libraries that contain the configuration information for the VSB.3 vsb_comp_list. A. Figure A-4 VSB After it is Built Archives Folder This folder contains the generated archive files for the project. Files That Appear After the Project is Built Several new files are added to the project during the build process. you will notice the source files from the sample program ball. architecture This folder contains the binary output of the build. In addition to the project files.Wind River Workbench By Example. vsbClean. You cannot build a DKM project that does not contain sources. Files That Appear After the Project is Built Several new files are added to the project during the build process. see A.debug]) This partially linked and munched object. is intended for downloading. TargetName.A What Are All These Project Files For? A. ProjectName The icon identifies the type of project. is for subproject support only. TargetName_partialImage. The lack of an upward arrow indicates that it is not passed to the next level. p. 145 . produced by the Linker.out (BuildSpec [. produced by the Linker build tool.o This partially linked but not munched object. The upward arrow indicates that the build target is passed to the next level.5 Project Files in Downloadable Kernel Module Projects Figure A-5 DKM Just After it is Created For the files that are common to most projects. To find out more about the files that are generated when you build the project.2 Files Common to Many Project Types. it is not intended for download.145. Below are the files that are specific to DKMs.138. see Files That Appear After the Project is Built. p. In addition to the project files.6 Project Files in Real-Time Process Projects Workbench creates a similar set of files for RTPs as it does for DKMs.debug]) This archive.Wind River Workbench By Example. A.out target (produced by the Linker).a archive target (produced by the Librarian) and a *. For example. 3. it contains the generated archive file for the project. You cannot build an RTP project that does not contain sources. 146 . produced by the Librarian build tool. has to be statically linked into an executable.3 Figure A-6 DKM After it is Built When building DKM projects. Archives Folder This folder appears when you build using the Librarian. the generated files that appear are determined by the build tool you chose. whether you see an upward arrow on your build target depends on whether you chose to pass the build target up the hierarchy or not.a (BuildSpec [. TargetName. In addition. Build Output All build output is directed to this folder. you will not get both a *. you will notice the source file from the sample program helloworld. A What Are All These Project Files For? A. see A.vxe (BuildSpec [. Below are the files that are specific to RTPs. the generated files that appear are determined by the build tool you chose. whether you see an upward arrow on your build target depends on whether you chose to pass the build target up the hierarchy or not. Files That Appear After the Project is Built Several new files are added to the project during the build process.6 Project Files in Real-Time Process Projects Figure A-7 RTP Just After it is Created For the files that are common to most projects. p. ProjectName The icon identifies the type of project.a archive target (produced by the Librarian) and a *.2 Files Common to Many Project Types.138. In addition.147. Figure A-8 RTP After it is Built When building RTP projects. TargetName. you will not get both a *. To find out more about the files that are generated when you build the project. see Files That Appear After the Project is Built. For example. p.debug]) This is a fully linked VxWorks executable.out target (produced by the Linker). 147 . 2 Files Common to Many Project Types. p. as well as the currently active build spec. produced by the Librarian build tool.7 Project Files in Boot Loader/BSP Projects Workbench creates only a few files to support this type of project. A. see Files That Appear After the Project is Built. p. BSPname (bootloader) This node reflects the BSP you used when creating the project.3 Build Output All build output is directed to this folder. TargetName. it contains the generated archive file for the project. 3. Below are the files that are specific to boot loader and BSP projects.debug]) This archive.149. has to be statically linked into an executable.138. ProjectName The icon identifies the type of project.Wind River Workbench By Example. TargetName. 148 . Figure A-9 VxWorks Boot Loader/BSP Project Just After it is Created For the files that are common to most projects.debug]) This is a fully linked VxWorks executable. To find out more about the files that are generated when you build the project.a (BuildSpec [. see A.vxe (BuildSpec [. Archives Folder This folder appears when you build using the Librarian. p.8 Project Files in Shared Library Projects Workbench creates a similar set of files for Shared Libraries as it does for RTPs. Below are the files that are specific to shared libraries. To find out more about the files that are generated when you build the project.so The shared library used by the VxWorks executable. this contains a standalone copy of the BSP sources (in installDir/workspace/project_name/BSP_name). ProjectName The icon identifies the type of project.2 Files Common to Many Project Types. p. BSP node If you did not select Copy files to project. Files That Appear After the Project is Built Since BSPs are prebuilt and installed with your Platform. see Files That Appear After the Project is Built. Only one new file is created during a build of this type of project. You may modify and build these sources without altering the VxWorks install tree.149.8 Project Files in Shared Library Projects BSP node If you selected Copy files to project. Files That Appear After the Project is Built Several new files are added to the project during the build process.A What Are All These Project Files For? A. this folder will display an upward arrow overlay. Figure A-10 Shared Library Just After it is Created For the files that are common to most projects. A.138. you will not notice much difference when building this sort of project. see A. 149 . and will reference the original BSP sources (in installDir/vxworks-6. TargetName.x/target/config/BSP_name). Build Output All build output is directed to this folder.3 Figure A-11 Shared Library After it is Built Whether you see an upward arrow on your build target depends on whether you chose to pass the build target up the hierarchy or not.Wind River Workbench By Example. 150 . 3. 2 Before You Begin To use these instructions.B Debugging a VxWorks 5. you set an environment variable.x Target Server Connection 153 B.x target.6 Using Existing Tornado 2.5.x image in Tornado before you can work with it in Workbench.4 Creating a VxWorks 5.x registry service (or process) before working with this tutorial.1 Introduction This tutorial explains how to use Workbench to create a Tornado 2.2.5 Launching a Kernel Task and Attaching the Debugger 153 B.properties file.x Projects 157 B. VxWorks 5.5. and Tornado 2.5.3 Creating a VxWorks 5.5 DKM Project 152 B. provide the path to your Tornado installation for Workbench.x. you must have Workbench 3.5 Target B. 151 . B.2.1 Introduction 151 B.x.2.x target server. NOTE: You must have built your VxWorks 5.2.5.2. IMPORTANT: You must disable the Tornado 2.2 Before You Begin 151 B. and then run a script to update your install.x target server connection and debug a VxWorks 5. Workbench automatically launches a registry that can communicate with the Tornado 2. In the following task.x installed. selecting Preferences. 3. then selecting Show line numbers. select Debug mode. From the dialog that appears. Open a command shell window.5 DKM Project In this example. The line number and column position of the cursor is displayed at the bottom of the window. Double-click the error symbol to open cobble. or if it is not open. then select VxWorks 5.2/x86-win32/bin/wrregistert22x. do the following 1.3 Creating a VxWorks 5. or press CTRL+B. Edit line 133 and change the priority of task tCrunch to 210.2 workbench-3. it will appear that breakpoints are not hit. Switch to the Advanced Device Development perspective. or you can scroll up or down and click in the file. The Build Console displays a warning about a bug in the code. and click OK. 2. change the active build spec to PPC603diab. select Window > Open Perspective > Advanced Device Development. and then rebuild the project. When the script asks for the location of your Tornado installation. The project appears in the Project Explorer.5 Downloadable Kernel Module Sample Project and click Next.c to line 280.1 1. 7. Right-click the new cobble_55 project.3 To allow Workbench to find your Tornado installation.5 Downloadable Kernel Module Sample Project as the basis for your project. You can display line numbers by right-clicking in the Editor. If you do not do this.bat 2.5 DKM project. Right-click the project and select Build Project. then click Finish. CTRL+P. To create and debug a VxWorks 5. then fix the bug. The script updates your install. type the path and press Enter. Select File > New > Example. and enter the following commands: wrenv -p workbench-3. navigate to the Workbench root installation directory (InstallDir/). B. Select the Cobble demo. do the following: 1. NOTE: This procedure supports only PowerPC and Pentium CPUs.Wind River Workbench By Example. then select Build Options > Set Active Build Spec. 6. 5. 3.properties file. 4. debug an error. you use the VxWorks 5. 152 . 4.x Target Server Connection. do the following: 1. From the Remote Systems view toolbar.x target server. and includes the following tasks: Configuring the Debug Launch Configuration Setting and Running to a Breakpoint Debugging in System Mode 2. click Define a connection to remote system. Click Next through the next few screens.5 Launching a Kernel Task and Attaching the Debugger This example is a continuation of Creating a VxWorks 5. Continue on with Launching a Kernel Task and Attaching the Debugger. The New Connection wizard opens. To lengthen the timeout. and click Next. B. select Window > Preferences > Target Management and increase the time in the Workbench timeout till target server must be connected field.5. Continue on with Creating a VxWorks 5.x target. Your project should build cleanly. 6. The target connection appears under the target server connection2.x Target Server Connection 8.B Debugging a VxWorks 5.4 Creating a VxWorks 5. 2.x Target Server Connection.4 Creating a VxWorks 5.5.5. select Wind River VxWorks 5. To connect to the Tornado 2. it appears under default(localhost) followed by [Target Server running].2. as well as the name of the core file.x Target Server Connection In this task.5. reviewing and customizing the target server options as necessary. From the Connection Type list. it could be caused by a long delay in checking out a license for the Tornado 2. You can click next to Kernel Tasks to display the list of kernel tasks running in the system. Once the connection to the Tornado target server is established. 5. To create a VxWorks 5. Workbench saves your changes before starting the build. Click Finish to create your connection definition.5 DKM Project. right-click the target server and select Connect. Right-click the project folder and select Rebuild Project. you create a target server connection for the project you created in Creating a VxWorks 5.2. NOTE: If you get a target server connection error.5 target server connection. 9.x Target Server Connection.5 Target B. 3. 153 . B.5. 7. Workbench also allows you to specify the stop scope: either Stop Triggering Thread. In the Remote Systems view. The Outline view does not appear by default in the Device Debug perspective. Click Browse next to the Entry Point field. Make sure Task is selected. Click the Download tab to bring it to the foreground. then click Add. You use the Debug Launch Configuration dialog to define which downloadable module to load. which debugging options to implement. and then click OK. select Downloads > cobble_55. Stop All (is not supported) behaves the same as Stop Triggering Thread. 6. In this example. and what the source lookup path should be. but as yet no entry point is defined. 5. 154 .c in the Editor (if it is not already open) with the focus in progStart. browse to the location of your project’s build target (installDir/workspace/cobble_55/PPC603diab_DEBUG/cobble_55. Right-click your target again.Wind River Workbench By Example. Workbench changes to the Device Debug perspective. and this time select Debug Kernel Task. You use the Outline view to find a function so you can place a breakpoint on it. you can specify the breakpoint’s scope: either the task that is selected in the Debug view (here. Click the Debug Options tab to bring it to the foreground. right-click your system node. Setting and Running to a Breakpoint This task is a continuation of Configuring the Debug Launch Configuration. 3. do the following: 1. Click Debug to launch the task and attach the debugger. 2. you set a breakpoint and then run to it. To configure the debug launch configuration. In this task. and then click OK. When adding a breakpoint. and then select Automatically attach spawned Kernel Tasks. and opens cobble. which entry point to call.3 Analyzing Core Dump Files Configuring the Debug Launch Configuration In this task. you modify the debug launch configuration so that the debugger is attached. The launch configuration is now complete. you do not specify this option. 4. displays the task in the Debug view. The Name field displays your project’s build target and target name.out > progStart. Make sure Load Symbols to Debug Server is selected. However. or to Stop All. then select Target Mode.out). The Debug Launch Configuration dialog appears.5. tProgStart) or every task (Unrestricted). in VxWorks 5. 3. In the Download dialog. The task tProgStart disappears from the Debug view. do the following: 1. select tProgStart in the Debug view and click Resume. the breakpoint would never have been triggered. In system mode. Right-click system tasks as needed. 2. When tCosmos hits its breakpoint. In this task.5 Launching a Kernel Task and Attaching the Debugger To set and run to a breakpoint. To debug in system mode. Several lines below crunch. so select Add Breakpoint (Scope = Unrestricted). do the following: 1. select tCosmos. 4. not tProgStart. With your breakpoint set. Scroll down to line 166 (containing nadaNichtsIdx) and right-click in the left Editor gutter and select Breakpoints to open the Breakpoints submenu. Select the task tCrunch in the Debug view to set the scope.B Debugging a VxWorks 5. 3.c. The Editor highlights the function. Open the Outline view by selecting Window > Show View > Outline. right-click your system node (which should still be running). In this example. 5. 4. then click Disconnect (not Terminate). click Resume. At the prompt. and tMonitor tasks that now appear in the Debug view and under Kernel Tasks in the Remote Systems view. In the Remote Systems view. Before switching to system mode. Debugging in System Mode This task is a continuation of the previous task. 8. 155 . type i to display the list of running tasks. right-click your target and select Attach to Kernel (System Mode). and you can get the backtrace of the tasks you have attached. 6. 6. 5. click Resume again 9 more times. and click Resume. Setting and Running to a Breakpoint. with cosmos highlighted. then select Target Mode > System to switch into system mode.5 Target B. 9. tCosmos. and then select Attach to Kernel Task (System Mode). Its only purpose was to launch the tCrunch. Return to the Debug view. Open the target console by right-clicking your target and selecting Target Tools > WTX Console. 2. the code is run by the task tCosmos. you switch to system mode and continue with debugging. highlight tCrunch and tCosmos in the Debug view. The Editor shows that section of cobble. If you clicked Disconnect (and not Terminate). then select the function crunch in the Outline view. the whole system stops. right-click in the gutter beside line 268 (beginning while) and select Breakpoints > Add Breakpoint (Scope = tCrunch). Select the function cosmos. If you had selected Scope = tProgStart. At this point the task tCrunch hits its breakpoint and both tasks stop. when a breakpoint is hit. 3. 7. In the Remote Systems view. tCosmos and tCrunch are still running. the whole system stops. 6. On the next screen. (Optional) Attach to other tasks and see their backtraces. Select monitor in the Outline view to switch the Editor display to that part of cobble. Set a breakpoint by right-clicking in the gutter next to line 302 (beginning if). 5.Wind River Workbench By Example. as shown in the Remote Systems view and in the Debug view. 9. adjusting settings if necessary. Therefore. set the breakpoint using either Scope = Unrestricted or Scope = tMonitor (you must select tMonitor in the Debug view before you can choose it as the breakpoint scope). If you select Breakpoints > Add Breakpoint (Scope = tCosmos). In the New Connection wizard. but since Workbench cannot determine the cause for a VxWorks 5. 4. Analyzing Core Dump Files This task is a continuation of Debugging in System Mode. On the Remote Systems view toolbar. The backtrace of the current execution context appears. Go to the Debug view. 10. Click Next through the next few screens. In this task.5. select Wind River VxWorks 5. the breakpoint will not be triggered because the code is only run by the tMonitor task. the connection definition appears in the Remote Systems view and Workbench connects. 3. When the breakpoint is triggered. Since Immediately connect to target if possible is selected by default.c. Right-click tCosmos and tCrunch and select Attach to Kernel Task. 3. and then click Finish. select tMonitor and click Resume to resume the system. 156 . then click Next. Remove the breakpoint by right-clicking it in the Breakpoints view and selecting Remove. 2. navigate to the location of your core dump file and the VxWorks kernel image. nothing appears because the whole target is stopped. To analyze core dump files for backtraces. Note that the run control icons are disabled. you analyze core dump files to view backtraces of various tasks.5 core dump the cause is listed as UNKNOWN.3 7.x Core Dump Connection. A dialog appears telling you that the core dump was successfully attached. 8. do the following: 1. If you type in the target console. click Define a connection to remote system. The dialog also displays the program counter of the current execution context. In the Debug view. The tasks appear in the Debug view. 6. Create a new user-defined project by selecting File > New > User-Defined Project. and it will disappear from the Remote Systems view.B Debugging a VxWorks 5. When the target loads a module. Workbench provides added value over Tornado in your ability to use the Search view. This is a limitation of Tornado 2. 5.x. and then click Next.x Projects In this task. To debug a kernel module. In the Target Operating System dialog. type a descriptive name into the Project name field. but the module is still running on the target.2. Launch Tornado from Workbench.5 (this allows you to use the Tornado 2. or if it is not open. You can select and delete it.x IDE or edit the Makefile manually. Right-click the new project and select Build Project. then select Create project at external location. do the following: 1. 3. You can also import and rebuild a kernel project. Limitations and Known Issues For module synchronization.x tools. 8. (Optional) To add or remove files. the build calls the Makefile generated by Tornado 2.2.2.2.5 Launching a Kernel Task and Attaching the Debugger.6 Using Existing Tornado 2.x project into Workbench.x Projects B.2. the Outline view. To import an existing Tornado project into Workbench. 4. Navigate to the location of your existing Tornado 2. you import an existing Tornado 2.2. you must specify the -s option to the target server. This is because the target server cannot remove a module loaded by the target.6 Using Existing Tornado 2.2. Since this is a user-defined project. CTRL+P. or press CTRL+B. by selecting Target > Launch Wind River Tornado.153. On the next screen. 157 .x compilers). it appears in the Remote Systems view. proceed as described in B. Click Yes to overwrite existing project information. select Wind River VxWorks 5. A dialog appears telling you that the directory you pointed to already contains project information. select Window > Open Perspective > Advanced Device Development. 7. 9. 2.2. Your project appears in the Project Explorer. Switch to the Advanced Device Development perspective. and click Finish. and the very powerful source analysis tools to manage your projects.5 Target B. and the Workbench debugger cannot overcome this limitation. use the Tornado 2. p.x project. 3 158 .Wind River Workbench By Example. 3. 159 . Links to topics containing the term will appear.2 Searching for Terms in Online Documentation 159 C. Type the term you are looking for into the Search expression field.C Glossary C. select Search. click the topic in the list.2 Searching for Terms in Online Documentation If the term you want is not listed in this glossary. To open the document containing a topic. click the Show in All Topics icon in the upper right corner of the help view.3 Terms 160 C. 5. To see where this topic’s document appears in the help Table of Contents. click Back. 3. 1. Click Go. you can search for it throughout all online documentation.1 Introduction This glossary contains terms used in the VxWorks version of Wind River Workbench. If it is not already open. open the Help view by pressing the help key for your host. C. along with a short example of the surrounding text. 2. At the bottom of the view. To switch from the document you were reading back to the search results.1 Introduction 159 C. 4. board support package (BSP) A Board Support Package (BSP) consists primarily of the hardware-specific VxWorks code for a particular target board. for example Wind River Documentation > Workbench. For more information about online help. 2. From the Working set content pane. click New. Click Search at the bottom of the Help view. Select your new Search Scope Set. TCP. Click OK twice to return to the help browser. 8. C. back end Functionality configured into a target server on the host determines how it will communicate with a particular target agent on the target. click Search only the following topics. click All Topics. and the active view is the focus of keyboard and mouse input. Click Go. Click OK. and TIPC connections. 5. and wdbproxy for UDP. 3. 9. as shown by its highlighted title bar. Many menus change based on which is the active view. wdbserial for serial connections. wdbpipe for VxWorks simulators. To refine a search to reduce the number of results. 7. you use a wdbrpc back end for Ethernet connections. For example. A BSP includes facilities for hardware 160 .3 Terms active view The view that is currently selected. The results will appear in the Search list. Type in a name for your new Scope Set.Wind River Workbench By Example. you can create a Search Scope Set that will search only Wind River documentation: 1. In the Select Search Scope Sets dialog box. where your new search scope appears next to the Search scope link. Click the Default link next to Search Scope.3 If the result set is very large. then navigate to Wind River Partner Documentation > Eclipse Workbench User Guide > Tasks > Accessing help. In the Search Scope dialog box. then click Edit. The target server must be configured with a back end that matches the target agent interface with which VxWorks has been configured and built. 4. the information you are looking for might not appear in the top 10 or 15 results. select the document sets to which you want to narrow the search. 6. 3. for example WR Documentation. CDT (C/C++ Development Tooling) The Eclipse C/C++ IDE. Modifications made in the Editor follow an open-save-close life cycle model. kernel modules. method. known as the host. standing for a declaration or occurrence of a constant. and so on. serial. and so on). This provides functionality that is configured into a target server to allow it to communicate with various target agents. type. that will run on another system. build spec A particular set of build settings appropriate for a specific target board. this color carries over to breakpoints in the Editor and to other views that derive their context from the Debug view. or namespace in a parsed source code file. The target is generally hardware that you would have no other convenient way to program. preprocessor option. They can not be stripped of symbols. cross-development The process of writing code on one system. 161 . function. editor The editor is a visual component within Wind River Workbench. known as the target. It is typically used to edit or browse a file or other resource. such as a chip destined for a mobile phone. or -g-dwarf-2). interrupt handling and generation. mapping of local and bus memory space. color context The color assigned to a particular process in the Debug view. Multiple instances of an Editor type may exist within a Workbench window. debuggable objects Debuggable objects are the executable application files. and libraries that can be accessed by both the host and target. kernels. DKM VxWorks Downloadable Kernel Module. based on the mode of communication that you establish between the host and the target (network. These objects are ideally compiled without optimization.3 Terms initialization. hardware clock and timer management. element An element is an entity that holds source analysis information of any kind.C Glossary C. gutter The left vertical border of the editor view where breakpoints and the program counter appear. Each Workbench perspective displays the Editor area even when no files are open. but with the appropriate debug flags (for example with -g. variable. launch configuration A run-mode launch configuration is a set of instructions that instructs Workbench to connect to your target and launch a process or application. perspective A perspective is a group of views and Editors. use Ctrl+F1 to access help. kernel module A piece of code that can be loaded and unloaded without the need to rebuild and reboot the kernel. object path mappings The object path mappings specify where the debuggable objects are to be found for both the debugger running on the host and the target. each perspective may have a different set of views but all perspectives share the same set of Editors. 3. Instead. In Workbench. Breakpoints. or Ctrl+F1 on Linux and Solaris to get context-sensitive help. The host shell also provides Tcl scripting support. each perspective containing one or more views and Editors. One or more perspectives can exist in a single Workbench window. bookmarks.org) and included with Workbench. kernel configuration editor The editor that allows you to configure the kernel of a VxWorks Image project. JDT Java Development Toolkit provided by the Eclipse organization (http://www. NOTE: The Help button on Solaris keyboards does not open Workbench help due to a problem in Solaris/GTK+. additional perspectives (such as those installed with Run-Time Analysis Tools) are available to you. Default Workbench perspectives include the Application Development and Device Debug perspectives. A debug-mode launch configuration completes these actions and then attaches the debugger. overview ruler The vertical borders on each side of the Editor view. and other indicators appear in the overview ruler.eclipse.3 help key The help key (or combination of keys) is determined by your host platform: press F1 on Windows. host shell A Wind River command shell that provides a command-line environment for GDB and KGDB debugging. Within a window. 162 .Wind River Workbench By Example. but if you click Window > Open Perspective > Other. this is set within the Remote Systems view’s Target Connection Properties. or from many Internet Web sites. program counter The address of the current instruction when a process is suspended. and therefore the order in which they should be compiled and linked. registry The registry associates a target server’s name with the network address needed to connect to that target server. and the view toolbar. project A collection of source code files. such as project properties. and connects Wind River Workbench tools to the target agent. When a process is suspended. and so on. all host tools access the target through this server. Compare with user mode. and other metadata. title bar A view’s title bar contains the view name. This is set in the Debug view in Workbench.3 Terms plug-in An independent module. and binaries used to create a downloadable application or bootable system image. source lookup path The source lookup path specifies the location that the Workbench debugger uses to identify and open each source file as it is being debugged. target server The target server runs on the host. real-time process (RTP) A VxWorks process that is specifically designed for real-time systems. system mode When in system mode. build settings. A highlighted title bar denotes the active view. There is one server for each target. project description files Automatically-generated files that contain information about a project. its icon. thereby allowing you to select a target server by a convenient name. available from Wind River. Projects can be linked together in a hierarchical structure (displayed as a project/subproject tree in the Project Explorer) that reflects their inner dependencies. 163 . build information.C Glossary C. that delivers new functionality to Workbench without the need to recompile or reinstall it. a kernel or RTP application. makefile fragments. all processes stop. the debugger is focused on kernel processes and threads. the Eclipse Foundation. and allows for writing to memory as well as for calling routines. A working set can also help you focus by reducing the number of projects visible in the Project Explorer. 3. typically used to navigate a hierarchy of information (such as the resources in your workspace). and so on. working set Resources you select to view or operate on as a group. source code analysis. A VIP provides build support. folders. and files. you can use the Workbench development suite (IDE) or the vxprj command line development tool. The toolbar also contains a context menu that contains other actions for that view. and building of a kernel image. To work with (configure and build) a VIP. view A view is a visual component within Workbench.3 toolbar A view’s toolbar contains actions that apply only to that view (for example. This service provides full access to VxWorks memory.Wind River Workbench By Example. WDB target agent The WDB target agent runs on the target. user mode When in user mode. When a process is suspended. and is the interface between VxWorks and all other Wind River Workbench tools running on the host or target. A VIP is one of the primary means for configuring VxWorks (the other is the VSB project). A Workbench window can contain more than one perspective. the number of symbols displayed in the Outline view. and other capabilities that simplify the creation. the debugger is focused on user applications and processes. configuration. For example. ! CAUTION: When VxWorks is configured with the WDB target agent. Compare with system mode. Wind River recommends removing WDB from VxWorks for production systems. VIP VxWorks Image Project. or that reflect the components that are installed. 164 . workspace A workspace is the central location for all the resources you see in Workbench: your projects. Only one view has focus (is active) at a time. it is enabled on UDP port 17185. Step Over in the Debug view). you can create a working set to speed up a search by restricting its scope. The main Workbench toolbar contains actions such as Search that apply to Workbench as a whole. but only one is displayed at a time. other processes continue to run. window The desktop development environment as a whole—the space Workbench takes up on your screen. The default location of the workspace is installDir/workspace.3 Terms Workbench also uses the workspace to store settings that describe your working environment: which projects and views are currently open. NOTE: This use of the term workspace is entirely different from the flash workspace. 165 . that sense of the term is restricted to flash programming. how you have your views arranged within the perspective. you can create more than one workspace. whether you have breakpoints set. and so on. To keep your projects completely isolated from each other.C Glossary C. but it can be located anywhere. which is a small area of RAM needed to run the flash algorithm. 3.3 166 .Wind River Workbench By Example. target server 100 basename mappings 102 board support package 59 creating 61 customizing 13 customizing manually 61 simulator 60 Wind River Workbench 60 boot loader creating 54 default 54 redefine link address 57 select drivers 58 booting parameters displaying current. 125 launch RTP 132 rebuild RTP 129 user 12 writing in Workbench 11 Autoscale 126 default and active 77 PowerPC variants 71 Subprojects tab of VIP 77 target. connecting to VxWorks 5. passing up to superproject bundle. import VIPs from 45 components including 39 config. non-default 41 dual mode debugging 96 69 167 . connecting 21 command line.h make writable 62 modify 62 configuring jumpers 22 target hardware 21 VxWorks image project 126 VxWorks kernel components 38 VxWorks source libraries 49 core dump. loading symbols 102 debugging applications 115 attaching the debugger 116 before you begin 115 dual mode 96 multi-process 118 run program 114 VxWorks 5.Index A application initialization routines 126 applications adding routines to VIPs 126 adding to VIPs 125 deploying 13 how to run 113 kernel 12. VxWorks image 128 72 C cables. at boot time 23 VxWorks 24 rebooting VxWorks 25 troubleshooting 26 BSP See board support package build redirection root directory 80 spec D debug server.5.x 156 B back end.5 target 151 dependency checking 125 Domain Name Service (DNS) 20 downloadable kernel module (DKM) driver. 3.5 Target 151 Debugging RTPs. kernel libraries 33 E Examples Adding IPNet Support to a DKM 81 Building a VIP With Sources in a Subdirectory 41 Bundling RTPs and Libraries with a VxWorks Image 128 Connecting a Target Server to a Target Agent 104 Creating and Passing a Build Target 72 Customizing a BSP 61 Customizing VxWorks Libraries as a Base For a VIP 50 Debugging a VxWorks 5. custom VxWorks 49 LIBS 126 link address. adding support to a DKM 81 M macros EXTRA_MODULE 126 LIBS 126 Makefile templates migrate modified 45 migrate unmodified 45 memory overlapped virtual 82 target server cache size 101 MIPC. SMP support 33 L launch configuration attach task or process 113 create for existing project 111 create with Run menu 112 from target connection 112 LD_LIBRARY_PATH 128 libraries. adjusting 43 Linker 128 loading symbols to debug server 102 F File Transfer Protocol See FTP server Find dialog 39 FTP server configuring 19 H hosts file. IPv6 33 Kernel Objects view. and Plug-ins 116 Discussion of PowerPC Build Spec Variants 71 Working with RTPs.Wind River Workbench By Example. object path mappings 102 EXTRA_MODULE 126 J jumpers 22 K Kconfig 50 kernel applications 12. Shared Libraries. multi-process debugging 118 kernel. Shared Libraries. creating 32 kernel libraries. deploying 13 image type VxWorks 36 importing object path mappings 102 VIP.3 dynamic executable 128 IPV6. setting up 20 I image custom kernel 11 kernel 10 pre-built 10 system. 125 booting and loading 12 image 10 kernel configuration editor 38. SMP-enabled sample 44 include search path 80 INCLUDE_WDB_SYS 97 INCLUDE_WDB_TASK 96 IPNet APIs. 124 kernel configuration profiles 35 kernel image. redefine 57 link order. dynamic 128 exporting. target server back end 100 multi-process debugging 118 168 . and PlugIns 85 executable. include 80 semaphores. getting a functioning 60 create in workspace 60 create VSB 47 DKM 69 import or migrate 44 importing Tornado 2.x 157 in external location 60 linking application projects to VxWorks image 126 rebase VSB and VIP 53 ROMFS file system 130 RTP 69 VSB 125 VxWorks importing command line-generated 45 kernel configuration profiles 33 Workbench example 15 T target agent dual mode 96 polled mode 97 system mode 96 user mode 96 board configuring 21 jumpers. monitoring 118 simulator establishing a new connection 97 VxWorks 60 SMP-enabled sample VIPs. set target-side 128 S S_rtp_INVALID_FILE error 114 search path. RTPs 114 PROFILE_BOOTAPP 57 profiles 33 project benefits of 10 bsp. VSB 47 source lookup path. compare with object path 115 starting Workbench 21 Subprojects tab. VSB and VIP projects 53 rebooting VxWorks 25 redirection root directory 80 Remote Systems view 95 basename mappings 102 define a VxWorks Simulator connection shared connection configuration 103 ROM_SIZE 64 97 169 . 130. setting 22 serial port 21 Terminal view 21 file system. discussion of build spec variants 71 pre-built image 10 processes. ROMFS 130 server back end settings 100 connections establishing new 99 ethernet 99 Tornado 153 definition 96 file system (TSFS) 101 making writable 101 memory cache size 101 timeout options 101 R real-time process See also RTPs rebase.Index N new connection wizard 100 new project wizard 13 non-default driver 41 O object path mappings comparison with source lookup path creating automatically 102 exporting 102 importing 102 overlapped virtual memory 82 115 ROMFS 129. setting build spec of VIP subprojects 77 system image 13 system mode 96 System Viewer 101. 131 RTPs launch 132 rebuild 129 running 114 troubleshooting 114 writing 69 run path. importing 44 source build changing BSP or CPU 53 configuration editor 49 project. 125 system-mode agent 96 P polled mode 97 PowerPC. 3.5 156 define simulator connection 97 deployment 123 image configuring with Autoscale 126 create custom 32 pre-built 24 image project base on custom BSP 63 base on different VSB 53 based on VSB 52 build 127 bundle 128 importing and migrating 43 importing command line-generated 45 kernel configuration profiles 33 linking application projects to 126 sources in a subdirectory 41 170 . configuring 38 libraries.x projects 157 Workbench finding an installation of 151 troubleshooting booting problems 26 hardware configuration 25 target server problems 106 VxWorks 25 TSFS See target server.5 151 W WDB back end agent components 124 Pipe 99 Proxy 100 RPC 99 Serial 100 WFTPD FTP server 19 wizard new connection 100 new project 13 Workbench finding a Tornado installation 151 Kernel Objects view 118 starting 21 U user mode 96 userAppInit.x 153 tutorial.5. VxWorks 5. file system 101 image type 36 kernel. 5. configuring 49 rebooting 25 reconfigure for deployment 123 simulator 60. connecting to VxWorks 5. 97 source build project 47 configuring 49 target server connection.3 troubleshooting 106 WDB Pipe back end 99 WDB Proxy back end 100 WDB RPC back end 99 WDB Serial back end 100 Terminal view 21 entering text 22 TIPC target server back end 100 troubleshooting connection 107 Tornado creating a target server connection 153 importing Tornado 2.Wind River Workbench By Example.c 126 user-mode agent 96 V virtual memory. overlapped 82 VSB See VxWorks source build project VxWorks booting 23 bundling RTPs and libraries 128 configure 37 core dump.
Copyright © 2024 DOKUMEN.SITE Inc.