14.3. Windows CE Driver Distribution

14.3.1. Distribution to New Windows CE Platforms

[Note]
The following instructions apply to platform developers who build Windows CE kernel images using Windows CE Platform Builder or using MS Visual Studio 2005/2008 with the appropriate Windows CE plugin. The instructions use the notation 'Windows CE IDE' to refer to either of these platforms.

To distribute the driver you developed with WinDriver to a new target Windows CE platform, follow these steps:

  1. If you have not already done so, modify the project registry file — WinDriver\samples\wince_install\project_wd.reg — to add an entry for your target device.
    [Note]
    When defining ID values, take care to use the correct format, as specified in the project_wd.reg comments — hexadecimal in the case of PCI devices.
  2. Compile your Windows CE platform (Sysgen stage).
  3. Integrate the driver into your platform:
    1. Run the Windows CE IDE and open your platform.
    2. Select Open Release Directory from the Build menu.
    3. Copy the WinDriver CE kernel file — WinDriver\redist\<TARGET_CPU>\windrvr1230.dll — to the %_FLATRELEASEDIR% subdirectory on the target development platform (should be the current directory in the new command window).
    4. Append the contents of WinDriver\samples\wince_install\project_wd.reg to the %_FLATRELEASEDIR%\project.reg registry file.
    5. Copy the contents of the WinDriver\samples\wince_install\project_wd.bib file to the FILES section of the binary image builder file — %_FLATRELEASEDIR%\project.bib. Then uncomment the line that matches the target platform (see the "TODO" comments in the copied text).

      [Note]
      This step is only necessary if you want the WinDriver CE kernel file (windrvr1230.dll) to be a permanent part of the Windows CE image (NK.BIN), which is the case if you select to transfer the file to your target platform using a boot disk. If you prefer to have the file windrvr1230.dll loaded on demand via the CESH/PPSH services, you do not need to perform this step until you build a permanent kernel.
  4. Select Make Run-Time Image from the Build menu to save the new image (NK.BIN).
  5. Download your new kernel to the target platform and initialize it either by selecting Attach Device from the Target menu, or by using a boot disk. For Windows CE 4.x, the menu is called Download/Initialize rather than Attach Device.
  6. Restart your target CE platform. The WinDriver CE kernel will automatically load.
  7. Install your hardware-control application/DLL on the target.
    If your hardware-control application/DLL uses wdapi1230.dll (as is the case for the sample and generated DriverWizard WinDriver projects), also copy this DLL from the WinDriver\redist\WINCE\<TARGET_CPU> directory on the Windows host development PC to the target's Windows directory.

14.3.2. Distribution to Windows CE Computers

[Note]
Unless otherwise specified, 'Windows CE' references in this section include all supported Windows CE platforms, including Windows Mobile.
  1. Copy WinDriver's kernel module — windrvr1230.dll — from the WinDriver\redist\WINCE\<TARGET_CPU> directory on the Windows host development PC to the Windows directory on your target Windows CE platform.
  2. Add WinDriver to the list of device drivers Windows CE loads on boot:
    • Modify the registry according to the entries documented in the file WinDriver\samples\wince_install\project_wd.reg. This can be done using the Windows CE Pocket Registry Editor on the hand-held CE computer, or by using the Remote CE Registry Editor Tool supplied with MS eMbedded Visual C++ or MS Visual Studio 2005/2008. Note that in order to use the Remote CE Registry Editor tool you will need to have Windows CE Services installed on your Windows host platform.
      [Note]
      When defining ID values, take care to use the correct format, as specified in the project_wd.reg comments — hexadecimal in the case of PCI devices.
    • On many versions of Windows CE, the operating system's security scheme prevents the loading of unsigned drivers at boot time, therefore the WinDriver kernel module has to be reloaded after boot. To load WinDriver on the target Windows CE platform every time the OS is started, copy the WinDriver\redist\Windows_Mobile_5_ARMV4I\wdreg.exe utility to the Windows\StartUp directory on the target PC.
  3. Restart your target CE computer. The WinDriver CE kernel will automatically load. You will have to do a warm reset rather than just suspend/resume (use the reset or power button on your target CE computer).
  4. Install your hardware-control application/DLL on the target.
    If your hardware-control application/DLL uses wdapi1230.dll (as is the case for the sample and generated DriverWizard WinDriver projects), also copy this DLL from the WinDriver\redist\WINCE\<TARGET_CPU> directory on the development PC to the target's Windows directory.