How to Decrease Run-Time Image Size on a CEPC

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/27/2008

When you design and configure your run-time image, each module, component, and feature that you add or remove affects the size of the run-time image.

To meet the specific memory requirements of the target device, you can decrease the run-time image size by removing nonessential modules, compressing modules, and moving modules to different parts of the file system.

Hardware and Software Assumptions

Steps

Step Topic

1. Configure and build your run-time image.

The method for configuring your initial run-time image varies depending on the memory requirements of your target device. The following list shows different methods for configuring your initial run-time image:

  • If your target device has strict memory requirements, select an OS design that has a minimal amount of features, such as the Small Footprint Device Design Template, and then add or remove Catalog items as appropriate for your target device category.
  • If your target device does not have strict memory requirements, select an OS design that has more features, such as the Set-Top Box Design Template, and then add or remove Catalog items as appropriate for your target device category.

How to Configure and Build a Run-Time Image for a CEPC

2. After the build is complete, view your run-time image and check its size. Typically, the run-time image is named Nk.bin.

You can check the run-time image size by doing one of the following:

  • Open Windows Explorer, browse to the _FLATRELEASEDIR, and view the size of your run-time image in the Size column.
  • Use the Viewbin tool to view the size of your run-time image. For more information, see Viewbin Tool.

Not applicable

3. Create a new configuration and set it to the active configuration.

  • As a best practice, first copy the Release configuration, and then modify it to create your Ship configuration.
Cc440228.note(en-US,WinEmbedded.60).gifNote:
Creating a new configuration does not automatically change the active configuration to the new configuration.

Creating a Custom Ship Configuration

Build Configurations

4. Remove nonessential features, modules, and components from your OS design by clearing the check box next to each nonessential feature, module, or component in the Catalog Items View.

Cc440228.note(en-US,WinEmbedded.60).gifNote:
You might be unable to remove certain features, modules, or components because of dependencies on other features. To view dependencies, from Solution Explorer window in the IDE, choose Catalog Items View. Select a feature for which you want to check the dependencies, right-click it, and then choose Show Dependencies.

Not applicable

5. If you do not need the VMINI Ethernet sharing library, remove support for it by setting the environment variables KERNELNOSHAREETH and the BSP_NOSHAREETH to 1.

The VMINI Ethernet sharing library enables product, KITL, and debug Ethernet to run over a single Ethernet connection.

Setting or Clearing an Environment Variable (Visual Studio)

6. If it is suitable for your target device, do not localize the run-time image.

By not localizing your run-time image, you can decrease the run-time image size.

  1. From the Project menu, choose <OS Design> Properties.
  2. Expand Configuration Properties, and then choose Locale.
  3. Clear the Localize the build check box, and choose OK.

Not applicable

7. Modify the .bib files for the run-time image by moving the entries for seldom-used, end-user modules to the FILES section of the .bib files.

The module entries listed in the FILES section of a .bib file are compressed and take longer to load. This decreases your run-time image size, but might affect RAM usage and performance. Executable (.exe) files in the FILES section might take longer to load and might run slower.

  • To move a module to the FILES section, in Solution Explorer, expand Parameter Files, and double-click project.bib.
  • Copy and paste the selected module from the MODULES section to the FILES section of the .bib file, and then in the MODULES section, comment out the module you moved to the FILES section by using the ";" character.

Binary Image Builder File

8. Configure the Premakeimg.bat and MyPlatform_bib.cfg files to compress specified modules.

Configuring a Premakeimg.bat File

9. Rebuild the run-time image to bring it up-to-date and save the changes that you made.

Building a Run-Time Image

10. After the build is complete, view the run-time image size again and compare it to the original run-time image to verify that the size decreased.

You can check the run-time image size by doing one of the following:

  • Open Windows Explorer, browse to the _FLATRELEASEDIR, and view the size of your run-time image in the Size column.
  • Use the Viewbin tool to view the size of your run-time image. For more information, see Viewbin Tool.

If you want to verify that any file attributes that were assigned in step 8 persisted through the run-time image build and download, use the File Viewer.

Not applicable

See Also

Other Resources

How-to Topics