To develop a product using CrossStudio, you must understand the concepts of projects and solutions.

Organizing your projects into a solution allows you to build all the projects in a solution with a single keystroke, and to load them onto the target ready for debugging.

In your CrossWorks project, you…

Projects in a solution can reside in the same or different directories. Project directories are always relative to the directory of the solution file, which enables you to more-easily move or share project-file hierarchies.

The Project Explorer organizes your projects and files, and provides quick access to the commands that operate on them. A toolbar at the top of the window offers quick access to commonly used commands.

Solutions

When you have created a solution, it is stored in a project file. Project files are text files, with the file extension hzp, that contain an XML description of your project. See Project file format for a description of the project-file format.

Projects

The projects you create within a solution have a project type CrossStudio uses to determine how to build the project. The project type is selected when you use the New Project dialog. The available project types depend on the CrossWorks variant you are using, but the following are present in most CrossWorks variants:

Properties and configurations

Properties are attached to project nodes. They are usually used in the build process, for example, to define C preprocessor symbols. You can assign different values to the same property, based on a configuration: for example, you can assign one value to a C preprocessor symbol for release and a different value for a debug build.

Folders

Projects can contain folders, which are used to group related files. Automated grouping uses the files' extensions to, for example, put all .c files in one folder, etc. Grouping also can be done manually by explicitly creating a file within a folder. Note that these project folders do not map onto directories in the file system, they are used solely to structure the display of content shown in the Project Explorer.

Source files

Source files are all the files used to build a product. These include source code files and also section-placement files, memory-map files, and script files. All the source files you use for a particular product, or for a suite of related products, are managed in a CrossStudio project. A project can also contain files that are not directly used by CrossStudio to build a product but contain information you use during development, such as documentation. You edit source files during development using CrossStudio's built-in text editor, and you organize files into a target (described next) to define the build-system inputs for creating the product.

The source files of your project can be placed in folders or directly in the project. Ideally, the paths to files placed in a project should be relative to the project directory, but at times you might want to refer to a file in an absolute location and this is supported by the project system.

When you add a file to a project, the project system detects whether the file is in the project directory. If a file is not in the project directory, the project system tries to make a relative path from the file to the project directory. If the file isn't relative to the project directory, the project system detects whether the file is relative to the $(StudioDir) directory; if so, the filename is defined using $(StudioDir). If a file is not relative to the project directory or to $(StudioDir), the full, absolute pathname is used.

The project system will allow (with a warning) duplicate files to be put into a project.

The project system uses a file's extension to determine the appropriate build action to perform on the file:

You can modify this behavior by setting a file's File Type property with the Common configuration selected in the Properties window, which enables files with non-standard extensions to be compiled by the project system.

Solution links

You can create links to existing project files from a solution, which enables you to create hierarchical builds. For example, you could have a solution that builds a library together with a stub test driver executable. You can link to that solution from your current solution by right-clicking the solution node of the Project Explorer and selecting Add Existing Project. Your current solution can then use the library built by the other project.

Session files

When you exit CrossWorks, details of your current session are stored in a session file. Session files are text files, with the file extension hzs, that contain details such as which files you have opened in the editor and what breakpoints you have set in the Breakpoint window.