When a real target device is not available, you can use a Virtual PC as the target device to develop and test Windows Embedded Compact 7 application.
In this application note, we will go through the steps to develop an OS design for a Virtual PC and includes the necessary components to support managed code, native code and Silverlight for Windows Embedded application development.
For more information about the Compact 7 getting started series, visit the following URL:
To work through the exercises in this guide, we need to have the following software:
· Visual Studio 2008 with SP1.
· Windows Embedded Compact 7.
Fully functional evaluation versions of the above software, with 180 days usage limit, are available for download from the following URL:
When installing the Windows Embedded Compact 7 software, select the custom install option. For the supported CPU selection step, select the x86 processor. Do not select the other CPU, unless you plan to use them. When selecting an additional supported CPU, it will increase the installation size by as much as 10 GB.
Unless it’s necessary, do not select the auto update option. When selected, the auto update option will cause the installation program to download update from Microsoft during the installation process, which can be more than 10 GB.
Third Party Software:
In addition to the above, we will use the following AutoLaunch component to simplify the steps to include the necessary components, needed to establish connectivity to support application development:
The AutoLaunch component above is available for download from the following Codeplex project:
Note: Download and install the AutoLaunch component, after Compact 7 software is installed.
For the example in this writing, a Windows 7 Ultimate workstation with Virtual PC installed is used. Other version of Windows 7 with Virtual PC should works without problem.
In this section, we will work through the steps to develop an OS design project, customize the project, compile and generate an OS runtime image from the project. Then, download the OS runtime image to a Virtual PC for testing.
Creating a New OS Design
Work through the following steps to create a new OS design, using the Virtual PC BSP:
1. Launch Visual Studio 2008 (VS2008).
2. From the VS2008 menu, select FileàNewàProject to bring up the New Project screen.
3. From the Project types pane on left, select Platform Builder.
4. From the Templates pane on right, select OS Design.
5. Enter MyVPC as the name and click on OK to bring up the OS Design Wizard.
6. Click Next to continue and bring up the Board Support Packages selection screen.
7. From the “Select one or more BSPs” pane, select the “Virtual PC : x86” BSP and click Next to continue and bring up the Design Templates screen.
8. Expand the “Enterprise Device” node, select the Industrial Controller template and click Next to bring up the Applications and Media selection screen.
9. From the Applications and Media selection, select the following:
o .NET Compact Framework 3.5
o Console Window
o Internet Explorer 7.0
o Network User Interface
o Waveform Audio
o Windows Internet Services
10. Click Next to continue and bring up the Networking and Communications selection screen.
11. Keep the default selection and click Finish to continue.
12. A Catalog Item Notification screen is shown with security warning message to warn one or more of the selected components may pose security issue. Click Acknowledge to close the screen and complete the OS Design wizard steps.
At this point, the OS Design wizard created a project workspace for MyVPC, in the following directory:
Configure and Customize the OS Design
In this section, work through the following steps to configure and customize the OS design, by adding additional components, adjusting the build option and entering registry entries.
Work through the following steps to select additional components for the OS design:
1. From the VS2008 menu, select ViewàOther WindowsàCatalog Items View to bring up the Catalog Items View window.
2. Expand the BSP folder.
3. Expand the “Virtual PC : x86” node and all of the sub-folders under this node to select the following BSP components:
o SoundBlaster 16 Audio
o VCEPC Keyboard driver:WIN7VPC
o DEC 21x40 Ethernet
4. Under the “Core OS\Windows Embedded Compact” folder, locate and select the following components:
o \Applications – End User\CAB File Installer/Uninstaller
o \Applications and Services Development\SQL Compact\SQL Compact
o \Applications and Services Development\SQL Compact\SQL Compact Managed Provider
o \Shell and User Interface\Silverlight for Windows Embedded\Silverlight for Windows Embedded
o \Graphics and Multimedia Technologies\Graphics\DirectDraw
5. Expand the “Third Party\Embedded101” folder and select the following components:
o AutoLaunch CoreCon
The AutoLaunch component can be configured to launch one or more application during startup.
The AutoLaunch CoreCon sub-component, when selected, will include the necessary CoreCon files to the OS runtime image and launch the necessary executable during startup, needed to establish connectivity to the VS2008 IDE to support application development.
Next, work through the following steps to configure the build options for the OS design:
1. From the VS2008 menu, select ProjectàMyVPC Properties to bring up the MyVPC Property Pages screen.
2. From the left pane, expand the “Configuration Properties” node and select “Build Options”.
3. From the right pane, double click on “Enable KITL” to change the configuration from Yes to “No (IMGNOKITL=1)”.
4. Click Apply and then click OK to close the MyVPC Property Pages screen.
KITL is a connectivity component needed to support Compact 7 remote tools, to debug the OS runtime image.
Since we are going to generate an OS runtime image in release mode, KITL is not needed.
Registry plays a key role in controlling how a Compact 7 OS runtime image’s startup, launching the required device drivers and necessary software components to support the intended functions. Many of the Compact 7 components will not function without appropriate registry configuration.
By default, a network enabled Compact 7 OS runtime image is built with DHCP enabled to acquire IP address dynamically during startup.
For the exercise in the writing, we are using a loopback network adapter, with static IP address, to establish connectivity between the Virtual PC and the development workstation.
Work through the following steps to add registry entries to configure the OS runtime with a preconfigured static IP address:
1. From the VS2008 menu, select ViewàSolution Explorer to bring up the Solution Explorer window.
2. Expand the “Parameter Files” folder and double click on OSDesign.reg to open this registry file in the center code editor window.
3. From the code editor window’s lower left, click on Source to view the OSDesign.reg file in source format.
4. Append the following registry entries to the OSDesign.reg file:
Build and Generate OS Runtime Image
In the previous sections, we created, customized and configured the MyVPC OS design. The OS design is now ready to be built to generate an OS runtime image for the target device, a Virtual PC.
From the VS2008 menu, select BuildàBuild Solution to build and compile the project.
Instead of using the Build Solution option above, we can use the following option to build and compile the OS design:
· BuildàAdvanced Build CommandsàSysgen (blddemo –q)
Do not use the “Build and Sysgen” option, doing so will delete some of the binary files, which you don’t have the source to rebuild.
After the build process is completed, an OS runtime image, NK.BIN, is generated in the following directory:
To download Compact 7 OS image to a Virtual PC, we need to establish network connectivity between the Visual Studio 2008 IDE and the Virtual PC.
For the exercise in this writing, we use a loopback adapter with static IP addresses. For information about setting up the loopback adapter for Windows 7 and Virtual PC, refer to the following article:
· Loopback Adapter with Virtual PC as Target Device for Compact 7 Development
A Virtual PC preconfigured with Compact 7 bootloader is provided as part of the Virtual PC BSP for Compact 7, in the following directory:
To establish connectivity to the Virtual PC, the loopback adapter for the development workstation is configured with the following static IP address:
IP Address: 192.168.2.132
Subnet Mask: 255.255.255.0
Creating Connectivity Profile for the Virtual PC
To establish connectivity to download OS runtime image to the Virtual PC, we need to configure a target device connectivity profile and associate the profile to the Virtual PC.
Work through the following steps to create a target device profile and associate this profile with the Virtual PC:
1. From the VS2008 menu, select TargetàConnectivity Options to bring up the Target Device Connectivity Options screen.
2. From the left pane, click on Add Device.
3. Enter MyVirtualPC as the new target device name and click Add to continue.
4. On the right, click the top most Settings command button to bring up the Ethernet Download Settings screen.
At this point, the Ethernet Download Settings screen is waiting for the BOOTME messages from a target device.
Configuring the Virtual PC
Next, we need to configure the Virtual PC to launch the bootloader with an appropriate static IP address, in order to associate the Virtual PC with the MyVirtualPC profile created in the previous step.
Work through the following steps to configure the Virtual PC.
1. Launch the Virtual PC by double click on the following file:
2. As the CEVM virtual PC boot up, it repeatedly display 5 of the following message:
o Hit space to enter configuration menu …
3. Hit space to enter the Main Configuration menu.
4. From the main menu, press 4 to enter the Network Settings menu.
5. From the Network Settings menu, press 5 to enter the following IP address:
For the example in this writing, the development workstation is configured with a loopback adapter with the following static IP address:
To establish connectivity to the development workstation, the Virtual PC must be configured with a different IP address within the same subnet.
The IP address configuration for the bootloader is separate from the Compact 7 OS runtime image.
After the OS image is downloaded and launched on the Virtual PC, it OS’s driver reinitialize the Ethernet connection and acquire or assign IP address based on the OS’ configuration.
In the earlier OS design configuration step, we added registry entries to configure the following IP address for the OS:
The IP address configured for the OS design is different from the IP address for the bootloader.
6. From the Network Settings menu, press 4 and follow information on the screen to disable DHCP.
7. From the Network Settings menu, press 0 to exit and move back to the Main Menu.
8. From the Main Menu, press 7 to save the settings.
9. Press 0 to exit.
After the above steps, the Virtual PC launches the bootloader and display a series of the following message, as it broadcast BOOTME packages to the attached network (in the case the loopback network adapter):
· Send BOOTME Message (device name PC-xxxxxxxxx, attempt xx)
The Virtual PC will continue to broadcast the above message and time out after 60 messages.
Associating Virtual PC to the Connectivity Profile
As the Ethernet Download Settings screen detected the BOOTME packets from the Virtual PC, the following information is shown on the screen’s Active target devices pane:
IP Address: 192.168.2.230
Boot Loader Version: 1.0
From the Ethernet Download Settings screen, click on the detected device listed in the Active target devices pane and click Apply.
From the Target Device Connectivity Options screen, click Apply and then click Close.
Downloading OS Image to Virtual PC
From the VS2008 menu, select Target à Attach Device to establish connectivity and download OS runtime image to the Virtual PC.
A Device Status screen is shown with information to indicate connectivity and OS image download status.
At this point, if the Virtual PC is still sending broadcasting BOOTME packets, the Download status bar on the Device Status screen will show downloading activity.
If the Virtual PC already timed out and stop broadcasting BOOTME packet, shut down and re-launch the Virtual PC. As the Virtual PC startup and broadcast BOOTME packets, the OS image download will take place.
As the OS runtime image is downloaded, the Compact 7 desktop will show as the OS image boot up on the Virtual PC.
Other than being a virtualized device, the Virtual PC actually behaves pretty close to a real x86 hardware.
Using a Virtual PC as the target device, we can create an environment to develop and test Compact 7 application without real hardware.
Using the OS runtime image and Virtual PC from the exercise from the exercise in this application note, we can work through the managed, native, Silverlight-for-embedded and SQL Compact application in part-4, part-5, part-6 and part-7 of this getting started series.
For information about Compact 7 OS design and connectivity to download OS runtime image, using real target device (eBox-3300MX), refer to the following application notes:
· Compact 7 Getting Started Part-3: Develop an OS Design
· Connectivity to Download Compact 7 OS Runtime Image to Target Device
Hi Samuel, I was following "The Compact 7 Getting started series" with a Virtual PC, I am a newbie with windows embedded and the tutorial is excellent. But I made a mistake. I used the "Build and Sysgen" option, I was wondering if there is any form to repair the binary files that accidentally I deleted. I tried reinstalled the BSP from the Windows Embedded Compact7 installer and it didn't work. I don't want to install all again.
View this page in another language: