46
® 2-1 Projects Projects 2.1 Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

Embed Size (px)

Citation preview

Page 1: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-1

ProjectsProjects

2.1 Projects Overview

Bootable Projects and VxWorks Configuration

Integrated Simulator

Downloadable Projects

Build Specifications

Page 2: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-2

Projects and WorkspacesProjects and Workspaces

Tornado uses projects and workspaces to manage user code, configure VxWorks, and specify build settings.

A project is a collection of source and binary files and build specifications. A workspace is a collection of projects which are grouped to simplify organization of multiple related projects.

The project facility is started

– [UNIX] by selecting the ProjectProject button from the Tornado launcher.

– [Windows] automatically when Tornado starts up, or later by selecting New Project...New Project... from the FileFile menu.

Page 3: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-3

Creating a New ProjectCreating a New Project

The tabs on the selection window allow you to:

– (RecentRecent) Open a recently visited workspace.

– (NewNew) Create a new bootable or downloadable application.

– (ExistingExisting) Browse for and enter an existing workspace.

Page 4: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-4

Project Facility TerminologyProject Facility Terminology

Key project facility concepts:– Bootable Project - A project used to configure and build VxWorks

images for a particular BSP. Application code may be statically linked to such a VxWorks image, and the application’s start-up code may be specified.

– Downloadable Project - A project used to manage and build application modules which can be downloaded and dynamically linked with a running VxWorks image. Allows "on the fly" development.

– Component - A scalable VxWorks facility, often with an initialization routine. Example: hardware fpp support.

– Toolchain - A collection of development tools (compiler, linker, assembler, etc.) for a specific target CPU.

– Build specification - User-specified settings and rules which are used to build a project.

Page 5: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-5

Workspace WindowWorkspace Window

Workspace tabs display:

FilesFiles -- Project source and object files.

VxWorksVxWorks -- Included andexcluded

VxWorkscomponents.

BuildsBuilds -- Build specifications.

Page 6: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-6

Context MenuContext Menu

Actions related to selection(usrAppInit.cusrAppInit.c) Menu itemsvary with selection.

Actions related to currentproject (networkServernetworkServer)

Properties of the selecteditem (usrAppInit.c).

Right-click with mouse to invoke context menu.

Page 7: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-7

Project FilesProject Files

In addition to the source, object, and header files that are displayed in the Files pane of the workspace window, the project facility creates other files:

projectName.wpjwpj -- The project master file. Specifies

– files included in the project and their dependencies

– build specifications

– custom rules

– VxWorks configuration data (for bootable projects).

workspaceName.wspwsp -- Workspace master file. Lists the projects belonging to the workspace.

MakefileMakefile -- Generated before a new or modified project is built or saved.

Page 8: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-8

Using Version Control with ProjectsUsing Version Control with Projects The project facility can make use of source management

tools. The context menu for a selected source or header file will allow the file to be checked in or checked out.

Tools -> Options... -> Version ControlTools -> Options... -> Version Control allows configuration of check-in and check-out routines:

Page 9: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-9

ProjectsProjects

Projects Overview

2.2 Bootable Projects and VxWorks Configuration

Integrated Simulator

Downloadable Projects

Build Specifications

Page 10: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-10

Bootable Projects and ApplicationsBootable Projects and Applications

A bootable project configures and builds VxWorks images for a BSP. Application code may be statically linked with, or built as part of, a bootable project, to create a bootable application.

Typical reasons to create a bootable project:

– To create a production version of a product (discussed in the Reconfiguration chapter)

– To configure a custom VxWorks image

A bootable project is based on an installed BSP (or derived project), or an existing VxWorks project.

Create a bootable project by selecting File -> New File -> New Project...Project... and using the project wizard.

Page 11: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-11

Creating a Bootable Project (Part I)Creating a Bootable Project (Part I)

Choose a project name, project directory, a comment string, and a workspace to add the project to.

By convention, the project directory name should match the project name (not required, however).

Page 12: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-12

Creating a Bootable Project (Part II)Creating a Bootable Project (Part II)

A bootable VxWorks image is based on:

– An existing project (possibly a projectized BSP), or

– An installed BSP (found in .../target/config.../target/config/bspName).

Page 13: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-13

Creating a Bootable Project (Part III)Creating a Bootable Project (Part III)

The last wizard screen confirms your choices of workspace, project name, and basis BSP (or projectized BSP).

Hit FinishFinish button to create your project.

Page 14: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-14

Bootable Project FilesBootable Project Files

A bootable project is created with the following files:

linkSyms.c and prjConfig.c -- dynamically generated configuration files containing component initialization and scaling support.

romInit.s, sysALib.s, and sysLib.c; romStart.c -- BSP or generic startup files (see Reconfiguration chapter).

usrAppInit.c -- initializes statically linked user application (see Reconfiguration chapter). Created as a stub file, modified by user.

prjComps.h and prjParams.h -- dynamically generated header files containing component choices and parameter values.

Page 15: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-15

VxWorks ComponentsVxWorks Components

VxWorks facilities are shownin a heirarchical display inthe VxWorksVxWorks pane. Includedcomponents are shown inbold, excluded in plain text,and unavailable ones initalics.

Note that the context menuallows you to include orexclude components.

Page 16: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-16

Including ComponentsIncluding Components

When component is included, dialog box lists size of component as well as dependent components.

Selecting OKOK button will include facility and dependent components.

Page 17: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-17

Component SelectionsComponent Selections

Page 18: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-18

Fixing Component Errors and ConflictsFixing Component Errors and Conflicts

If the configuration you have generated contains errors or conflicts, the path to the improper components is highlighted.

Page 19: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-19

Component ParametersComponent Parameters

Some components require parameter values. Double-click on component to set these parameters.

Page 20: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-20

Configuration Outside the Project Configuration Outside the Project FacilityFacility

Some VxWorks components require configuration outside of the project facility, usually because of their complexity.

Examples:

– DHCP server component -- DHCP lease table is configured in .../target/config/comps/src/net/usrNetDhcpsCfg.c.../target/config/comps/src/net/usrNetDhcpsCfg.c. (For details, see Networking chapter.)

– SCSI peripheral configuration is configured in either .../target/config.../target/config/bspName/sysScsi.csysScsi.c (preferred) or .../target/config/comps/src/usrScsi.c. (Details in SCSI Configuration appendix.)

See help pages on component for configuration issues.

Page 21: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-21

Building VxWorksBuilding VxWorks

The build toolbar, shown above, allows you to build a downloadable object or boot image.

The resulting image is saved in the directory projDir/buildSpecName/. Change your boot parameters to reflect this path.

Output from the compilation goes to a build window. Windows users can go to any source line generating a build error or warning by double-clicking on the relevant output line.

Download object Build project file or image

Rebuild All Stop build Compile selected Update source file dependencies

Page 22: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-22

ProjectsProjects

Projects Overview

Bootable Projects and VxWorks Configuration

2.3 Integrated Simulator

Downloadable Projects

Build Specifications

Page 23: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-23

Tornado Integrated SimulatorTornado Integrated Simulator

Tornado includes an integrated target simulator. This facility allows application development prior to hardware availability.

The simulator offers support for all VxWorks facilities except:

– Hardware-specific facilities

– Networking support

Tornado includes a version of WindView which works with the simulator. (See Windview chapter.)

Only one simulator session can run at a time per host.

Page 24: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-24

Simulator BasicsSimulator Basics

The integrated simulator is a "BSP" for the host OS.

VxWorks runs as a process under the host OS.

Hardware interrupts are simulated using signals (UNIX) or Windows messages (Windows).

Page 25: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-25

Starting a Simulator SessionStarting a Simulator Session

Create a simulator by:

– Pressing the simulator button (Windows hosts)

– Pressing the VxSim button from the launcher (UNIX hosts).

You are asked if you wish to launch:

– A standard simulator image (.../target/config(.../target/config/simBSPName/vxWorks/vxWorks[.exeexe]), or

– A custom-configured image from a project directory.

Windows users will then be given a choice to create a default target server. UNIX users need to configure a target server. Tools can be attached to this target server.

Page 26: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-26

ProjectsProjects

Projects Overview

Bootable Projects and VxWorks Configuration

Integrated Simulator

2.4 Cross Development and Downloadable Projects

Build Specifications

Page 27: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-27

Cross-Development OverviewCross-Development Overview

Add application source files to project.

Link modules with VxWorks image and load into target address space:

– Static linking integrates application modules into the VxWorks image (a bootable project) when it is built. VxWorks is then loaded onto the target at boot time.

– Dynamic linking integrates a project object file (in a downloadable project) into the VxWorks image on the target when the file loads, after VxWorks is already running .

Static linking (bootable projects) is usually used for production code.

Dynamic linking (downloadable projects) is usually used during development.

Page 28: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-28

Creating a Downloadable ProjectCreating a Downloadable Project(Part I)(Part I)

Choose a project name, project directory, a comment string, and a workspace to add the project to.

Page 29: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-29

Creating a Downloadable ProjectCreating a Downloadable Project(Part II)(Part II)

A downloadable project is based on:

– A toolchain (CPU architecture dependent), or

– An existing project.

Page 30: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-30

Creating a Downloadable ProjectCreating a Downloadable Project(Part III)(Part III)

The project wizard confirms your choice of project name, directory, and toolchain. Press FinishFinish to create your project.

Page 31: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-31

Adding demo.c to Our ProjectAdding demo.c to Our Project

Add a file to a downloadable project by:

– Project -> Add/Include -> FileProject -> Add/Include -> File menu item, or

– Add Files...Add Files... item in context menu,

– When creating a new source file using File -> New...File -> New...

The newly added file will be displayed in the Files pane of the workspace window. In addition, if the added file was a C/C++ source file, file.o will appear in the Object Modules folder.

Page 32: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-32

demo.cdemo.c

Page 33: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-33

Building A ProjectBuilding A Project

A downloadable application can be built using the build toolbar, the context menu, or the BuildBuild menu.

The default target produced by the build is projName.out. This build compiles and links your project files, then munches the result.

projName.out is not an executable; it is an object module which will be downloaded and dynamically linked to vxWorksvxWorks.

Make dependencies will be automatically generated the first time a project is built. If dependencies change at a future time, select the Dependencies...Dependencies... item from the context menu to recalculate them.

Page 34: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-34

Unresolved External ReferencesUnresolved External References

Page 35: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-35

Downloading the Project FileDownloading the Project File

Use the context menu to download projName.out after selecting the appropriate target server.

Loads projName.out into the target server’s memory pool on the target.

Adds only global symbols to host-resident symbol table (default). Other load options can be set using Tools -> Options...-> DownloadTools -> Options...-> Download.

Resolves undefined symbols as module is loaded.

If any unknown symbols are encountered, then a warning is issued. However, the load does not "fail," in that the module is present on target.

Unloads old version of module if it exists.

Page 36: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-36

Showing ModulesShowing Modules

Downloaded project modules can be displayed from the browser by:

– Selecting Module InformationModule Information and the proper module (Windows).

– Clicking on module name (UNIX).

Page 37: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-37

Unloading ModulesUnloading Modules

Modules can be unloaded using the context menu Unload ‘filename’ item.

– Frees target memory occupied by text, data and bss segments.

– Removes symbols defined by this module from the symbol table.

Used if board does not have enough memory to hold code for all projects.

Make sure that no tasks are executing functions which could reference the module you are unloading.

If other loaded modules reference symbols defined by the code you are unloading, unload them as well.

Page 38: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-38

ProjectsProjects

Projects Overview

Bootable Projects and VxWorks Configuration

Integrated Simulator

Downloadable Projects

2.5 Build Specifications

Page 39: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-39

Build SettingsBuild Settings

A build specification selects toolchain programs (compiler, linker, assembler, ...) and the flags for each; it also specifies makefile macros and the default rule used in building your project.

A project can have several build specifications. For example, a production spec and a debug spec; or build specs for different target architectures (downloadable projects only).

To access the build specifications for your project, select the BuildsBuilds tab in the workspace window.

Page 40: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-40

Build Specification Property SheetBuild Specification Property Sheet

Double clicking on a project’s build spec icon brings up the specification’s property sheet, where you can change build settings.

Page 41: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-41

Compiler SettingsCompiler Settings

The C/C++ compiler pane allows you to set compiler flags.

Page 42: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-42

Rule DefinitionsRule Definitions

Page 43: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-43

Build Specification NotesBuild Specification Notes

You can build a project using any build specification defined for that project. Set the active build spec for the selected project using the Build Spec drop-down list at the top of the project workspace.

A folder containing object files for the project’s active build spec, labeled with the build spec name, is shown in the workspace FilesFiles pane.

Caveat: If you edit a build spec without touching any project source files, you must Rebuild All...Rebuild All... to see the new specification used.

Page 44: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-44

SummarySummary

The Project Wizard allows you to create

– downloadable Projects

– bootable Projects

The project workspace window allows access to:

– project files

– build specifications

– VxWorks configuration (bootable projects)

A bootable project can be created to:

– build a custom-configured VxWorks image

– statically link application code to VxWorks (Reconfiguration chapter)

Page 45: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-45

SummarySummary

VxWorks configuration

– Components can be included or excluded

– Dependencies determined and reported to you

– Selections indicate a choice among component versions.

– Component parameters can be set

Custom VxWorks image built in .../projDir/buildSpecName/vxWorksvxWorks (or imageName)

Tornado includes an integrated simulator that runs on host OS. Allows development of software prior to hardware availability.

Page 46: ® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications

®2-46

SummarySummary

Downloadable projects speed up cross-development

– Object code dynamically linked to running VxWorks image.

– Old version unloaded

– Download uses host-based symbol table

The build specification properties dialog allows setting

– compiler, assembler, and linker programs and flags

– macro definitions

– the build spec’s default rule

as well as– link order

– custom rules