Выбрать главу

■ Write Run-Time Image To Flash Memory Instructs EBOOT to write the run-time image to the flash memory of the target device.

Environment Options

The Property Pages dialog box provides an Environment option to configure environ­ment variables that will be used during the build process. You can enable most features in Windows Embedded CE 6.0 R2 by using catalog components, but for some options you need to set a SYSGEN variable so that Platform Builder compiles the necessary code and includes it in the run-time image. Setting environment variables that influence the build process can be helpful when developing a BSP. Environment variables are accessible during the Windows Embedded CE build process from the command line. You can also use environment variables to specify flexible information in the sources, binary image builder (.bib), and registry (.reg) files.

TIP
If it works in Debug but not in Release

If you can build a run-time image in the Debug configuration, but not in the Release configura­tion, display the Property Pages dialog box, select All Configurations from the Configuration list box, and then select the Environment option to set the environment variables for both Debug and Release to the same values.

Advanced OS Design Configurations

This section covers several advanced topics related to OS designs. Specifically, this section explains how to support multiple platforms with the same OS design and discusses the file locations and file types that an OS design typically includes.

Associating an OS Design with Multiple Platforms

When creating a new OS design project by using the OS Design Wizard, you can select one or more BSPs on the Board Support Packages wizard page. By associating an OS design with multiple BSPs, you can generate separate run-time images with identical content for multiple platforms. This is particularly useful in projects that include multiple development teams, especially if the final target hardware is currently not available. For example, you can generate a run-time image for an emulator-based platform so that the application development team can start before the final hardware is available. In terms of OS functionality, the application development team can use the application programming interfaces (APIs) before the final target platform is available. The APIs will be included in the final target because the two run-time images share the same set of components and configuration settings.

You can also add support for multiple platforms to an OS design after the initial creation. All you need to do is select the corresponding check boxes under BSP in the Catalog Items View of Solution Explorer. Selecting a BSP automatically adds the additional platform to the configuration for Release and Debug. You can then switch between the different platforms and build configurations by using Configuration Manager, which is available on the Build menu in Visual Studio. However, it is necessary to run the entire build process, including the time-consuming SYSGEN phase, for each platform individually.

OS Design Paths and Files

In order to use and redistribute your OS designs, you need to know exactly what files constitute an OS design and where they are located on your development computer. By default, you can find the OS designs in the %_WINCEROOT%\OSDesigns directory. Each project corresponds to a separate child directory. OS designs typically correspond to the following file and directory structure:

■ <Solution Name> The parent directory that Visual Studio created for the project.

 ■<Solution Name>.sln The Visual Studio solution (.sln) file to store settings specific to the OS design project. The file name is generally the same as that of your OS design.

 ■ <Solution Name>.suo The Visual Studio solution user options (.suo) file, which contains user-dependent information, such as the state of the Solution Explorer views. The file name is generally the same as your OS design.

 ■ <OS Design Name> The parent directory for the remaining files included in the OS design project.

  • <OS Design Name>.pbxml Your OS design's catalog file. This file contains references to selected catalog components and all the settings related to your OS design.

  • Subprojects This directory includes a separate subfolder for each subproject created as part of the OS design.

  • SDKs This directory includes the Software Development Kits (SDKs) created for the OS design.

  • Reldir This is the release directory. Platform Builder copies the files into this directory during the process of creating the run-time image that can then be downloaded to a target device.

  • WinCE600 This is where files are copied after the Sysgen phase is complete, including resource files and configuration files for the current OS design.

Source Control Software Considerations

Basically, an OS design is a set of configuration files for Platform Builder to generate a Windows Embedded CE run-time image. If you are using source control software to coordinate the work of your development team, you only have to store these configuration files in your source control repository. You do not need to include any files from the CESysgen folder (used during the build process of the run-time image) or Reldir directories, because they can be reconstituted on any workstation with Platform Builder and the BSP installed. Also, omit files ending in .user or .suo because those are user-specific settings for the IDE, and omit .ncb files because these files only contain IntelliSense® data.

Lesson Summary

Platform Builder for Windows Embedded CE 6.0 R2 includes an OS Design Wizard to help you accomplish the basic OS design creation steps quickly and conveniently. You can select one or multiple BSPs to include all hardware-specific device drivers and utilities for your target platform and a design template with possible template variants to include additional catalog items. After completing the OS Design Wizard, you can further customize the OS design. You can exclude unnecessary catalog items, include additional components, and configure project properties such as the Debug and Release build options. In the Debug build configuration, Platform Builder includes debug information in the run-time image, which leads to an increase of 50 percent to 100 percent in comparison to Release builds. However, Debug builds facilitate debugging and step-by-step code execution during the development process. Because you can configure Debug and Release build options separately, you might encounter a situation in which your OS design compiles in the Debug configuration but not in the Release configuration. In this case, it can be helpful to set environment variables in both Debug and Release to the same values. In order to distribute your OS designs, you need to locate the source files, which you can find by default in the %_WINCEROOT%\OSDesigns directory. You can use source control software to coordinate the work of a development team.