Anyone who has used Platform Builder knows that running Sysgen can take 15 minutes, or even more to build the OS. That kind of delay between changing code and testing can be crippling to your development, and can cost your company hundreds or even thousands of dollars a day in lost productivity. There must be a better way. In fact, there are several options available. The following will discuss several of these options.
 
FAST: Build and Makeimg from the Command Line
The option that I use most, primarily because it is so easy, is to build the changed code and run makeimg from the command line. This process is:
 
  1. Sysgen the project only when I do one of:
    1. Create a new project
    2. Modify an existing project, that is if I change the components from the Catalog
    3. Get the project from Version Control (which is really a variation of a or b)
  2. Edit some source code in the BSP
  3. Open a build window. See Platform Builder: Build Tools, Opening a Build Window
  4. From the command line do the following
    1. Change directories to the folder that contains the changed source code
    2. Set WINCEREL=1
    3. Build
    4. Makeimg
  5. Download the OS image and test the changes
  6. To continue changing code and testing, repeat steps 2, 4c, 4d and 5
 
FASTER: Build and use the KITL and the CE Target Control
This option is faster than the previous option. The reason is that this option eliminates the need to run makeimg and download the OS every time that you make a change. The process is:
 
  1. In the Platform\Settings menu for Platform Builder 4.x and 5.0, or the Project\Properties menu for Platform Builder 6.0:
    1. Select Build Options
    2. Enable KITL
    3. Enable CE Target Control (In PB 6.0, this is in the Catalog. Search for “Shell”)
  2. Sysgen the project
  3. \Open a build window. See Platform Builder: Build Tools, Opening a Build Window
  4. Edit the %_FLATRELEASEDIR%\platform.bib and remove the driver that you are working on. This removes the driver from the OS image temporarily.
  5. From the command line run makeimg
  6. Download and persist the OS image on the device
  7. Edit some source code in the BSP
  8. From the command line do the following
    1. Change directories to the folder that contains the changed source code
    2. Set WINCEREL=1
    3. Build
  9. Reset the device. When the system needs the driver, it will download just the driver from your _FLATRELEASEDIR via the \Release folder on the device.
  10. To continue changing code and testing, repeat steps 7, 8c and 9
 
FASTEST: Modify your Test App to Load/Unload the Driver
This option is the fastest once you have it set up, but it can be time consuming to set up. This eliminates the need to reset the device. But this can only be used for drivers that are managed by the device manager. 
 
This is a variation of the previous method, but instead of doing step 9, modify your test application (you do have a test application don’t you?) to load and unload the driver as follows.
 
  1. At the start of you testing of the driver, use ActivateDeviceEx to request that the device manager load the driver, When it loads, it will get the driver from the \Release folder on the device which maps to your _FLATRELEASEDIR.
  2. After the test is complete, use DeactivateDeviceEx to unload the driver.
 
Copyright © 2008 – Bruce Eitman
All Rights Reserved