Five years ago, I wrote an article about creating a Catalog file for Windows CE 4.0. How time flies, and how the tools get better as we go. That article turned out to be 10 pages when printed; this one should be much shorter because the tools have become much better.
 
What is the Catalog and why would we want to change it? 
 
The Catalog is a collection of components that can be added to your project. These components include OS features, like Internet Explorer, and Board Support Packages (BSP). If you are developing a BSP, you will need to have Catalog components for your BSP, which means changing the Catalog.
 
The Catalog is defined by PBCXML files, which are XML files. The purpose of this article is to demonstrate how to use the Visual Studio IDE to edit the file, not to discuss XML files though.
 
What is different about Catalog files in Platform Builder 6.0?
 
One of the most important differences for Platform Builder 6.0 is that Catalog files are automatically imported into the Catalog. In prior versions of Platform Builder, the Catalog files were CEC files which were imported into the Catalog by selecting a the Manage Catalog Features item in the Files menu, then selecting the CEC file to be imported.
 
For Platform Builder 6.0, simply putting a folder named Catalog in the root of your BSP with a file that has the PBCXML file extension causes it to be imported when you open your OSDesign in Visual Studio. The importing doesn’t seem to be perfect, but it is good enough. If you add a BSP to the Platform folder while you have a Platform Builder solution open, the BSP may not be imported until you either close Visual Studio, or click on the Catalog Window’s Refresh button.
 
Another difference is that the CECEdior is no longer an external tool as it was with previous versions of Platform Builder. The Catalog Editor is integrated into the Visual Studio Platform Builder Plug-in.   So just as you would expect for other file types in Visual Studio, when you open a file of type PBXML it opens in the Catalog Editor.
 
The PBXML files no longer use Globally Unique Identifiers (GUID) like the CEC files did, instead they use locally unique names.
 
Getting Started
 
To get started creating a Catalog file for a BSP, open Visual Studio. While you don’t need to open an OSDesign project, it will help because with an OSDesign project open the Catalog will be visible.
 
Use the Files menu to create a New File. In the New File Dialog chose Platform Builder, then Platform Builder Catalog File and Open.
 
 
This creates an almost empty file except for a few properties that identify the file. These properties include a company name, comments and most important a unique id.
 
 
Now is a good time to save the file, so right click on the CatalogFile1.Pbxml tab and select Save CatalogFile1.Pbxml. It hasn’t been saved yet, so the Save As dialog will open. Now for an important step, save the file in C:\WINCE600\Platform\MyBSP\Catalog. As you can see, my BSP name is MyBSP, and I will name my Catalog file MyBSP.pbxml.
 
Before starting to add new features to the Catalog identify the file itself by filling in the Properties for the file. By selecting Catalog (Current File) the properties for the file will be displayed and ready for editing in the Properties View. The following shows this information filled in:
 
 
Two important items to notice:
 
  1. The Unique Id field needs to be filled in with a string that must be unique. Keep in mind that if you will distribute your BSP to others that this should be unique when they add your BSP to their Platform folder as well. To help this be unique, I added My Company name to the Unique Id.
  2. When selecting an item to edit, help is displayed at the bottom of the Properties View. This can be handy to figure out what needs to be entered for each item.
 
Adding BSP Information
 
The BSP information is like a folder that will contain your drivers and any other features that you want included in the Catalog for your BSP. The BSP information helps identify your BSP’s drivers as belonging to your BSP.
 
To add a BSP, click on the little arrow next to Add:
 
And select BSP. The BSP will show in the Catalog in Third Party\BSP:
 
 
The BSP show under Third Party to differentiate it from the BSP’s that ship with Platform Builder.
 
Select the new BSP so that the properties show in the Properties View. You should fill in the following items at a minimum:
 
  1. Set the Platform Directory to the name of your Platform folder
  2. Select the appropriate Supported CPU(s)
  3. Give your BSP a name that will be displayed in the Catalog in the Title field
  4. Like the file properties, set the Unique Id to a unique value. 
 
 
So far you haven’t created much, but it should show in the Catalog View, if you have opened an OSDesign project. If your BSP name doesn’t show in the Catalog, select the refresh button in the Catalog View.
 
Adding a Driver
 
To add a driver to the BSP catalog file, select the BSP, right click on it and then select Add Catalog Item In Subfolder.
 
 
Then type Device Drivers\MyDriver in the Add Subfolder dialog.
 
It will now create the folders and insert a new driver entry. Next edit the driver properties:
 
Here you should:
·         Select the Supported CPUs, in this case ARMV4I. Hint, click on the Supported CPUs field and a button will appear that will open a dialog for you to select the appropriate CPUs.
·         Edit Title and Unique Id to set strings that describe your driver.
·         Set either an Additional Variable or Sysgen Variable that will be set when this driver is added to a project. This can be used to optionally add the driver to the OS image if you would like.
·         Add the dll name to the list of Modules
 
Next, add a Source Code Link so that the source code can be browsed in the Solution Explorer. To do this, right click on the driver entry and select Add Source Code Link.
 
Then in the Properties editor set the path to the source code for the driver.
Other features
 
You should now have the basics of editing a catalog file. Other features, including the bootloader and applications are added in the same way as the driver was added.
The articles listed in Summary of Platform Builder Catalog Posts to be of help.
Copyright © 2008 – Bruce Eitman
All Rights Reserved