The Windows Embedded CE Stream Driver Wizard (CEDriverWiz) simplifies the tasks needed to setup the initial project workspace to develop Stream Interface driver for Windows Embedded CE. The wizard creates the driver as a new subproject .
A future version is being developed that can generate a number of test application subprojects for the stream driver that:
· Dynamically load and unload the driver in Kernel and User modes
· Load the driver’s stream and perform IO with it.
· Test the driver’s IOCTLs
The CEDriverWiz is created by David Jones, during Q3 in 2010, a long time University computer system Lecturer and embedded system developer, in Australia. As part of David’s community effort and spirit, he decided to make this useful tool available to the developer community, for free.
As part of David’s involvement in the Embedded101 community, David has been working with Samuel Phung (Southern California) and Thierry Joubert (Paris), David got Samuel and Thierry involved to test and document the CEDriverWiz for the community.
Here is the URL to CEDriverWiz home page:
http://www.embedded101.com/CEDriverWiz/
Here is the URL to CEDriverWiz project page on Codeplex:
http://CEDriverWiz.codeplex.com
Installation and Setup
Due to the limited time and resources, the CEDriverWiz is not released with an installation package. In this section, we will work through the steps to install CEDriverWiz.
The initial beta release for CEDriverWiz supports Windows Embedded CE 6.0 (CE 6.0). Since CE 6.0 is a plug-in to the Visual Studio 2005 (VS2005) Integrated Development Environment (IDE), this section provides the steps to install CEDriverWiz to the VS2005 IDE.
Work through the following steps to install CEDriverWiz:
1. Download CEDriverWiz file from the following project on Codeplex:
2. Unzip the CEDriverWiz folder to the root directory, as follow:
C:\CEDriverWiz\
Note:
Instead of the “C:\CEDriverWiz\ folder, you can use a different directory. Since all future documentation and usage scenario will be based on the above directory, to minimize potential problem, it’s best to use the suggested folder.
3. Launch VS2005
4. From the VS2005 IDE, select Tools|External Tools… to bring up the External Tools screen.
5. From the External Tools screen, click on the Add button to create a new item and enter the following:
· In the Title textbox, enter “CEDriverWiz”.
· In the Arguments text box, enter “$(ProjectFileName) $(ProjectDir)|”.
· In the Initial directory textbox, enter “$(ProjectDir)”.
· Click on the button next to the Command text box to bring up the file selection screen, navigate to the “C:\CEDriverWiz” directory and select “CEDriverWiz.exe”.
· From the External Tools screen, click on the Apply button, then the OK button to complete the process.
Using CEDriverWiz
The CEDriverWiz is designed to work within a CE 6.0 OS design project. With a CE 6.0 OS design project open, we can launch the CEDriverWiz from within the VS2005 IDE to generate a subproject to develop stream interface device driver with the required files.
In this section, we will work through the following steps, to show how to use CEDriverWiz:
· Create a CE 6.0 OS design project using the DeviceEmulator BSP, targeting the Emulator.
· Configure and build the OS design project to generate a CE 6.0 OS runtime image.
· Establish connectivity to the Emulator and download the OS runtime image to the Emulator to validate the OS design project is configured properly, and able to generate CE 6.0 runtime image that work in the Emulator.
· Create a stream interface device driver subproject for the OS design, using the CEDriverWiz.
· Without any additional code, build the stream interface device driver subproject to generate the driver binary.
· With the stream interface device driver binary generated, add an entry to the OS design’s Project.BIB (binary image builder) file and include the driver to the OS runtime image.
Create an OS Design Project
In this section, we will work through the steps to create a CE 6.0 OS design, targeting the emulator, to support the CEDriverWiz exercise in the later steps.
If you are working on an existing OS design project, you can use the existing OS design project and skip to the next section. Otherwise, work through the following steps to create an OS design project:
If you are using one of the OS design project you are working on, make a backup copy of the OS design project before working through the exercise.
· From the VS2005 IDE, select File|New|Project… to bring up the New Project screen.
· From the New Project screen, select Platform Builder for CE 6.0 from the left pane.
· Select the OS Design template from the right pane and enter “MyWinCE” as the name for the project and click on the OK button to bring up the Windows Embedded CE 6.0 OS Design Wizard screen.
· Click on the Next button to continue and bring up the Board Support Packages selection screen.
· Select the Device Emulator: ARMV4I BSP and click on the Next button to continue, and bring up the Design Templates screen.
· Select Industrial Device and click on the Next button to continue, and bring up the Design Template Variants screen.
· Select Internet Appliance and click on the Next button to continue, and bring up the Application Media screen. Keep the default selection and click on the Next button to continue, and bring up the Networking Communication screen.
· Keep the default communication component selection and click on the Next button to continue.
· Click on the Finish button to complete the OS design wizard step.
· At this point, the Catalog Item Notification screen is shown to warn one or more of the selected OS components may pose security risk. Click on the Acknowledge button to continue and complete the OS design wizard step.
Configure and Build
In the previous section, we created the MyWinCE OS design project. In this section, let’s work through a few more steps to configure and build the project to generate a CE 6.0 OS runtime image.
· From the VS2005 IDE, select Project|MyWinCE Properties… to bring up the MyWinCE Property Pages screen.
· Select the Configuration Properties node and click on the Configuration Manager… button to bring up the Configuration Manager screen.
· From the Configuration Manager screen’s active solution configuration selection, select Device Emulator ARMV4I Release option to generate the OS runtime image in release mode, and click on the Close button.
CE 6.0 OS design project is initially configured to generate debug mode OS runtime image, which take longer to download and boot up. For our purpose, a release mode image would do.
· From the VS2005 IDE, select Build|Build Solution to build the MyWinCE OS design project and generate a CE 6.0 OS runtime image.
With a properly configured OS design project, the build process should end with zero error and generate an NK.bin file in the build release directory.
Establish Connectivity and Download to Emulator
With a CE 6.0 OS runtime image generated in the previous step, we will work through the steps to establish connectivity to the Emulator and download the CE 6.0 OS runtime image to the Emulator to validate we have a working image.
Work through the following steps to establish connectivity:
· From the VS2005 IDE, select Target|Connectivity Options… to bring up the Target Device Connectivity Options screen.
· From the Target Device Connectivity Options screen, select Device Emulator (DMA) for the Download and Transport selection, and KdStub for the Debugger selection.
· Click on the Settings button next to the Download selection, to bring up the Emulator Properties screen.
· From the Emulator Properties screen, click on the General tab and change the specify RAM size to 256.
· From the Emulator Properties screen, click on the Display tab and enter screen resolution you like to work with. For the exercise in this guide, 640x480 in 16-bit color is selected.
· Click on the OK button to close the Emulator properties screen.
· From the Target Device Connectivity Options screen, click on the Apply button then the Close button to safe the settings and close.
With a CE 6.0 OS runtime image generated and connectivity to the Emulator established, work through the next step to download the image to the Emulator:
· From the VS2005 IDE, select Target|Attach Device to initiate the process to download OS runtime image to the Emulator.
As the download process is taking place, the Emulator Window is launched. The VS2005 IDE’s Output tab is actively displaying activities, showing download activities.
As the OS runtime image is launched on the Emulator, the CE 6.0 desktop is shown on the Emulator screen. With a working OS design project, we can move to the next section and create a stream interface device driver subproject using CEDriverWiz.
Create Stream Interface Driver with CEDriverWiz
In this section, we will work through the step to create a Stream Interface device driver subproject for the MyWinCE OS design project created in the previous section.
If the Emulator is still running, from the VS2005 IDE, select Target|Detach Device to disconnect from the Emulator, and close the Emulator Window.
With MyWinCE OS design project active, work through the following steps to create a Stream Interface device driver subproject for the MyWinCE OS design project:
· From VS2005 IDE, select Tools|CEDriverWiz to launch CEDriverWiz and bring up the CEDriverWiz screen. CEDriverWiz automatically populated the project name and location for the OS design project.
· Enter MyDriver as the name for the driver project to the Stream Name text box.
· Enter MDR as the prefix for the driver, to the Stream Prefix text box.
· From the Stream Driver Wizard screen, click on the Create Stream Driver Subproject button to create the stream driver subproject in the following directory:
\WINCE600\OSDesigns\MyWinCE\MyWinCE\MyDriver_StreamDriver
· Close the CEDriverWiz program.
· From the VS2005 IDE, select Project|Add Existing Subproject… to bring up the file dialog. Navigate and to the following file:
\WINCE600\MyWinCE\MyWinCE\MyDriver_StreamDriver\MyDriver.pbpxml
· After the subproject is added, from the MyWinCE OS design project’s Solution Explorer tab, the following subject is listed:
MyDriver XXDESCRIPTIONXX(C:/WinCE600/OSDesigns/MyWinCE/MyWinCE/…..
· By default, CEDriverWiz assigned the CE_MODULES_MyDriver environment variable to control whether to include the MyDriver.dll binary to the OS runtime image. Since the CE_MODULES_MYDriver variable is not link to any existing component, it’s not enabled.
· To include the MyDriver.dll to the OS runtime image, we need to add the following entry to the Project.bib file:
MyDriver.dll $(_FLATRELEASEDIR)\MyDriver.dll NK
· From the Solution Explorer tab, right mouse click on the MyDriver … subproject and select Build to build the driver and generate a new OS runtime image.
Verify MyDriver.DLL is Compiled to OS Runtime Image
To verify the MyDriver.DLL binary is compiled as part of the OS runtime image, work through the following steps:
· Continue from the previous section, after the build process is completed successfully; select Target|Attach Device from the VS2005 IDE to download the OS runtime image to the Emulator.
· After the OS runtime image is launched on the Emulator, double click on the My Device icon on the CE 6.0 desktop to launch file explorer.
· Double click on the \Windows folder.
· From the CE 6.0 file explorer menu, select View|Options… to bring up the Folder Options screen.
· Uncheck all three options “Do not show hidden files and folders”, “Hide protected operating system files” and “Hide file extensions”, and click on the OK button to close.
· At this point all files, including hidden files and modules are listed. Scroll down to locate the MyDriver.DLL file.
Alternatively, you can examine the operating system file nk.bin directly:
· With MyWinCE OS design project loaded, from VS2005 IDE, select File|Open|File… to bring up the Open File screen, and navigate to locate and open the following file:
\WINCE600\OSDesigns\MyWinCE\MyWinCE\RelDir\DeviceEmulator_ARMV4I_Release\NK.bin
· The NK.bin file contents are listed on the center tab, click on the “All files” node to list the files included as part of the NK.bin OS image, and search for the MyDriver.DLL file.
Summary
The MyDriver stream interface driver project is created to how to use the CEDriverWiz to create a stream interface driver wizard, and does not do anything.
While the MyDriver subproject in this app note does not have any function. The short exercise in this guide shows the CEDriverWiz is a useful tool to help simplify the CE 6.0 stream driver development tasks and save precious time.
CEDriverWiz project URL: