In part-2 of this Windows Embedded Compact 7 (Compact 7) getting started series, we will talk about the development environment, required software and connectivity between the development workstation and the target device.

Note:

The Compact 7 getting started series consist of 9 different articles, covering the following subjects:

1.        Introduction.

2.        Development Environment & Tools.

3.        Develop a Compact 7 OS Design.

4.        Develop Managed Code Application for Compact 7.

5.        Develop Native Code Application for Compact 7.

6.        Develop SQL Compact Database Application for Compact 7.

7.        Develop Silverlight for Windows Embedded Application for Compact 7.

8.        Debug and Remote Tools.

9.        Deploy OS Runtime to Target Device for Distribution.

Refer to part-1 (introduction) for more information.

The following subjects are covered in part-2 of this series:

·         Brief introduction to Windows Embedded Compact 7:  While background information about the Windows Embedded Compact 7 product does not have direct impact to help technical learning, it’s helpful to know the efforts and resources invested to develop and maintain this product.

·         Development Environment Overview:  Without a proper development environment, you are not able to develop and generate the intended result.  Before embarking on a journey to learn any technology, you need to take a good look at the development environment and understand how to setup a proper environment.

·         Required Software and Installation:  Improper software installation, setup and missing components are common obstruction to learn and engage in using new technology.  The Compact 7 development environment involves multiple development tools and update components.  Be sure to review this section carefully to help prevent problems later on.

·         Development Environment Connectivity:  In order to download OS runtime image and application from the development PC to the target device for testing and debugging, we need establish proper connectivity between the development PC and the target device.

Note:

Improper development environment, missing software components and improper software installation are common problems for developer new to the Compact 7 development environment. 

The time invested to understand the development environment and installing all of the required software in proper sequences helps prevent problem and avoid unnecessary aggravation later on.

Windows Embedded Compact 7 Introduction

Windows Embedded Compact 7 is the latest version of Windows Embedded Compact, formerly known as Windows CE.

Initially released to the public in 1996, the Windows Embedded Compact product has been through over 15 years of continuous development, improvement and adopted by key companies globally as the technology platform to develop products for different industries.

There are other Microsoft products that use Windows Embedded Compact as the core OS, such as:

·         Windows Embedded Automotive 7

·         Windows Embedded NavReady

·         Windows Phone 7 and Mango

·         Windows Mobile

·         Windows Network Projector

Windows Embedded Compact is a 32-bit, small-footprint, hard real-time OS with graphics and multimedia support, developed from the ground up to support multiple family of processors, including ARM, MIPS and x86.

Embedded Devices

Windows Embedded Compact provides an efficient development platform to develop broad ranges of specialized purpose devices, serving different vertical markets, such as:

·         Automotive

·         Consumer

·         Engineering and scientific instrument

·         Home and building automation

·         Industrial automation, process control and manufacturing

·         Information kiosk and self-serve terminal

·         Medical device and instrument

·         Mobile phone and communication device

·         Office equipment

·         Retail and hospitality

·         Robotics

Embedded Application Development

Windows Embedded Compact provides an efficient and effective environment that helps simplify complex development tasks and enables developers to rapidly create custom OS runtime image and application for their embedded device, with help from preconfigured templates and large pool of software components.

The Windows Embedded Compact’s efficient development tools, production quality software components, debugging and testing tools provide a development environment suitable for large and small team, enable business manager to establish manageable development projects with minimal risks. 

In addition to the efficient development tools advantage, Windows Embedded Compact software technology components incorporated into the final product for distribution are protected against patents and copyrights claim by Microsoft, which is part of the intellectual property indemnification clause within the Windows Embedded Compact software license agreement.

Windows Embedded Compact provides large pool of technologies to support native and managed code application written in C++, C# and Visual Basic, such as:

·         Win32, Active Template Library

·         .NET Compact Framework

·         COM, DCOM

·         Message Queuing (MSMQ)

·         SOAP, OBEX

·         SQL Compact

·         TCP/IP, IPSec, IPv4, IPv6

·         Wireless networking

·         Simple Network Management Protocol (SNMP)

·         RAM and ROM file system

·         File system and storage manager

·         Fonts

·         Graphics and Multimedia technologies

·         Browser, Internet Client components

·         Security, Authentication & Cryptograhpy

·         Silverlight for Windows Embedded

·         More…

For more information about Windows Embedded Compact, visit the following URLs:

Windows Embedded Compact Product Information on Microsoft website:

http://www.microsoft.com/windowsembedded/en-us/develop/windows-embedded-compact-7-for-developers.aspx

Windows Embedded Compact developer documentation on MSDN:

http://msdn.microsoft.com/en-us/library/ee504813.aspx

 

Development Environment Overview

The primary development tool used to develop Compact 7 OS design is Platform Builder.  For Compact 7, Platform Builder is a plug-in to the Visual Studio 2008 integrated development environment (VS2008 IDE).  All Compact 7 development tasks are supported within the VS2008 IDE, a developer friendly, efficient and intuitive development environment with templates and wizard to help simplify complicate development tasks.

Note:

The previous version, Platform Builder for Windows Embedded CE 6.0, is a plug-in to the Visual Studio 2005 IDE.  For Windows CE 5.0 and earlier versions, Platform Builder is a standalone development tool.

Following is a Compact 7 development environment graphical view, as shown in Figure 1:

Fig-01

Fig. 01   -      Compact 7 Development Environment

Compact 7 Platform Builder, a plug-in to the VS2008 IDE, is the tool needed to develop the OS runtime image for the target device.  An SDK is generated from the same OS design project, which generated the OS runtime image, to support application development, in managed and native code using C#, Visual Basic or C++, from the VS2008 IDE.

Note:

For most of the larger team, OS design (Platform Builder) and application (Visual Studio 2008) development tasks are separated on different machines.  For smaller team, both the OS design and application development tasks can be perform from the same development PC.


Development PC

The exercises in this series of getting started guide are created on a Windows 7 PC with the following software installed:

·         Visual Studio 2008 Professional with service pack 1

Note:

The Express version of Visual Studio 2008 does not support Windows Embedded Compact.

·         Windows Embedded Compact 7

·         Visual Studio 2008 update for Windows Embedded Compact 7

·         ICOP_eBox3300MX_70D board support package (BSP)

The ICOP_eBox3300MX_70D BSP is available for download from the following URL:

http://www.embeddedpc.net/eBox3300MX/

·         AutoLaunch for Compact 7 -- Available for download from the following URL:

http://autolaunch4ce.codeplex.com

Note:

The AutoLaunch component can be configured to launch one or more application and/or OS components during startup.

·         DiskPrep power toy -- Available for download from the following URL:

http://archive.msdn.microsoft.com/DiskPrep

Note:

The DiskPrep utility is used to format flash storage and place BIOSLoader, a boot loader, on to the flash storage to launch Compact 7 OS.

The Target Device: eBox-3300MX

Within the Compact 7 development environment, the term target device is referring to the hardware platform to develop the Compact 7 device.  For the exercises in this getting started guide, the eBox-3300MX (eBox) is used as the target device.  The eBox is built with the following:

·         1.0 GHz Vortex86DX processor with 512 MB RAM

·         VGA, Audio, 10/100Mbps Ethernet, 3 USB 2.0 host interfaces, 2 serial ports, PS/2 keyboard and mouse.

·         An SD flash storage is used as the bootable device.

The ICOP_eBox3300MX_70D BSP, as shown in Figure 2, which includes the necessary hardware adaptation codes, device drivers and configuration files to support Compact 7 OS development for the eBox, is used for the exercises in this guide.

eBox3300MX-70D-BSP

Fig. 2 – ICOP_eBox3300MX_70D BSP for Compact 7

Common Terminology

To minimize the need to write long description and the need to use lengthy term repeatedly, it’s a common practice for developer in different industries to use abbreviated key words.  To the new comer, without knowing the terminologies used and what the abbreviated key words represent can cause confusion.

The following table contains abbreviation for some of the common key words used in the Compact 7 development environment and this series of getting started guide:

Abbreviation/ key word

Description and Representation

Compact 7

Windows Embedded Compact 7

Platform Builder

Windows Embedded Compact 7 Platform Builder

VS2008

Visual Studio 2008

IDE

Integrated Development Environment

BSP

Board Support Package:  A group of Windows Embedded Compact software components that includes the OEM adaptation layer code, device drivers and configuration files, needed to create the OS design project to generate OS runtime image for the targeted hardware.

OAL

OEM Adaptation Layer

Component

Component can be a device driver, BSP, programming library, application, utility, configuration settings, fonts, etc... The OS design is made up by a group of components.

Component Catalog

The component catalog lists all of the components provided by Platform Builder and installed 3rd party components.  The component catalog provides the interface to add components to the OS design project and remove components from the project.  This is also the interface to view which components are included to the OS design project.

OS design

OS design is a Platform Builder project, containing components that make up the OS runtime image.  Windows Embedded Compact OS runtime image is generated from an OS design project.

Target Device

Refer to the device used in the Compact 7 development environment.  When working on exercise using a VirtualPC, the VirtualPC is the target device.    For the exercise in this guide, the eBox-3300MX hardware is the target device.

OS

Operating System

OS Runtime Image

The binary file generated from the OS design project to deploy to the target device.

Release Directory or Build Release Directory

Referring to the directory where all files related to the OS design projects are placed by the build tools prior to compiling the OS runtime image.

 

Compact 7 Environment and Directory Variables

Within the Compact 7 development environment, environment variables are used to configure the OS design to include, exclude associated components and control certain system behaviors.  Directory variables representing the associated directory are used to help make the codes and script easier to understand and read.  Here are some of these variables:

Variable Name

Description - Purpose

BSP_DISPLAY_NOP

Configure the OS design to include the stub display driver (DDI_NOP.dll) to support headless device.

BSP_NOAUDIO

Configure the OS design to exclude all audio components from the build.

IMGRAM256

Configure the OS design to generate runtime image supporting 256MB of RAM

PRJ_ENABLE_FSREGHIVE

Configure the OS design to enable Hive-based registry support

_WINCEROOT

Defines the root directory for the Compact 7 install, default is:

    C:\WINCE700

_PLATFORMROOT

Represent the following directory:

$(_WINCEROOT)\PLATFORM

  Or

C:\WINCE700\PLATFORM

The above table lists a small sampling of variables used in the Compact 7 development environment.  For more information about Compact 7 environment variables, visit the following URLs:

About Environment Variables:

http://msdn.microsoft.com/en-us/library/gg154986.aspx

 

BSP Environment Variables:

http://msdn.microsoft.com/en-us/library/ee478674.aspx

 

IMG Environment Variables:

http://msdn.microsoft.com/en-us/library/ee479025.aspx

 

PRJ Environment Variables:

http://msdn.microsoft.com/en-us/library/ee479112.aspx

 

Miscellaneous Environment Variables:

http://msdn.microsoft.com/en-us/library/ee479008.aspx

OEM Environment Variables

In addition to the environment variables established by Microsoft, hardware manufacture can establish environment variables unique to their BSP to support the intended target device.  The following environment variables are unique to the ICOP_eBox3300MX_70D BSP:

Variable Name

Description - Purpose

BSP_VORTEX86DX_IDE

Environment variable for IDE block storage driver..

BSP_NIC_R6040

Environment variable for the R6040 Ethernet driver

BSP_DISPLAY_XGI

Environment variable for the XGI Z9s display driver.

BSP_Enable_AgressiveFlush

When Hive-based registry is enabled, “Aggressive flush” is disabled by default.  When this variable is set, it configures the registry to enable “Aggressive flush”..

 

Required Software and Installation

The following software components are needed to work through the exercises:

·         Visual Studio 2008

·         Visual Studio 2008 service pack 1

·         Windows Embedded Compact 7

·         Visual Studio 2008 update for Windows Embedded Compact 7

·         ICOP_eBox3300MX_70D BSP

·         AutoLaunch_v300_Compact7.msi

Recommended Software Installation Sequence

It’s important to install the software in their proper sequences.  Here is the recommended software installation sequence:

·         Visual Studio 2008

·         Visual Studio 2008 service pack 1

Visual Studio 2008 service pack 1 is available from the following URL:

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=fbee1648-7106-44a7-9649-6d9f6d58056e

·         Windows Embedded Compact 7

A 180 days evaluation version of Compact 7 software is available for download from Microsoft, at the following URL:

http://www.microsoft.com/windowsembedded/en-us/downloads/download-windows-embedded-compact-ce.aspx  

Note:

If you plan to use the same development PC to develop OS design and Silverlight for Windows Embedded application, you should install Expression Blend 3 prior to Windows Embedded Compact 7.  Otherwise, you need to install the Silverlight for Windows Embedded template after installing Expression Blend 3.

·         Visual Studio 2008 update for Windows Embedded Compact 7

VS2008 update for Compact 7 is available for download from Microsoft, at the following URL:

http://www.microsoft.com/download/en/details.aspx?id=11935   

·         ICOP_eBox3300MX_70D_BSP.msi

This BSP is available for download from the following URL:

http://www.embeddedpc.net/eBox3300MX/   

·         AutoLaunch_v300_Compact7.msi

The AutoLaunch component is available for download from the following URL:

http://autolaunch4ce.codeplex.com    

Windows Embedded Compact 7 Installation

Since the Compact 7 development tool, Platform Builder, is a plug-in to the VS2008 IDE, VS2008 must be installed to the develop workstation prior to installing the Compact 7 software.

When installing the Compact 7 software, during the installation options selection, select the Custom install option, as shown in figure 3.

Fig-03-Compact7-Install-07

Fig. 3      -      Installation Options (Custom install)

During the supported processor selection step, select the processor you plan to work with.  To support the exercises in this guide, include support for the x86 Architecture, as shown in Figure 4.

Note:  Do not include processor architecture which you are not going to use, doing so will significantly increase the required storage and time to complete the installation.

Fig-04-Supported-CPU

Fig. 4      -      Supported processor architecture

Note:

It’s strongly recommended to install all software to the default installation directory.  Some of the 3rd party components used for the exercises in this guide assume all software components are installed to the default directory.  When the software components are installed to a different directory, the 3rd party components may not function as expected.

Board-Support-Package Installation

VS2008 and Compact 7 must be installed prior to installing the Board-Support-Package (BSP).  The ICOP_eBox3300MX_70D BSP is available for download from the following URL:

http://www.embeddedpc.net/eBox3300MX/

After installation, this BSP shows up on the Platform Builder 2008 component catalog as “ICOP_eBox3300MX_70D : x86” under the “\Third Party\BSP” folder.

AutoLaunch Component Installation

The AutoLaunch component for Compact 7 in self-installable file format, AutoLaunch_v300_Compact7.msi, is available for download from the following URL:

http://autolaunch4ce.codeplex.com

After installation, this component shows up on the Compact 7 Platform Builder component catalog as “AutoLaunch_v300_Compact7” under the “\Third Party\Embedded1 on 1” folder.

 

Development Environment: Connectivity

It’s important to establish a proper development environment and understand the different options available to establish connectivity between the development PC and the target device, needed to download OS runtime image and deploy application to the target device for testing and debugging.  This section talks about connectivity between the development PC and the target devices for the exercises in this series, using the eBox as the target device.

Ethernet Connectivity

For the exercises in this guide, Ethernet is the primary connectivity used in the development environment with both the development PC and target device connected to the same Local Area Network (LAN).

Ethernet connectivity is used to download the OS runtime image from the development PC to the target device and deploy application to the target device for testing and debugging.

Serial Debug Connectivity

Serial Debug connectivity, to capture serial debug message, is established by connecting a null RS-232 serial modem cable between a serial port on the target device and an available serial port on the development PC.  Serial connection is useful for debugging headless device and the device’s startup process during the bootloader phase where the Compact 7 OS runtime has not been fully launched.

Note:

The target device’s COM1 is used by default to send out serial debug messages.  It’s possible to configure the target device to send serial debug messages using a different serial port.

With a null RS-232 serial modem cable connected, serial debug messages from the target device can be viewed using a terminal emulation program such as Hyper Terminal or similar program, configured to 38400-8-N-1.

Note:

Hyper Terminal provided as part of the Windows XP OS is no longer available for Windows Vista and Windows 7.

If you have Windows XP, the Hyper Terminal application available as part of the Windows XP OS does work under Windows Vista and Windows 7.

To use Hyper Terminal from Windows XP, copy the following files from the Windows XP machine:

    -  Hypertrm.exe

    -  Hypertrm.dll

Place both of the above files to the same folder on the Windows Vista or Windows 7 machine and launch the Hypertrm.exe executable to start Hyper Terminal.

 

Development Environment Setup with DHCP

One of the common development environments to support Compact 7 development is to attach both the development PC and target device to the same LAN with DHCP service to provide IP addresses dynamically with a null RS-232 serial modem cable connected between one of the serial port on the target device and an available serial port on the development PC.

Here is a typical setup to connect both the development PC and target device to a LAN with DHCP service, as shown in Figure 5.

Fig-05

Fig. 5      -      Development environment with DHCP service provider

If the target device fails to establish connectivity with the development PC as expected with this configuration, it may be caused by one of the following:

·         The development PC’s firewall software may be blocking the connection

·         DHCP service for the target device needs to be enabled on your network.  Some secured network may require the target device’s MAC address to be added to the authorized device list to be serviced by the DHCP server

Using Wireless Access Point Router

When using a wireless-access-point-router with multiple Ethernet ports, connecting both the development PC and target device directly to the Ethernet port on the wireless-access-point-router may be problematic with certain model of access point, and prevent the development environment from functioning as expected.

Note:

The wireless-access-point-router device’s routing function filter and route network packets based on the packet’s associated origin, destination and other information.  In some router, the routing algorithm may prevent some of the packets between the development PC and target device from reaching its destination and cause problem.

To minimize connectivity problem, instead of connecting directly to the wireless-access-point-router device’s Ethernet ports, attach an Ethernet network hub to the wireless-access-point-router device, to access the DHCP service provided by the wireless-access-point-router, connect both the development PC and target device to the Ethernet network hub.  With both the development PC and target device connecting to the same Ethernet hub, the network traffics between them are not filtered.

Development Environment Setup with Static IP

It’s possible to establish a Compact 7 development environment with Static IP addresses.  Here are two scenarios for setting up the development environment using static IP addresses:

      Local Area Network without DHCP Service

The development PC and target device are connected to the same LAN or Ethernet Hub, without DHCP service, as shown in Figure 6.

Fig-06

Fig. 6      -      LAN without DHCP

 

Direct Connection using Cross-Over RJ-45 Ethernet Cable

Connectivity can be established by attaching the target device to the development PC directly, using a cross-over RJ-45 Ethernet cable, as shown in Figure 7.

Fig-07

Fig. 7      -      Direct connection with cross-over RJ-45 Ethernet cable

 

Static IP Addresses

Without DHCP service to assign IP addresses dynamically, the target device and development PC must be configured with appropriate static IP addresses in order to establish connectivity.  Both the development PC and target device must be configured with static IP addresses within the same subnet. 

Target Device:  eBox-3300MX

Within the Compact 7 development environment, the term target device is referring to the hardware platform being used.  For the exercises in this series of getting started guide, an eBox-3300MX is used as the target device.

 

      Required Software:  Bootloader

In order to launch Compact 7 OS image from the target device’s local storage, the target device needs to be configured with an appropriate boot loader.  For the exercises in this series of getting started guide, the eBox is configured with BIOSLoader, a bootloader for x86 device.

In order to establish connectivity to the Platform Builder development PC, to download Compact 7 OS image, the target device needs to be configured with an appropriate network bootloader.  For the exercises in this series of getting started guide, the eBox is configured with Eboot, an Ethernet bootloader.

 

Target Device Preparation using DiskPrep

For the exercises in this series, an SD flash storage is used as the bootable storage for the eBox.  The DiskPrep power toy is used to configure the SD flash storage with FAT file system and boot loader.

The DiskPrep power toy is available for download from the following URL:

·         http://archive.msdn.microsoft.com/DiskPrep

Additional information about DiskPrep and steps to configure the flash storage to launch Compact 7 OS runtime image are provided in another blog entry, “Configure Flash Storage to Launch Compact 7 OS Image Using DiskPrep”.