CSP Drivers

If your SDB contains a high-integration CPU or associated chipset (core logic), Platform Builder may contain a driver for the peripherals on the chip in the CSP directory, %_WINCEROOT%\Public\Common\Oak\CSP. Review the contents of the CSP directory for any drivers that you want to include in your BSP. If you cloned an existing BSP that makes use of the CSP drivers, your BSP will automatically include any source files necessary to build the final image using the shared CSP library code, and it will also include the Platform.bib and Platform.reg entries necessary to include the resultant image in your operating system (OS) image.

Some of the CSP drivers link against a platform-specific library that is used to define board-specific aspects, including memory maps and interrupts. This is typically the case for chipset peripherals. To determine if the CSP drivers are linked against a platform-specific library, review the drivers directory of a platform known to use the CSP driver of interest. For example, the Assabet (sa11x0bd) platform uses the SA11X0 USB driver from the CSP directory, but includes a platform-dependent Ohcd.c file for memory and interrupt information.

The greater part of the code for the CSP driver resides in the CSP directory, but the resulting image is built during the platform build. For example, if your SDB contains an SA1100 CPU and you want to include the USB host controller driver that ships in the CSP directory with Platform Builder, you need to perform the following steps to include the USB host controller:

  • Create a directory under your platform; for example %_WINCEROOT%\Platform\<Platform>\Drivers\USB, and recursively copy (xcopy) the platform-specific portion of the driver from the Assabet platform located in %_WINCEROOT%\Platform\sa11x0bd\Drivers\USB.
  • Edit the dirs file under %_WINCEROOT%\Platform\<Platform>\Drivers to include your new directory, USB.
  • Edit your Platform.bib and Platform.reg files; for example %_WINCEROOT%\Platform\<Platform>\Files\Platform.{bib | reg}; to include entries for the driver image, Ohci.dll. Using the Assabet platform as reference, the entries can be copied from it.
  • Edit Ohcd.c and customize the file to your platform's memory map and interrupt routing.

In the event that a CSP driver needs to be modified for your platform, you can copy the CSP sources from the CSP directory to your platform's directory. For example, copy the USB CSP driver from %_WINCEROOT%\Public\Common\Oak\CSP\sa11x1\USB\Hcd\Ohcd to %_WINCEROOT%\Platform\<Platform>\Drivers\USB\Hcd\Ohcd. If necessary, you can modify the sources file to both include any platform-specific source files and generate the resulting DLL. The resulting DLL is generated instead of an intermediate static library, which is later linked into the DLL.

See Also

BSP Drivers | Common Drivers | Device Driver Libraries

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.