Explore 1.5M+ audiobooks & ebooks free for days

Only $12.99 CAD/month after trial. Cancel anytime.

Professional Windows Embedded Compact 7
Professional Windows Embedded Compact 7
Professional Windows Embedded Compact 7
Ebook1,360 pages10 hours

Professional Windows Embedded Compact 7

Rating: 0 out of 5 stars

()

Read preview

About this ebook

Learn to program an array of customized devices and solutions

As a compact, highly efficient, scalable operating system, Windows Embedded Compact 7 (WEC7) is one of the best options for developing a new generation of network-enabled, media-rich, and service-oriented devices. This in-depth resource takes you through the benefits and capabilities of WEC7 so that you can start using this performance development platform today. Divided into several major sections, the book begins with an introduction and then moves on to coverage of OS design, application development, advanced application development, how to deploy WEC7 devices, and more.

  • Examines the benefits of Windows Embedded Compact 7 (WEC7)
  • Reviews the various elements of OS design, including configuring and building a customized OS runtime image, using debugging and remote tools, and more
  • Explains how to develop native code applications with Visual Studio 2010, develop database applications with SQL server compact, and use the application deployment option
  • Discusses how to deploy a WEC device, use the boot loader, launch WEC using BIOSLoader, and deploy a WEC power toy

If you're interested in learning more about embedded development or you're seeking a higher performance development platform, then this is the book for you.

LanguageEnglish
PublisherWiley
Release dateAug 15, 2011
ISBN9781118167489
Professional Windows Embedded Compact 7

Related to Professional Windows Embedded Compact 7

Related ebooks

Software Development & Engineering For You

View More

Reviews for Professional Windows Embedded Compact 7

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Professional Windows Embedded Compact 7 - Samuel Phung

    PART I

    Introducing Embedded Development

    CHAPTER 1: Embedded Development

    CHAPTER 2: Windows Embedded Compact 7

    CHAPTER 3: Development Station Preparation

    CHAPTER 4: Development Process

    CHAPTER 5: Development Environment and Tools

    Chapter 1

    Embedded Development

    WHAT’S IN THIS CHAPTER?

    Defining an embedded device

    Using software for an embedded device

    Establishing key elements for embedded development

    Embedded development has been around for decades. The terms such as embedded system and embedded computer are widely used by marketing professionals across multiple industries. However, the actual meaning and representation for the term embedded is still vague.

    Although it’s not within this book’s objective to delve into the definition for the term embedded, you need to understand a general boundary for the embedded device, embedded software, and development environment relevant to Windows Embedded contents in this book.

    WHAT IS AN EMBEDDED DEVICE?

    When referring to an embedded device, some of you may still think of the small devices, typically built with a microcontroller with limited processing capability and memory. Contrary to this thinking, many embedded devices in today’s market are built with a powerful processor, abundant memory, and storage.

    Some of the current embedded devices are built with computing technology that can rival an enterprise class server from just a few years ago. Not too long ago, enterprise servers were built with processors that operate in the sub gigahertz (GHz) range, with system memory in the 100 megabyte (MB) range and storage in the gigabyte (GB) range.

    Today, many of you use smartphones built with a GHz processor, 512MB or more system memory, and 8GB to 32GB of storage.

    As technology rapidly advances and enables more powerful processor modules with more integrated features to be built in a smaller footprint at a lower cost, it enables a new generation of consumer, industrial, medical, robotics, education, and other devices to be built with better and innovative features that can deliver these devices to the market with a higher perceived value at a lower cost.

    Today, using available technology, embedded devices can be built with a broad range of capabilities, with processors ranging from low-power, 8-bit microcontrollers with limited memory to powerful processors with CPU clocks operating in the GHz, memory in the GB, and storage in the 100-GB range. With some imagination and creativity, the possibilities for embedded devices are endless.

    Similarity to Personal Computer

    From a general architecture point of view, an embedded device has many similarities to a typical personal computer (PC).

    It has a processor.

    It has system memory.

    It has storage to store software.

    It requires software applications to be useful.

    Difference from Personal Computer

    Although a general purpose PC is designed to enable the user to install different operating systems and software applications to perform different tasks, an embedded device is built with preconfigured software, designed to perform a specific set of tasks and functions.

    Table 1-1 shows some of the differences between the PC and embedded device.

    TABLE 1-1: Personal Computer and Embedded Device Comparison

    Specialized Purpose Device

    An embedded device is a specialized purpose device designed to serve a specific purpose and built to meet designated specifications and cost objectives.

    For some markets, the same hardware used to build a general purpose PC can be used to build a specialized purpose embedded device; therefore, making the distinction between an embedded device and personal computer vague.

    Following are two separate application scenarios that use similar hardware. One of them is categorized as a general purpose computer and the other as a specialized purpose device:

    A small retail store owner uses a computer as a point-of-sale terminal. In addition, this store owner uses the same computer to send and receive e-mail using Outlook, to write business letters using Word, and to install additional software onto the PC to perform accounting and record keeping-related tasks.

    A major department chain store uses computers as point-of-sale terminals for each of its branch locations. To minimize service and support issues and to simplify management tasks, the computers are configured to perform only point-of-sale-related tasks. The computers are also configured to not enable additional software to be installed and limit access to its system to prevent existing software accidentally being removed.

    In the first preceding scenario, the store owner uses the computer as a general-purpose PC. In the second scenario, the department chain store uses the computer as a specialized-purpose device.

    Example of Embedded Devices

    Embedded devices are all around you. Think about your daily living, when you travel, visit a theme park, interact with a financial institution, use entertainment devices in your home, drive your automobile, and so on.

    Following are examples of some of the embedded devices in today’s market:

    Mobile phone

    Set-top-box

    Television

    Media entertainment system

    Printer

    Portable media player

    GPS navigation device

    Credit card processing terminal

    Automated ticketing machine

    Digital camera

    Medical instrument

    Engineering instrument

    Network router

    Information kiosk

    Automated teller machine

    Video projector

    Self-serve checkout station at your local super market

    WHAT IS EMBEDDED SOFTWARE?

    While software applications for general purpose PCs are designed to function on a broad range of computers, built by different manufacturers that meet general requirements (such as processor speed, available memory, and storage), software developed for the embedded device is intended for one specific model or category of devices.

    Comparing to software for general purpose PCs, following are the main differences for embedded software:

    Designed to operate on hardware with limited resources.

    Application codes are tightly coupled with hardware.

    Errors and exceptions can’t be thrown to the user.

    Programming Languages and Principles

    Other than the different development considerations, which will be explored later in this chapter, similar programming languages and principles apply to developing Windows applications for a desktop PC and embedded applications for a Windows Embedded Compact device.

    If you are developing desktop PC applications using Visual Studio 2005 and 2008, you are already familiar with the Visual Studio application development environment for Windows Embedded Compact. With little more effort, you can easily adapt existing Visual Studio experience to develop Windows Embedded Compact applications.

    Programming Discipline

    When developing applications for a general-purpose desktop PC, you can make the following assumptions about the PC, without considering the end user’s environment in detail:

    It’s equipped with a 1.0 GHz or faster processor.

    It has at least 1GB or more of system memory.

    It has a hard disk with abundant storage space, in the 100GB range.

    The video output is capable of supporting a 1024×768 or better display resolution.

    A keyboard and mouse are used to capture user input.

    A network connection is available.

    When developing applications for an embedded device, you cannot make any of the preceding general assumptions and must have details and accurate information about the device’s features and capability. You also need to have a clear understanding about the device’s operating environment and how the end users interact with the device. The embedded device may be built with the following features:

    Headless without a user interface

    Limited system memory and storage

    Battery powered

    A few hardware buttons to capture user input

    You also may be required to develop applications for an embedded device to meet one or more of the following design objectives:

    Minimize power consumption to extend operating time for battery-powered devices.

    Minimize memory and resources leakage for devices that operate 24/7.

    Meet the hard real-time characteristic for the timing critical device that requires the application to perform required tasks within a specified time slot.

    Prevent file corruption resulting from unexpected loss of power to the device.

    Develop applications to directly access and control the device’s hardware.

    Develop applications to access a headless device (built without a user interface) remotely for service and maintenance purposes.

    Develop applications to perform self-diagnostic functions and implement automated routines to correct errors found.

    Seasoned embedded developers develop the discipline to account for additional design considerations from their experience, which may include technical issues, user interactions, and an operating environment related to the final product. Often, these additional design considerations are not part of the specifications and requirements; however, in many cases, these additional design considerations are critical to the project’s success.

    Specialized Purpose Application

    Although software for the PC is designed to operate on all desktop and portable notebook computers that meet a general technical specification, embedded software is a specialized-purpose application designed to run on one particular class or category of specialized-purpose device.

    Software for the PC is designed to enable the end user to install and remove the application at will. However, embedded software is usually shipped as a preinstalled component on the device and is designed to limit the end user’s ability to remove the software from the device or to make changes.

    DEVELOPMENT CONSIDERATIONS

    Embedded development skill is a discipline that cumulates and improves over time, with active engagement and hands-on involvement in the actual embedded development projects.

    Operating systems, programming languages, and the hardware platforms are tools used by the developer to design, compose, and build embedded devices.

    Whether working on a PC or an embedded device development project, you can have similar development concerns and needs, such as the following:

    Firmware

    Operating system

    Hardware adaptation codes

    Device drivers for peripherals

    File system

    Network protocol stack

    Codecs

    Support libraries

    Application

    An embedded device development project can involve any or all these concerns. To be effective, an embedded developer needs to have a good understanding about the device’s operating environment, how the user uses the device, the hardware platform, and design objectives.

    Different categories of embedded device design objectives are quite different, such as the following:

    A consumer-oriented device needs to meet the targeted performance at the least cost, sufficient for the device to meet the 1-year to 3-year warranty period.

    In addition to meeting the targeted function requirements, many embedded devices designed for industrial applications need to meet strict quality requirements, operate 24/7, and survive a harsh operating environment that involves a wide operating temperature range from −40°C to +85°C and exposure to high humidity and chemical conditions.

    In general, when working on an embedded development project, in addition to the design specification, the development team needs to consider the following:

    Hardware

    Operating environment

    User environment

    Hardware

    In addition to the direct impact to the cost of manufacturing, the selected hardware can affect the development schedule and engineering cost. When selecting the hardware, you need to consider the following:

    Is the required hardware readily available in the market?

    Are there sufficient components available in the market and engineering resources to develop customized hardware for the project?

    Is the selected hardware’s processor architecture supported by the selected operating system?

    Can the hardware vendor provide support for the selected operating system?

    Does the selected hardware provide the best value from an overall project perspective? (Lower-cost hardware may require additional development, have limitations that create other cost centers, raise the overall project cost, and significantly impact the project’s time-to-market schedule.)

    Operating Environment

    To develop a good product, you need to understand how the product is used and the environment the product needs to operate in. You need to take into account the following considerations, which may impact the hardware requirements:

    How can the embedded device be used?

    What temperature range is the device expected to operate in?

    Can the device operate 24/7?

    Can the device be deployed on an automobile, a vessel, or an airplane?

    Can the device be subjected to vibration and shock during operation?

    Can the device be subjected to strong electrostatic shock during operation?

    Can the device be placed in an outdoor environment?

    User Environment

    User expectation is one of the most important factors. If the embedded device does not meet user expectation, the user is not likely to purchase or use the device.

    Feasibility

    From an engineering perspective, with sufficient resources and time, the development team can engineer a perfect device. In real life, all development projects are bounded by the following:

    Limited development resources and budget.

    Development must be completed within a predetermined schedule.

    After all the technical, environment, and user requirements are met, the product development team also needs to consider the required resources and time needed to successfully complete all required development tasks. These considerations can have a strong impact on the business’ cost, profit, and time-to-market and can influence whether to move the project forward.

    SUMMARY

    Embedded development is an engineering discipline that involves multiple technical skills, covering both hardware and software. As technology rapidly changes and evolves, the embedded development environment will continue to change, adopt new technology, and create new ways to do things.

    A career in the embedded development field can be challenging and rewarding at the same time. It’s a challenge to learn and adapt rapidly to changing technologies. It’s also rewarding to work with a broad range of technology to create cool devices that can help solve challenging problems.

    Chapter 2

    Windows Embedded Compact 7

    WHAT’S IN THIS CHAPTER?

    Introducing Windows Embedded Compact

    Exploring new features in Windows Embedded Compact 7

    Understanding a little bit of history

    Seeing what you do with Windows Embedded Compact

    Choosing Windows Embedded Compact

    With the first version released in 1996, the Windows Embedded Compact family of technology has been through more than 15 years in the making. Evolving through seven major versions, with countless hours of development, bug fixes, improvements, and enhancements, this latest version is solid, packed with features, and optimized to enhance performance and security.

    To help you better understand Windows Embedded Compact, this chapter provides a brief overview of Windows Embedded Compact 7, the market it serves, and some of the key features.

    WHAT IS WINDOWS EMBEDDED COMPACT?

    Windows Embedded Compact is not binary-compatible with any version of the desktop Windows operating system (OS) and is not a scaled-down version of a desktop Windows OS. Windows Embedded Compact was created initially to service the handheld portable computing device market and was developed from the ground up to support multiple processor architectures.

    It is a small-footprint, highly customizable, 32-bit OS with hard real-time capabilities, developed to support multiple processor architectures, including ARM, MIPS, and x86. Windows Embedded Compact is a multithreaded, multitasking, and preemptive OS. It can handle up to 32,000 concurrent processes. Each process can access up to 2GB of virtual memory.

    Compact 7 is designed to support a new generation of small-footprint, smart, connected, and service-oriented embedded devices, built with limited system memory, storage, and processing resources.

    Since its inception in 1996, each new version of this product has been improved with added features while maintaining the following design criteria:

    Small footprint — Depends on selected components.

    Modular architecture — Componentized OS enables the OEM to make decisions about components to include in the final runtime image.

    Real-time support — Provides bounded, deterministic response times.

    Support of broad range of hardware — ARM, MIPS, and x86.

    Efficient power management — Provides uniform power management libraries.

    Efficient development tools — Applications can be developed with C, C++, C#, and Visual Basic using the Visual Studio integrated development environment.

    Efficient debugging and testing tools — The Compact 7 development environment provides efficient connectivity to enable Real Time debugging, as the OS image and application execute on the target device. A full-featured Windows Embedded Compact Test Kit includes a board-support-package, device driver, and memory leak and stress tests.

    Windows Embedded Compact 7 Features

    Windows Embedded Compact is optimized for devices built with minimal memory and storage and processing resources. Windows Embedded Compact provides the flexibility for you to build and configure a device with just the required components, as a closed system that does not enable an end user to add or modify an application, or as an open system that enables the end user to enhance the system with additional applications.

    Without being redundant to the product information provided as part of the product documentation and on Microsoft’s MSDN site, following are some of the key features for the Windows Embedded Compact product family:

    Deterministic hard real-time operating system

    Separate kernel-mode and user-mode spaces, keeping critical codes separate from noncritical codes to enhance system security and stability

    FAT12, FAT16, FAT32, and exFAT file systems

    UDF and UDFS v2.5 file systems to support CD, DVD, and HDDVD

    Graphic and multimedia core components

    Touch and Gesture user interface

    Silverlight for Windows Embedded

    Digital Rights Management (DRM) technology

    Video and audio capture pipeline

    Voice over IP (VoIP)

    Web, FTP, and file servers

    DirectDraw, DirectShow, and DirectX

    Networking with Bluetooth, NDIS, Remote Desktop Protocol (RDP), TCP/IP, and Wi-Fi

    USB host and device

    Cellcore component to access mobile communication resources

    Internet Explorer, Windows Media player

    Microsoft Office application viewers

    Win32 API and .NET Compact Framework

    SQL Compact and EDB (a lightweight and efficient database engine)

    International languages support

    The latest version, Windows Embedded Compact 7, is a continuing development from the Windows Embedded CE 6.0 (CE 6.0) OS kernel. Prior to CE 6.0 release, the OS kernel was limited to 32 concurrent running processes with each process accessing 32MB of virtual memory. Major redevelopment effort was invested in CE 6.0 to enable the kernel to support up to 32,000 concurrent processes with 2GB of accessible virtual memory per process. For Compact 7, the kernel is further enhanced with additional features and optimized to improve performance and stability.

    In addition to the large collection of components already available as part of the previous version, following are some of the new features added to the Compact 7 release:

    Multicore processor support.

    Supports up to 3GB of physical memory (up from 512MB in CE 6.0).

    Silverlight for Windows Embedded, a user interface (UI) development framework that enables developers to create visually compelling UI for embedded devices.

    Digital Living Network Alliance (DLNA) support, as digital media renderer, server, and controller.

    Media Transfer Protocol (MTP) support.

    Internet Explorer for Embedded, based on IE 7 with some performance updates from IE 8 added.

    Flash 10.1 renderer included without the need to pay additional license fee.

    Updated to use NDIS 6.1 network stack.

    Updated Microsoft Office application and PDF viewers.

    Better touch and gesture support.

    New remote tools framework with updated remote tools for debugging.

    Windows Embedded Compact test kit. This test kit replaces the CE Test Kit (CETK) for CE 6.0 and prior, with significant improvement and added features. This new test kit has a completely new graphical user interface to help simplify the tasks needed to test board support packages, device drivers, and application components.

    In addition to the new features mentioned, a lot of effort has been invested to improve and optimize the network stack, file system, USB stack, and other system components to enhance system performance, security, and stability.

    Modular and Compact Operating System

    Compact 7 is a highly modular OS. Each Compact 7 OS runtime image is composed of a collection of components, which include the OS, programming library, hardware interface, device driver, application, and other software components.

    Using Platform Builder, a plug-in to the Visual Studio 2008 integrated development environment, you can create and configure a customized Compact 7 OS design and include only the needed components to generate an OS runtime image with the smallest possible footprint.

    A device built with smaller footprint OS runtime image requires less system memory, storage, and processing resources to run.

    A device built with a smaller footprint OS image takes less time to boot up. By minimizing the OS footprint, you can build the device with lesser-cost hardware, which helps improve the device’s value and competitiveness.

    Real-Time Operating System

    There are soft real-time and hard real-time systems. A soft real-time system can miss its bounded time response once in a while and still maintain a reasonable level of acceptable performance, such as when a Voice over IP device may delay, or skip, the delivery of voice packets and still provide acceptable service to the user.

    A hard real-time system cannot miss any of its bounded time responses. When a hard real-time system misses a bounded time response, it can cause catastrophic system failure. Imagine what happens when an automobile’s electronic brake system fails to engage in a timely manner, while the automobile travels at a high speed and needs to make an urgent stop to avoid a collision.

    Compact 7 is a hard real-time OS that provides reliable core services to support embedded system design that demands low-latency, deterministic real-time system performance. Compact 7 has the following features required by a real-time system.

    Multithreaded and preemptive

    Prioritized thread scheduling

    Priority inversion prevention using priority inheritance to dynamically adjust thread priorities

    Predictable thread synchronization

    Support Broad Range of Hardware

    Compact 7 supports hardware built with ARM, MIPS, and x86 processors. The Compact 7 OS provides the platform to support multiple families of a processor by abstracting the hardware features with hardware adaptation layer codes unique to each processor family, referred to as the OEM Adaptation Layer (OAL).

    By abstracting hardware-specific features to provide a uniform application programming interface across multiple families of a processor, Compact 7 provides a uniform development environment that helps simplify development project management effort and minimize development cost.

    With a quality board support package (BSP was developed to support the target device), you can create a customized Compact 7 OS runtime image for the target device, with minimum knowledge about the device’s hardware, and include the necessary OS components to support your application.

    History

    With the initial version released in November 1996, Compact 7 reaches its 15th birthday in November 2011. Following is a list of the major releases for the Windows Embedded Compact product family:

    1996 — Windows CE 1.0

    1997 — Windows CE 2.0

    1998 — Windows CE 2.11

    1999 — Windows CE 2.12

    2000 — Windows CE 3.0

    2002 — Windows CE .NET 4.0

    2002 — Windows CE .NET 4.1

    2003 — Windows CE .NET 4.2

    2004 — Windows CE 5.0

    2006 — Windows Embedded CE 6.0

    2007 — Windows Embedded CE 6.0 R2

    2009 — Windows Embedded CE 6.0 R3

    2011 — Windows Embedded Compact 7

    Windows CE was the initial product name. With version 4.0, released in 2002, the name changed to Windows CE .NET, as part of Microsoft’s .NET evolution. When version 6.0 was released in 2006, the name changed to Windows Embedded CE 6.0. As Microsoft releases the latest version, the name has been changed to Windows Embedded Compact 7.

    In addition to the major version releases listed, the Windows Embedded Compact core technology has also been adopted by other product groups within Microsoft, such as Pocket PC, Windows Mobile, Windows Automotive, Zune, and Windows Phone. Following is a list showing some of these products:

    Pocket PC 2000

    Pocket PC 2002

    Windows Automotive

    Windows Embedded Automotive 7

    Windows Smartphone 2002

    Windows Smartphone 2003

    Windows Mobile 2003

    Windows Mobile 5.0

    Windows Mobile 6.0

    Windows Mobile 6.5

    Windows Embedded Handheld

    Windows Phone 7

    In addition to the general product releases, as part of Microsoft’s support effort, countless number of fixes, enhancements, and updates, known as Quick Fix Engineering (QFE), are released monthly to help resolve problems that arise in the field.

    If you want to know more about Windows Embedded Compact’s history, the following page on the Wikipedia site, http://en.wikipedia.org/wiki/Windows_CE, has a good collection of information.

    Targeted Market

    The first version of Windows Embedded Compact, Windows CE 1.0, released in 1996, was created for the Handheld PC.

    With Windows CE 2.0 released in 1997, this version found its way into the PDA market. Auto PC 1.0 was born from Windows CE 2.01. As version 2.10, 2.11, and 2.12 evolved, developers started to adopt Windows CE to develop applications for a variety of vertical markets.

    With Windows CE 3.0 released in 2000, Microsoft started to dominate the PDA market with PocketPC and began to engage in the mobile smartphone market.

    As the Windows Embedded Compact technology evolved with improvements and enhancements added to each new version, more developers adopted the technology to develop a broad range of applications for a different vertical market, including the following:

    Automotive

    Consumer device

    Home and building automation

    Industrial automation and control

    Instruments

    Medical device

    Mobile phone

    Portable GPS Navigation

    Retail and hospitality

    RFID

    Robotics

    Security and access control

    Telematics

    WHY WINDOWS EMBEDDED COMPACT?

    With more than 15 years in the making, continuous development, enhancement, and improvement, the Windows Embedded Compact product is feature-rich, mature, and stable with a strong proven track record. Windows Embedded Compact has been adopted by hundreds of key companies worldwide with tens of millions of devices shipped.

    The OS is one of the critical components for your project. With Windows Embedded Compact, you have the assurance the underlying operating system technology is supported by the largest software company on the planet, with the sole interest to help you complete your development project quickly and efficiently to ship your product.

    Microsoft cannot receive license revenue from your product until you successfully complete the development, release the design to production, and ship the product to the end user.

    With Windows Embedded Compact, you don’t need to worry about potential intellectual property licensing conflicts associated with components you use as part of the OS. Microsoft provides the license to use the components, available as part of the Windows Embedded Compact to support your product. Microsoft is responsible for handling any legal complications that arise from the use of these components.

    Developer-Friendly Tools

    Platform Builder for Windows Embedded Compact 7 is a plug-in to the Visual Studio 2008 integrated development environment (VS2008 IDE). With VS2008 IDE, Windows Embedded Compact provides an efficient and developer-friendly environment that helps simplify complicated development tasks. With Visual Studio 2008 as the primary development environment, you can develop a broad range of Windows Embedded Compact applications using C, C++, C#, and Visual Basic.

    If you currently use VS2008 for PC-related development tasks, you can find a lot of similarities when developing Compact 7 applications. If you are new to VS2008, you can find the graphical user interface is easy to use and learn.

    Debug, Testing, and Quality Control

    Debugging and testing consume a large portion of a development project’s resources. During the planning stage, it’s difficult to accurately estimate resources and efforts needed to resolve bugs and development mishaps during the development process.

    A development team with an efficient and effective debugging and testing environment can help minimize the impact associated with bugs and development mishaps.

    Windows Embedded Compact provides efficient debugging and testing facilities, which include Kernel Independent Transport Layer (KITL) and CoreCon connectivity to support the included remote tools’ framework, which enable you to trace and debug OS design, device driver, programming library, and application codes as they execute on the target device.

    Windows Embedded Compact also includes the Compact Test Kit, which enables you to perform compatibility and quality control tests related to the BSP, device drivers, and application.

    SUMMARY

    Windows Embedded Compact is a mature, real-time capable, small-footprint embedded operating system with features to support a new generation of media-rich, smart, connected, and service-oriented devices.

    With its well-established code base, efficient development environment, and large pool of hardware and technical support resources, Windows Embedded Compact is an attractive development platform that can minimize development cost and risk and help the product development team to shorten development schedules and gain a critical time-to-market advantage.

    Chapter 3

    Development Station Preparation

    WHAT’S IN THIS CHAPTER?

    Introducing development computer requirements

    Defining the required software and installation

    Exploring the development environment

    A properly configured development station helps minimize problems caused by inadequate software installation and improper setup, which can be difficult to identify and can waste unnecessary development resources. This chapter provides information about requirements for the development computer and best practices to set up an effective development environment to work with Windows Embedded Compact.

    DEVELOPMENT COMPUTER REQUIREMENTS

    It’s a common practice for a software provider to specify the minimum system requirements needed for the software to function. In the actual working environment, it’s good to invest a little more to get a better development computer with a faster processor and more system memory and storage. The return on investment, in terms of time-saving and increased efficiency, is much greater than the cost.

    Hardware

    Platform Builder for Compact 7 documentation states the following minimum development computer requirements:

    2.4GHz or faster CPU

    1024MB or more system memory (RAM)

    1280×1024 or better display resolution

    7200RPM or faster hard disk

    As PC technology rapidly advanced in recent years, a PC is no longer privileged equipment for the IT professional and becomes a consumer device that many people simply cannot live without. The PC market’s exponential growth and enormous market size make it possible for PC manufacturers to produce higher performance PCs at a much lower cost.

    It’s best to get the highest performance computer with the most system memory and storage you can afford. If you work in the computer software development and consulting field, you can recover the additional investment within 1 to 3 months in time-saving and added efficiency with a higher performance development computer. For this book, the following minimum is recommended for the development computer:

    Quad cores CPU

    4GB or more RAM

    7200RPM or faster hard disk with much more than 100GB of available space

    Platform Builder for Compact 7 requires more than 50GB of storage space for a full install. Each OS design project can take as much as 1GB to well over 3GB of storage. If you need to save and maintain OS design projects that you develop, you need a lot of storage space.

    In addition to the above recommendation, it’s good to have a second monitor to display multiple screens simultaneously. As part of the OS design and application development process for Windows Embedded Compact, you need to view and refer to information from multiple program screens. Two display monitors provide more display space, enable you to view multiple screens simultaneously, and minimize the need to switch from one screen to another, which helps increase your efficiency and save time.

    Software

    Platform Builder for Windows Embedded Compact 7 is a plug-in for Visual Studio 2008 and requires the following to function:

    Visual Studio 2008

    Visual Studio 2008 Service Pack 1

    .NET Compact Framework 3.5

    Expression Blend 3 (needed to support Windows Embedded Silverlight tools)

    You can set up a Windows Embedded Compact 7 development computer with any one of the following Windows desktop operating systems:

    Windows XP with Service Pack 3

    Windows Vista with Service Pack 2

    Any version of Windows 7, including both 32-bit and 64-bit

    WINDOWS EMBEDDED COMPACT 7 SOFTWARE

    Platform Builder is the primary development tool for Windows Embedded Compact 7 to develop a customized OS runtime image, device driver, BSP, and OAL codes. Instead of referring to the full product name, most developers use the abbreviated versions such as Platform Builder for Compact 7, Platform Builder 7, or just Platform Builder.

    Following are the two available versions of Windows Embedded Compact 7 software, the evaluation version and full version:

    Full version in retail package — This version includes Platform Builder for Windows Embedded Compact 7, Visual Studio 2008 Professional edition, and Expression Blend 3. To purchase the retail package, locate a distributor in your region from the following URL:

    http://www.microsoft.com/windowsembedded/en-us/partners/find-microsoft-authorized-embedded-distributor.aspx

    The full version is available for download as part of MSDN Embedded, Visual Studio Premium with MSDN, or Visual Studio Ultimate with MSDN subscription.

    180-day evaluation version on DVD software package — This version includes the 180-day evaluation version of Platform Builder for Compact 7 and 90-day evaluation version of Visual Studio 2008 Professional Edition. You can order this software package from the following URL:

    https://ms.kpcorp.com/WinEmbedded/AspxFiles/Home.aspx

    The 180-day evaluation version is available for download from the Microsoft website.

    Other than the 180-day usage limit, the evaluation version is fully functional, which provides a good environment for you to fully evaluate and try Windows Embedded Compact 7 before making a financial commitment to purchase the full version. You can download the evaluation version, without cost, from the following URL:

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

    Recommended Installation Steps

    When the required software is not properly installed to the development computer, you may not correctly identity whether the problem you have is caused by the codes you develop or improper software setup. You need to install the required software in a proper sequence to minimize problems.

    Following are recommended steps to install Compact 7 and related software:

    Windows Embedded Compact 7 does not support a side-by-side install with the earlier version, Windows Embedded CE 6.0. If you have a previous version, uninstall the previous version before installing Compact 7.

    1. Visual Studio 2008.

    Visual Studio 2008 Express edition does not support Platform Builder for Compact 7. It’s recommended that you use the Visual Studio 2008 Professional edition. A full version of Visual Studio 2008 Professional edition is included as part of the retail package version of Windows Embedded Compact 7 software.

    A 90-day evaluation version of the Visual Studio 2008 Professional edition is included as part of the evaluation version of Windows Embedded Compact 7 DVD.

    The 90-day evaluation version of Visual Studio 2008 Professional edition is available for download from the following URL:

    http://www.microsoft.com/downloads/en/details.aspx?FamilyID=83c3a1ec-ed72-4a79-8961-25635db0192b&displaylang=en

    2. Visual Studio 2008 Service Pack 1.

    You need Visual Studio 2008 Service Pack 1 to support Platform Builder for Compact 7, which is available for download from the following URL:

    http://www.microsoft.com/downloads/en/details.aspx?FamilyID=27673C47-B3B5-4C67-BD99-84E525B5CE61

    3. Expression Blend 3.

    Expression Blend 3 is the tool you need to create XAML codes for Silverlight project. If you plan to use Silverlight for Windows Embedded, you need to install Expression Blend 3 prior to installing Platform Builder. Otherwise, the Silverlight for Windows Embedded template will not be installed.

    4. Platform Builder for Windows Embedded Compact 7.

    Platform Builder for Compact 7 software requires a large amount of storage space. Full installation with support for all processor architectures selected occupies more than 50GB of space. It’s best to select the processor you work with and exclude the others. The target device used for the sample exercises in this book is built with an x86 processor. You need support for an x86 processor to work through the exercises.

    5. BSPs and third-party components for Windows Embedded Compact 7.

    It takes quite a bit of time to install all the required software components. Be patient, install each software component in sequence, and wait for the current installation to complete before attempting to install the next component.

    Quick Fix Engineering Updates

    Microsoft releases Quick Fix Engineering (QFE) updates routinely as part of its ongoing support for Compact 7. QFEs are released to address and resolve issues discovered after Compact 7 was released to the public.

    Unless you work on projects with strict revision controls that prevent you from installing QFEs, you should keep your Compact 7 development environment updated with the latest QFEs. Often, installing updated QFEs can help resolve problems.

    For the previous versions, you need to manually search for QFEs from the Microsoft website. Compact 7 implemented a push model, similar to Windows Updates, where it automatically checks and notifies you when new QFEs are available and enables you to decide whether to install the QFEs. You can still manually search the Microsoft website for QFEs.

    Install QFEs in chronological order, based on the QFE’s release date.

    DEVELOPMENT ENVIRONMENT SETUP

    In order to develop Windows Embedded Compact application for an embedded device, you need to set up a development environment that enables you to deploy application from the development computer to the device for testing and debug.

    Target Device

    A Windows Embedded Compact development environment is not complete without a target device. Whether developing a custom OS design, device driver, programming library, or application, you develop Compact 7 software components for a target device, or family of devices.

    If you don’t have access to a real target device, you can use Virtual PC as a Compact 7 target device to test a software function that is not hardware-specific.

    Virtual PC is great for learning how to use Platform Builder. Platform Builder for Compact 7 provides the necessary resources, including Virtual PC BSP and a sample virtual machine, needed to work through OS design project and application development exercises. Using Virtual PC, you can work through the exercises to download an OS runtime image to the virtual machine and deploy an application to the virtual machine with Compact 7 OS launched.

    The target device, whether real hardware or virtual machine, needs to establish connectivity to the development computer to download an OS runtime image and deploy an application, from the development computer to the device. Depending on the device’s design and available features, it can connect to the development computer via an Ethernet, Serial, USB, and other connection.

    It’s common for consumer portable devices to use the USB interface to establish connectivity with the development computer. A low cost and headless device built with limited peripherals can use the serial port to establish connectivity. For industrial embedded devices, it’s common to use the Ethernet interface as the connection between the development computer and target device.

    For the exercises in this book, the target device, an eBox-3310A, is built with an Ethernet interface and uses this Ethernet interface to establish connection to the development computer.

    To use an Ethernet interface to establish connectivity, both the development computer and target device must connect to the same LAN. In addition, both the development computer and target device must be configured with IP addresses within the same segment.

    To develop the Compact 7 OS design, device driver, support library, and application for a target device, you need a Compact 7 board support package for the target device, with the necessary device drivers and bootloader. In addition, the target device must include the necessary bootable storage preconfigured with a Compact 7 bootloader.

    Virtual PC as Target Device

    If you don’t have access to a real target device with Compact 7 support, using a Virtual PC as the target device is a good alternative.

    Platform Builder for Compact 7 includes a Virtual PC board support package, which you can use to develop a Compact 7 OS runtime image to deploy to a Virtual PC. A sample Virtual PC image, preconfigured with the necessary Compact 7 bootloader, is provided as part of the Virtual PC board support package.

    LAN with DHCP

    With both the development computer and target device attached to the same LAN with DHCP service, both of them can receive IP address assignments within the same subnet, from the DHCP service.

    With DHCP service to provide IP addresses dynamically, it minimizes the need to configure IP addresses and the network-related configuration needed to establish connectivity between the development computer and target device.

    Most of the LANs, in large enterprise and small business, are set up with a DHCP service to assign IP addresses dynamically. For some of the large enterprises, as part of their IT security implementation, both the development computer and target device need to be approved by the IT department and register the associated MAC address with the DHCP server, to access the system’s DHCP service to acquire IP addresses.

    If you set up the development environment at home, as part of the resources to connect to the Internet via a DSL or cable, you may already have a router or wireless-access-point-router, which is equipped with a DHCP service to provide IP addresses dynamically. You can use this environment and attach your target device to the existing network to establish your Compact 7 development environment.

    LAN without DHCP

    When working in an environment without DHCP service, you need to configure the development computer and target device with appropriate static IP addresses. You must configure both the development computer and target device with IP addresses in the same subnet to establish the connectivity needed to transfer the OS runtime image and deploy the application to the target device.

    Connectivity for Debugging and Testing

    Debugging and testing are critical parts of a product development lifecycle to help improve the product’s quality. Efficient debugging tools help identify and locate bugs quickly. A testing facility is necessary to validate that the product meets the design specifications.

    Platform Builder provides the facilities to simplify the debugging and testing effort, which include remote tools for debugging and a Compact Test kit to perform various functions’ compatibility and stress tests. To use these tools the target device needs to establish connectivity to the development computer, with the necessary transport to support these tools.

    Following are some of the common connections used for debugging and testing:

    Ethernet

    Serial port

    USB via RNDIS

    JTAG

    These connection methods are hardware-specific and require additional driver and software support components unique to each target device to function.

    Ethernet

    Developed during the 1970s, Ethernet has been around for more than 30 years. Ethernet is part of the Internet’s explosive growth that drives the need for efficient network connectivity and provides the catalysts to motivate network technology companies to develop better solutions.

    As networking technology evolved, Ethernet has grown into a mature and stable connectivity option adopted as a de facto connectivity option for computers, servers, and all types of devices.

    With communication speed ranging from 10 to 100 to 1000 Mbps, Ethernet connectivity can support communication with high bandwidth requirements. Even at its lowest range, 10 Mbps, Ethernet can support much higher data throughput compared to some of the older legacy connectivity options used in embedded devices, such as parallel and serial ports.

    With a well-established presence in the market, and stable and matured technical support resources across multiple hardware and software platforms, Ethernet is an attractive and practical connectivity option for many types of devices.

    In many cases, although a finished device for distribution is designed without Ethernet connectivity, to ease testing and debug efforts, a special version of the device is created with Ethernet connectivity to help minimize the development team’s testing and debug efforts, and improve development efficiency.

    Ethernet connectivity is the preferred option for the Platform Builder development environment to transfer an OS runtime image, deploy an application to the target device, debug, and test.

    Serial

    Serial port is a half-century-old legacy technology initially created in the early 1960s, which is still one of the common connectivity options used by a broad range of products.

    Whether you work on an embedded device built with an 8-bit microcontroller, or a new generation of an embedded system built with the latest high performance processor, the device is likely to have one or more RS-232 serial interfaces available.

    The serial port was used to output debug messages from the target device in the previous versions of Windows Embedded Compact and is still in use to serve the same purpose for this latest version, Windows Embedded Compact 7.

    You can configure a Compact 7 target device to send debug messages in ASCII text through one of the available serial ports. These debug messages can easily be captured using a terminal program such as HyperTerminal, available as part of the Windows XP OS.

    Typical Development Environment

    The development environment with both the development computer and target device connected to a Local Area Network with DHCP service to provide IP addresses dynamically is a common setup for Platform Builder for Compact 7 development, as shown in Figure 3-1.

    FIGURE 3-1

    As shown in Figure 3-1, a null RS-232 serial modem cable connects a serial port on the development computer to an available serial port on the target device, configured to output debug messages. The development computer is configured with a terminal program to capture these debug messages.

    For the preceding setup to function, you must configure the target device with an appropriate bootloader, which is needed to establish connectivity with the Platform Builder development computer to download an OS runtime image and application.

    To capture serial debug messages from the target device, the development computer needs to launch a terminal emulation program, with a function similar to the HyperTerminal.

    HyperTerminal is no longer available as part of Windows Vista and Windows 7. You can use HyperTerminal from Windows XP under Windows Vista and Windows 7. Alternatively, you can use programs such as TeraTerm and PuTTY; both are open-source.

    SUMMARY

    A properly configured development computer and target device with proper connectivity resources are important elements to establish an efficient environment for Windows Embedded Compact 7 development.

    It is well worth the extra time and effort invested to research and figure out the best setup for your development environment. In most cases, the technology vendor that provided the target device and Compact 7 board support package is the best source to provide information and recommendations about setting up an efficient development environment.

    Chapter 4

    Development Process

    WHAT’S IN THIS CHAPTER?

    Developing a Compact 7 device

    Selecting the hardware

    Understanding the steps to develop a Compact 7 device

    Developing a Compact 7 device involves multiple tasks, with different phases, and requires both hardware and software development resources. To learn about Windows Embedded Compact, you need to understand the overall development process and establish the initial learning focus that is relevant to your immediate needs. This chapter provides an overview of the steps and process to develop an embedded device using Windows Embedded Compact 7.

    PLANNING

    Planning is important. A development project starts with proper planning has better chance to accomplish designated objectives. A design and development project should start with a plan that takes into account all relevant components to minimize problems, reduce costs, and shorten the development schedule.

    After you establish the product functions and features, a typical embedded device project development plan should include the following:

    Hardware requirements

    Required hardware development resources

    Operating system and other software requirements

    Required software development resources

    Regulatory certification requirements

    Expected life for the device’s marketability

    Expected life for the device’s serviceability

    Licensing and intellectual property concerns

    HARDWARE SELECTION

    With the right hardware platform from a vendor with the necessary resources to support the platform, Windows Embedded Compact 7 can help ease quite a number of development challenges for the project.

    When selecting the hardware platform, in addition to the features and specifications, the following considerations should be taken into account:

    Standard off-the-shelf hardware — Often, an off-the-shelf hardware platform may not meet all the project’s design specifications. If you can find off-the-shelf hardware that meets all the core requirements with the exception of certain nice-to-have features, this may be a good, safe, and predictable option.

    Design custom hardware internally — Although the plan to design custom hardware internally seems to provide better control, unless your team has strong hardware experience and development resources, this option may trigger unpredictable costs and can seriously impact your development schedule.

    Design custom hardware through outsourcing — When the need to develop custom hardware for your project is obvious, hiring an experienced hardware design service provider can be a good option, especially when your team does not have strong hardware development resources. When choosing this option, be sure to account for the required device drivers and operating system components.

    Hardware support — A hardware platform with the lowest price tag does not necessarily mean it’s the most economical. The following considerations should be taken into account as part of the hardware platform selection:

    Does the hardware vendor provide the necessary board support package and device drivers to support Compact 7?

    Does the hardware vendor have a competent technical team to support Compact 7-related hardware issue?

    Hardware life cycle — It takes significant time and effort to develop a product. After the development process is successfully completed, the product needs to go through different required regulatory certifications, depending on the type of device and the market it serves. In addition to the huge costs associated with the development and regulatory certifications, it requires lots of time to accomplish. When selecting hardware, it’s critical for the selected hardware to be readily available throughout the product’s expected service life.

    Hardware design for evaluation — Many hardware technology companies provide evaluation hardware to help potential customers evaluate and test the technology. Often, the evaluation hardware is not designed with the quality needed for production. To use this type of hardware requires additional effort and resources to design a production version, which introduces additional costs and requires a longer development schedule and additional testing to validate the new design’s function and performance.

    Within the Windows Embedded Compact environment, the term target device represents the selected hardware platform.

    SOFTWARE SELECTION

    The software technology field is dynamic and evolving continuously. Although newly evolved technology is exciting and attractive, when adapting new technology to your product, you need to question whether the technology is stable enough for the type of product and market you serve.

    Although it may seem safe to continue to use legacy software to develop the same type of application, unless your company has certain patents and trade secrets that provide strong competitive advantage and prevent your competitors from entering the market, it’s naïve to think that a product built with outdated technology can gain strong market share.

    Following are some of the things to consider when selecting the software:

    Has the selected software been proven?

    Is the selected software adopted by other key companies in the market?

    Is there a large developer base using the selected software?

    Does it have a productive, robust, and easy-to-learn development environment?

    Is there a steep learning curve for your development team to become proficient with the software?

    Are there existing development resources you can tap into?

    Is the selected software manageable and predictable?

    Is there a creditable and reliable entity supporting the selected software?

    Are there business concerns related to intellectual property, copyright, and patents?

    Does the selected software force your company to expose sensitive intellectual property and trade secrets?

    TYPICAL DEVELOPMENT PROCESSES

    With Windows Embedded Compact 7 devices ranging from small head-less devices with minimal processing requirements for automation and control application, to sophisticated medical instruments with high-performance processing requirements to capture complex inputs and support high-resolution display, there isn’t a set of detailed processes or steps that are generally applicable to all these devices.

    The information in this section covers some of the typical Windows Embedded Compact development steps to help you better understand the environment.

    With the assumption that a hardware platform for the development project has been selected, following are some of the typical steps needed to develop a Compact 7 device:

    Board Support Package (BSP)

    OS design

    Application

    Debugging and testing

    Deployment

    Post-deployment support and update

    Board Support Package (BSP)

    After you select the hardware platform, if it does not include a Compact 7 BSP, developing the BSP is the next major hurdle.

    BSP is a software package that contains the necessary components needed to generate the OS run-time image for the target device, typically including the following:

    OEM adaptation layer (OAL) codes

    Device drivers for the target device’s peripherals

    File system support unique to the target device

    Bootloader or bootstrap codes needed to launch Compact 7 OS run-time image on the target device

    Bootloader with connectivity codes to establish connection and download OS run-time image from the development station to the target device

    Kernel Independent Transport Layer (KITL) or other form of connectivity component to provide the function and connection needed to support debugging and testing

    Not all BSPs are equal. Although some hardware vendors provide a BSP that fully supports the intended target device’s features as part of their product offering, there are hardware vendors that provide a reference BSP from the silicon vendor, a company that designs and manufactures the processor for the hardware, as part of their support, which may not include all the components needed to support the intended target device.

    A high-quality BSP that includes proper components to support the target device and connectivity components to link the development station and target device for debugging, testing, and application deployment can help streamline the overall development process.

    A quality BSP is one of the important components needed to establish an efficient development environment. An efficient and effective development environment can help eliminate unnecessary aggravation among the development team, minimize development costs, and shorten the development schedule.

    OS Design

    With the hardware option selected and a quality BSP in place, the next step is to develop an OS design project to generate the OS run-time image for the target device. Typically for a Compact 7 device, the OS run-time image is generated with the application compiled as part of the image.

    Following are some of the development tasks that can impact the OS design:

    A software development kit (SDK), generated from the OS design, is needed to develop an application for the device.

    When the application, to be compiled as part of the OS run-time image, is modified, the OS design needs to be updated and recompiled to generate a new OS run-time image with the updated application.

    When any one of the device drivers for the target devices is modified, the OS design needs to be updated and recompiled to generate the new SDK and OS run-time image to reflect the changes.

    Application Development

    With an SDK generated from the OS design, you and your team can start the application development process. To shorten the development schedule, you can start the application development process in parallel with hardware, BSP, and OS design development, by using a reference SDK from the hardware vendor or a generic SDK from Microsoft that supports the same processor family as the target device for your project.

    Changes to the hardware, device drivers, BSP, and OS design may impact the application’s function and require an additional development effort to modify the application to address these changes.

    Debugging and Testing

    Debugging is an ongoing part of every development process. Debugging is the action of identifying, understanding, and resolving issues. Testing is necessary to validate whether each development step delivers the required components that meet the specification. Structured debugging and testing steps should be implemented as part of every development process. From the surface, it seems like these efforts introduce additional costs and may impact the overall development schedule. On the contrary, without structured testing processes to identify problems earlier in the development cycle, your project will likely have to deal with unexpected problems later in the cycle where both costs and impact to the schedule are more significant.

    Deployment

    After the OS run-time image, application development, debugging, and testing steps are completed, you need to compose the final software package to be deployed with the target device for distribution.

    As part of the process to develop the final software package to deploy to the target device, you need to take into account the following considerations:

    Simplifying the initial setup needed to start using the device.

    Providing the mechanisms needed to back up device configuration and restore the device to an archived configuration.

    Reset and recover the device to the default factory settings.

    Post-Deployment Support and Updates

    Although post-deployment support and updates do not directly impact the development process, these are important business concerns that you need to address as part of the development efforts.

    The technology world is not perfect. As new improvements become available, a product with an effective way to enable the customer to gain access to these new improvements can be an important key to help capture more customers and increase market share.

    You need to consider resources for post-deployment support and updates as part of the development process and include them as part of the product design. These resources should address the following:

    Connectivity for the device to access the update and new software

    Mechanism needed to update the applications for the device

    Mechanism needed to update the OS components for the device

    SUMMARY

    Embarking on a new project to develop an embedded device for an evolving market, using new technology, can take you into unfamiliar and uncharted territories. To be prepared for the unexpected, you need to arm yourself with knowledge and develop a plan to deal with both the expected and unexpected.

    From a project management perspective, thorough knowledge about the development process and required steps can help you put together a development plan that anticipates and addresses the unexpected, with minimal impact to the project’s budget and schedule, as these unexpected challenges happen.

    Chapter 5

    Development Environment and Tools

    WHAT’S IN THIS CHAPTER?

    Reviewing the Platform Builder environment

    Reviewing target device connectivity options

    Reviewing the Windows Embedded Compact Test Kit

    As part of the Windows Embedded Compact learning process, the first step is to get

    Enjoying the preview?
    Page 1 of 1