Qt Reference Documentation

Installing Qt for Windows Embedded Compact 7

This document provides instructions to start using Qt on Windows Embedded Compact 7 (WEC7) environments. Qt is verified in two different environments for WEC7; x86 based Windows Virtual PC and ARMv7 based BeagleBoard XM. For evaluation purposes Qt recommends these environments. Other X86 and ARM based configurations are also supported by Qt Commercial but not tested regularly. MIPS based architectures for WEC7 are currently not supported by Qt Commercial. Since the Qt port is still work in progress there are few limitations.

Requirements for development environment

Detailed instructions for installing WEC7 development environment are given in Installing WEC7 page. In essence the following tools are needed.

WEC7 Windows Virtual PC setup

In this chapter the Windows Virtual PC is used as a target platform and WEC7 is built based on Enterprise Handheld profile. Detailed instructions for setting up Virtual PC and WEC7 image can be found from Microsoft's Getting started with Virtual CEPC page. Following steps summarizes the most important actions.

Setting up Windows Virtual PC and WEC7

To set up Virtual PC and WEC7 follow these steps:

  1. Install Virtual PC for Windows 7
  2. Create a new OS design with platform builder by using Visual Studio. Select the following options:
    • BSP: Virtual PC: x86
    • Design Templates: Enterprise Handheld
    • Networking and Communications: Add "Wired Local Area Network" to default selection
    • Clear the "Build the following configuration after I click Finish" check box from the last page
    • Switch to Catalogs view and select keyboard driver from "BSP, Virtual PC : x86, Device Drivers, and then Keyboard" based on your host OS version
    • Build your OS design (Note: This guide assumes checked version)
  3. Create Virtual Machine for OS image by using Virtual PC
    • Start Windows Virtual PC and click "Create virtual machine" to create VM with some name (e.g. WEC7_vCEPC)
    • Default settings are fine, on "Add a virtual hard disk" you can use VHD provided by WEC7. (Default location: C:\WINCE700\Platform\VirtualPC\VM\hd0_sample.vhd)
  4. Download and boot your WEC7 OS image in Virtual PC
    • Launch just created virtual machine abd wait for boot loader to get into BOOTME stage
    • Prepare Visual Studio Platform Builder to use virtual machine
      • Open "Connectivity Options" from target menu
      • In "Target Device Connectivity Options" click "Add device". Give device some name and select Windows CE for "Associated OS Design/SDK"
      • In "Kernel Service Map" view, click settings for "kernel download". The opened window should receive a BOOTME message from VM. Close the dialog window
      • Download boot image to Virtual PC
        • In Visual Studio, select your device from the Device list
        • In Visual Studio, click "Target" and click "Attach Device" to initiate the boot image download to the Virtual PC

Now there should be WEC7 OS design running in Windows Virtual PC. It should look something like this:

Creating SDK for WEC7 Virtual PC environment

In order to ease environment setup for building Qt against Virtual PC Environment and to faciliate Qt application development for Virtual PC environment without installing Platform Builder, we recommend you to create SDK for WEC7 application development on Virtual PC as intructed on Create an SDK for Application Development.

Rest of this guide assumes that you have built WEC7 SDK from your Virtual PC environment with the vCEPC SDK as a SDK Name

Deploying Qt source codes

As the Qt Commercial source codes are used the license file needs to be set in place. Copy the license file from your account on customer portal into your home directory (this may be known as the %USERPROFILE% environment variable) and rename it to .qt-license. This renaming process must be done using a command prompt on Windows, not with Windows Explorer. For example on Windows 7, %USERPROFILE% should be something like C:\Users\username

Uncompress the files. Location can be for an example under OS design created in earlier chapter:

 C:\WINCE700\OSDesigns\WEC7_vCEPC\WEC7_vCEPC

Modifying WEC7 X86 MKSPEC

The Qt contains X86 mkspec for WEC7 platform builder. In order to use template mkspec with your Virtual PC SDK modify qmake.conf:

 mkspecs\wince70embedded-x86-msvc2008\qmake.conf

Replace lines:

 CE_SDK  = Platform Builder
 CE_ARCH = _TGTCPU

With lines:

 CE_SDK  = vCEPC SDK
 CE_ARCH = x86

Building Qt for WEC7 Windows Virtual PC

For building the Qt the Perl needs to be installed and configured to PATH. To check that Perl is correctly installed and configured the following command can be used:

 perl -v

After the Perl is verified to work open "Visual Studio Command Prompt". First Configure Qt for WEC7 Virtual PC. Note: Configure needs to be executed in clean Visual Studio command prompt. After setting paths for Qt building to WEC7, the same command prompt cannot be used for configure anymore.

 configure -platform win32-msvc2008 -xplatform wince70embedded-x86-msvc2008 -no-accessibility

After successful configure prepare the environment for Qt building as follows:

 set path=%CD%\bin;%PATH%

 checksdk -sdk "vCEPC SDK (x86)" -script qt-wec7-vcepc-env.bat

 qt-wec7-vcepc-env.bat

After setting the environment variables Qt can be build by calling:

 nmake

Qt deployment to WEC7 Windows Virtual PC environment

Currently only manual deployment to WEC7 environments is working. Copy generated DLL, including plugins, and executable to virtual PC. There is one shared folder that both host and Virtual PC can access. Folder can be found from:

 %QT_WEC7_OS_DESIGN%\RelDir\VirtualPC_x86_Checked

Create a Qt folder there and copy the whole Qt lib folder and contents of plugins folder there:

 mkdir %QT_WEC7_OS_DESIGN%\RelDir\VirtualPC_x86_Checked\Qt

 xcopy /S lib\* %QT_WEC7_OS_DESIGN%\RelDir\VirtualPC_x86_Checked\Qt\

 xcopy /S plugins\* %QT_WEC7_OS_DESIGN%\RelDir\VirtualPC_x86_Checked\Qt\

In addition the MSVC runtime dlls need to be copied to the same place. Copy the files:

 copy "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ce\dll\x86\msvcr90.dll"
 %QT_WEC7_OS_DESIGN%\RelDir\VirtualPC_x86_Checked\Qt\

 copy "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ce\dll\x86\msvcr90d.dll"
 %QT_WEC7_OS_DESIGN%\RelDir\VirtualPC_x86_Checked\Qt\

Building Qt application for WEC7 Windows Virtual PC

This guide uses Qt example called analogclock. Example is located in:

 cd examples\widgets\analogclock

To build the Qt example run the following commands from command line in the example folder:

 qmake && nmake

Deploy created binary to Virtual PC target:

 copy release\analogclock.exe %QT_WEC7_OS_DESIGN%\RelDir\VirtualPC_x86_Checked\Qt\

Executing Qt application from Windows Virtual PC

After the Qt application and all of its dependencies are deployed to WEC7 Virtual PC the example can be ran by opening the command prompt and typing the executable name in the /release - folder. Below is the screenshot of Qt application running in WEC7 Virtual PC.

WEC7 Hardware environment

In this demonstration the BeagleBoard XM is used as a reference hardware. Other WEC7 hardware SDKs can also be used but BeagleBoard specific parts of this user guide needs to be replaced with actual SDK name.

Prerequisites

The development environment needs to be set as in Requirements for development environment. In addition the hardware deployment assumes you to have Active Sync software installed for you development host PC. For example the Windows Mobile Device Center can be used.

WEC7 BSP for BeagleBoard XM

For this example the free Binary BSP for BeagleBoard XM from Adeneo is used.

Detailed instructions to install BeagleBoard-xM_WEC7 Binary Image to target hardware and BSP for WEC7 can be found from Adeneo website. Here are the main steps for installation:

  • Download BBxM_WEC7_BIN_V105.zip from Adeneo website
  • Extract it to some folder (e.g. c:\WEC7_BB)
  • Install WEC7 image to memory card
    • Use TI_SDCard_boot_utility_v1_0.exe from c:\WEC7_BB\Tools folder
    • Select MLO file c:\WEC7_BB\image\REV_C\ folder
    • Select logo.bmp, ebootsd.nb0 and nk.bin as OS files
    • Click "proceed" to format memory card and install image
  • Try that WEC7 image boots in BeagleBoard XM
  • Install WEC7 SDK for BeagleBoard from SDK folder
    • Use default installation options

Now the WEC7 environment should be ready for Qt development on BeagleBoard XM.

Deploying Qt source codes

Please refer the instructions already stated in Setting up Windows Virtual PC and WEC7

Note: If Qt is wanted to use in both Virtual PC and BeagleBoard environments at the same time, there needs to be two set of Qt source codes in different folders; one built for Virtual PC and another for BeagleBoard.

This quide assumes that the following folder is used:

 c:\WEC7_BB\Qt

Modifying WEC7 hardware template MKSPEC

The latest Qt WEC7 contains only template mkspec for WEC7 target hardware. In order to use template mkspec with BeagleBoard SDK modify qmake.conf:

 mkspecs\wince70embedded-armv4i-msvc2008\qmake.conf

Replace the line:

 CE_SDK = WEC7_SDK_NAME

With line:

 CE_SDK = BeagleBoard-xM - WEC7

This quide assumes that the Qt is already build for Virtual PC. The available SDK names can be listed by calling:

 <QTDIR>\bin\checksdk.exe -list

The output of the tool should be something like:

 SDK Name: Pocket PC 2003 (ARMV4)
 SDK Name: Smartphone 2003 (ARMV4)
 SDK Name: Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
 SDK Name: Windows Mobile 5.0 Smartphone SDK (ARMV4I)
 SDK Name: Platform Builder (_TGTCPU)
 SDK Name: BeagleBoard-xM - WEC7 (ARMv4I)
 SDK Name: Windows Mobile 6 Professional SDK (ARMV4I)
 SDK Name: EVM_SDK (ARMv4I)

To use some SDK with Qt, just replace the WEC7_SDK_NAME with the selected SDK name (without architecture, architecture is stored in separate qmake variable CE_ARCH)

Building Qt for WEC7 hardware

To build Qt for WEC7 hardware, open the Visual Studio Command Prompt and configure Qt using the mkspec you modified above.

Note: Configure needs to be executed in clean Visual Studio command prompt. After setting paths for Qt building to WEC7, the same command prompt cannot be used for configure anymore.

 configure -platform win32-msvc2008 -xplatform wince70embedded-armv4i-msvc2008 -no-accessibility -exceptions

After successful configure prepare the environment for Qt building as follows:

 set PATH=%CD%\bin;%PATH%

 checksdk -sdk "BeagleBoard-xM - WEC7 (ARMv4I)" -script bb-xm-env.bat

 bb-xm-env.bat

Build Qt by calling:

 nmake

Deploying Qt to target hardware environment

Currently only manual deployment to WEC7 environments is working. Copy generated DLL, including plugins, and executable to memory card where you have WEC7 image for BeagleBoard. First create a Qt folder there and copy the whole Qt lib folder and contents of plugins folder there (Actually *.dlls are enough). The following example assumes that the memory card is visible in windows host as e: drive.

 mkdir e:\Qt
 xcopy /S lib\* e:\Qt
 xcopy /S plugins\* e:\Qt

Building Qt application for target hardware environment

This guide uses Qt example called analogclock. Example is located in:

 cd examples\widgets\analogclock

To build the Qt example run the following commands from command line in the example folder:

 qmake && nmake

Deploy created binary:

  copy release\analogclock.exe e:\Qt

Executing Qt application from target hardware

Boot the WEC7 in BeagleBoard XM from memory card.

Note: After boot take memory card out and put in back in. Adeneo WEC7 image has a bug that WEC7 needs to be booted first from memory card and then the memory card needs to be taken out put back in in order to get the the memory card visible in WEC7 BeagleBoard Explorer

The example can be ran by opening the command prompt and typing the executables name.

Another way to execute application on target hardware is to use Cetest application.