CM-FX6: WEC7: OSDesign Configuration

From Compulab Mediawiki
Revision as of 16:03, 13 February 2013 by Nadav (talk) (Overview)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

The CM_FX6_WEC7 Project combined with the CM_FX6_BSP is used to build CompuLab's Windows Embedded Compact 7 demo image.
Using the BSP you can:

  • Customize the runtime image by adding and removing OS modules.
  • Integrate proprietary software modules into the image.
  • Modify project specific configuration files (such as platform.reg, platform.bib, config.bib, etc...).

BSP Package Installation

  1. Close the Platform Builder Application.
  2. Copy the CM_FX6_BSP directory into \WINCE700\Platform.
  3. Copy the CM_FX6_WEC7 directory into \WINCE700\OSDesigns.
  4. Launch VS2008 and open \WINCE700\OSDesigns\CM_FX6_WEC7\CM_FX6_WEC7.sln

Building the Platform Project

The CM-FX6 Platform Project is used to build CompuLab’s WinCE demo image. It includes many components and is highly recommended as a starting point. The demo image size is relatively large, ~97 MB. A custom Windows CE image built for a specific application is typically much smaller.

In order to build the CM-FX6 platform, select the "Open >Project/Solution" command from the File menu of the VS2008 and select the \WINCE700\OSDesigns\CM_FX6_WEC7\CM_FX6_WEC7.sln file. The Platform Project and the workspace will be opened.

Make sure that the project is configured for Release mode(the full debug or checked image are very large and it is not recommended to build it). The build process takes up to 15-20 minutes.

Build Options

  • Use Build->Advanced Build Commands->Clean Sysgen First time you build the image and each time when you add/remove Platform Builder components (Catalog items) to/from the solution.
  • Use Build->Advanced Build Commands->Rebuild Current BSP and Subprojects when you add/remove CompuLab BSP Platform Builder components to/from the project or perform changes in BSP files.


Admolition warning.png Do not use Build->Advanced Build Commands->Build and Sysgen or Build->Advanced Build Commands->Rebuild and Clean Sysgen commands that compile and perform sysgen on the entire Platform Builder tree. In fact, it is recommended to permanently remove these two commands from the build menu.

For a release build type, the OS image files are placed in the following directory:\WINCE700\OSDesigns\CM_FX6_WEC7\RelDir\CM_FX6_BSP_ARMV7_Release

Once the build completes, there are two possibilities :

  1. For flashing the image files(eboot.nb0 and nk.nb0) using cfimager to the SD Card please refer to Creating a bootable SD card.
  2. For the evaluation with VS2008 please see the section below.

Setup Target for CM-FX6 Image Evaluation

Ensure that you have a serial terminal connected to the CM-FX6 evaluation platform as described in Console setup. Also, ensure that the CM-FX6 Ethernet port (connector P9A on the SB-FX6) is connected to your local network.

Perform the following steps to setup a connection between the CM-FX6 evaluation platform and Platform Builder 7.0 :

  1. In Platform Builder, go to Target >> Connectivity Options >> Add Device. Add new device with CM-FX6 name and optionally choose the Associated SDK (it is included in the package).
    Conn add device.JPG
  2. Press Kernel Service Map. Select the added Target Device, Ethernet for Download and Transport options and KdStub for the Debugger.
    Conn target.JPG
  3. Press Kernel Download settings, it will popup the following:
    Conn Eth Settings Not Active.JPG
  4. Boot the target device.
  5. Stop the Eboot by pressing an any key on the countdown for Initiating image launch in conected console application.
  6. Type "D" to start the download (results in a broadcast of BOOT ME messages).
  7. Platform Builder will show the target device unique name (e.g. MX6Q22068) in the "Active Devices" area.
    Conn Eth Settings.JPG

Once the connection is configured, you can download and launch the newly created WEC7 image:

  1. In Platform Builder Target toolbar, select the configured device and then select "Target" >> "Attach Device".
  2. Ensure that Eboot is ready for download (i.e. sends "BOOT ME" messages).

WinCE Image Customization

There are two ways to customize the Windows CE image:

  1. Recommended method: Add or remove BSP components from the demo CM_FX6_WEC7 project.
  2. Create a new platform project and then manually add all the necessary BSP components as described in the Platform Builder documentation. Refer to Windows Embedded Compact OSDesign Development page.

Managing BSP components with Platform Builder Catalog

You can select the BSP components you want to include in the run-time image by using the Platform Builder Catalog GUI. In case no significant BSP modifications are required, this is the easiest way to configure the image.

Device driver removal from the image is illustrated by the following example:

  1. Open catalog view in Platform Builder.
  2. Expand CM_FX6_WEC7->"Third Party"->BSP->Compulab i.MX6Q CM-FX6:ARMV7 in "Catalog Items View".
  3. Choose what components will be included within your image. In this example display is configured as HDMI and support for all I2C buses is included in the run-time image
    Catalog.JPG
  4. Once the components selection is complete, rebuild the BSP (clean build) in order for the changes to take effect.

Advanced BSP customization using batch files

Each CM_FX6_BSP component can be enabled with BSP_<Component Name> and disabled with BSP_NO<Component Name> environment variables. The BSP_<Component Name> variables are set in Platform Builder Catalog. BSP_NO<Component Name> variables in the CM_FX6_BSP\CM_FX6_BSP.bat file.
For example, in order to include the Ethernet driver in the BSP, set the BSP_ENET variable (by choosing the Fast Ethernet catalog item) and ensure that the BSP_NOETHER variable is cleared.

Admolition important.png Environment variables defined in CM_FX6_BSP\CM_FX6_BSP.bat override the variables defined in Platform Builder project

The following table lists the supported BSP_NO environment variables:

BSP_NOAUDIO No Audio driver
BSP_NOBATTERY No Battery driver
BSP_NOCSPDDK No CSPDDK driver
BSP_NOCSPI No ECSPI driver
BSP_NODISPLAY No Display driver
BSP_NOETHER No Ethernet driver
BSP_NOKEYPAD No Keypad driver
BSP_NOPMIC No PMIC driver
BSP_NOSDHC No SDHC driver
BSP_NOTOUCH No Touch screen driver
BSP_NOUSB No USB driver
BSP_NONLED No NLED driver
BSP_NOEIO No EIO Driver
BSP_NONAND_FMD No NAND Flash driver

RAM-Based Registry support

Default BSP configuration includes RAM-based Registry. This means the registry is loaded from the initial image each time Windows is loading. All run-time changes are non-persistent and volatile. In order to make permanent changes to the registry you should:

  • Change the \WINCE700\platform\CM_FX6_BSP\FILES\platform.reg file according to your needs.
  • Rebuild your image by using Build->Advanced Build Commands->Build Current BSP and Subprojects.

Platform Debugging over Ethernet

  • Ethernet KITL is supported but does not work if Ethernet NDIS driver is enabled. In current Release, Ethernet NDIS driver is enabled by default.
  • In order to have Ethernet KITL working, Ethernet NDIS driver needs to be disabled. To disable Ethernet NDIS driver, remove ENET Catalog item (BSP_ENET) from the build and do a sysgen again. Removing BSP_ENET catalog will make networking function unavailable through the wired Ethernet interface.
  • Thereafter, to use Ethernet KITL, please configure the following settings in eboot:
    1. Enable KITL
    2. Choose “ENET” as Ethernet device
    3. Enable/Disable DHCP as needed
    4. Make sure to set MAC address

Kernel Mode vs. Application Debugging

Visual Studio 2008 provides two distinct types of debuggers.

The kernel mode debugger allows debugging of CE device drivers and kernel mode code. The kernel debugger can set breakpoints in the code that is automatically loaded at startup. This debugger utilizes the KITL protocol and supports various types of physical transports (Ethernet, USB and serial). The kernel debugger can be used to debug native code applications. It cannot be used to debug .NET managed code applications.

The VS 2008 application debugger allows .NET managed code debugging. This debugger is activated automatically whenever managed code runs.

The KITL transport and kernel mode debuggers are activated, when VS 2008 is attached to a target platform for kernel mode debugging. This prevents the activation of the application debugger. In order to run the application debugger while the kernel mode debugger is still active and connected to a target platform, you must load a separate instance of VS 2008. That instance can then connect to the target platform using the configured transport and activate its application debugger. Break points may be set in both the application and kernel mode debuggers running in separate instances of the VS 2008. However, if a break point hits in the kernel debugger and the CE kernel remains halted for too long, the application debugger might disconnect from the target platform.

See Also

Windows CE OSDesign Development