DOC

Lab1 Advanced Image Customization and Build

By Juanita Marshall,2014-04-12 20:41
15 views 0
Lab1 Advanced Image Customization and Build

    Lab 1: Advanced Image Customization

    and Build

    Objectives

    After completing this lab, you will be able to:

    ; Create a Windows CE Platform.

    ; Create a Windows CE Project.

    ; Modify a Windows CE operating system image.

    Prerequisites

    Before working on this lab, you must have:

    ; The knowledge of running the Windows CE Platform Builder Wizard.

    ; Familiarity of the menus and views of an open platform workspace.

    Estimated time to complete this lab: 90 minutes

2 错误?使用“开始”选项卡将 heading 1 应用于要在此处显示的文字。

Lab Setup

    To complete this lab, you must:

    ; Have a bootable floppy provided by Instructor acting as the CEPC

    Bootloader or similar technology pre-loaded onto the platform.

    ; Know the UDP name of the network card used for downloading/debugging.

     错误?使用“开始”选项卡将 heading 1 应用于要在此处显示的文字。 3

    Exercise 1

    Creating and Building a Windows CE Platform In this exercise, you will create a Windows CE platform and create a Windows CE application project.

     To create a Windows CE platform

    1. On the development workstation, launch the Platform Builder application. 2. On the File menu, click New Platform, and then click Next.

    3. Under Available BSPs, select CEPC:X86, and then click Next.

    4. From the list of available platform configurations, select Internet

    Appliance.

    5. In the Platform Name text box, type MyPlatform as the name for your

    platform, and then click Next.

    6. Select Internet Appliance, and then click Next.

    7. The fifth step is Application & Media. If it exists, deselect Technology

    Preview .NET Compact Framework or Beta .NET Compact

    Framework. Click Next to accept .

    8. Click Next to accept the Networking & Communications defaults.

    You may be presented with a security warning about Bluetooth or Note

    another networking protocol. If this happens, read the warning, check the

    Notification Acknowledged checkbox and click Next

    9. Click Done to create the new Platform.

    10. Select the CEPC: X86 Win32 (WCE x86) Debug configuration. This

    setting is on the toolbar. The drop down box allows you to change the active

    configuration.

    11. On the Platform menu, click Settings.

    12. Verify that MyPlatform is highlighted and that the Settings for is set to

    CEPC: X86 Win32 (WCE x86) Debug. The settings of this dialog can be

    saved for individual features and for Debug vs. Retail builds. 13. On the Environment tab, click New to add a new environment variable.

    14. In the Variable Name field, type: IMGRAM64.

    15. In the Variable Value field, type: 1.

    16. Click OK to return to Platform Settings.

    17. Click OK to return to Platform Builder.

To create a new Windows CE project

    1. On the File menu, click New Project or File.

    2. In the New dialog box, click the Projects tab. Then select WCE

    Application as the project type.

    3. In the Project name edit box, name your project HelloWorld. Click OK.

    By default, the project is created inside the public directory under the

    project directory.

    4 错误?使用“开始”选项卡将 heading 1 应用于要在此处显示的文字。

    4. The next dialog box asks you whether you want to create an empty project

    or use the wizard to generate a startup code. Select A typical “Hello

    World!” application.

    5. Click Finish.

To build the Windows CE platform

    1. Select the FeatureView tab.

    2. The kernel debugging build should be enabled by default. To verify, on the

    Platform menu, click Settings.

    On the Build Options tab, make sure that the Enable Kernel Debugger

    and Enable KITL checkboxes are selected when the Debug active

    configuration is set. Click OK.

    3. To build a Windows CE image, on the Build menu, click Build Platform.

    This will take about 5-10 minutes depending on the speed of your build Note

    machine. You can check the status of the build by looking at the bottom right hand corner of main Platform Builder window

To download the Windows CE image to your device

    1. On the Target menu, click Configure Remote Connection.

    2. Verify if Active Named Connection is set to MyPlatform, Download is

    set to Ethernet, and Kernel Transport is set to Ethernet.

    Make sure to configure the download to use the correct device

    corresponding to the download UDP name of your device. For this lab, you

    should have an Ethernet connection from your build machine to the target

    device.

    3. Select the Configure button for Download.

    4. Reboot your device.

    5. Watch the Configure Ethernet Download Service window until the UDP

    name of your device comes up. Select the UDP name of your device. It will

    automatically appear as the Selected Device. Click OK.

    6. Click OK.

    7. In the Target menu, click Download/Initialize.

    8. If the download does not start directly, reset the target device again.

    Once the device sends the BootMe record, Platform Builder will make a

    connection and send the CE operating system image to the device. 9. Once you have viewed the running CE device you need to disconnect

    Platform Builder from the device in order to do any further build work.

    From the Target menu, click Disconnect.

     错误?使用“开始”选项卡将 heading 1 应用于要在此处显示的文字。 5

    Exercise 2

    Creating a CEC File to Build Applications In this exercise, you will add an application, created in eVC++, to your build.

    To do this, you will create a CEC file. You will add a feature group to the CEC

    file and add a feature to the feature group. You will then add a BuildRel Build

    method and a copy action to the feature. You will also add a BIB file with a

    BIB record to your feature.

     To copy application files from the lab files directory 1. Open Windows Explorer and browse to: \Program

    Files\MSDNTrain\2540B\Labs\Lab1\

    2. Copy all the contents from this directory by using Select All

    3. Create the directory $(_WINCEROOT)\PUBLIC\MyPlatform\eVC_app 4. Paste the \Lab1 files into \eVC_app

To create a new CEC file

    1. Using Platform Builder, click the Tools menu and run the CEC Editor.

    2. When you open the CEC Editor for the first time, it displays a new CEC

    file NewCEC1. If the CEC Editor does not open the file, on the File menu,

    click New.

To add a feature group to the CEC file

    1. In the CEC file, right-click the Catalog, and then click Insert Feature

    Group.

    2. In the Name field, type Lab 1.

    3. In the GUID field, click New to create a new GUID.

    4. In the Description field, type App for Lab 1.

    5. In the Vendor field, type your name.

    6. In the Group field, type \MOC.

    Do not change the defaults values of the Leave HelpID and Resolved

    Features Allowed fields.

    7. Click OK.

To add a feature to the Feature Group

    1. Expand the Catalog tree, and then expand the MOC tree to display the Lab

    1 Feature Group.

    2. Right-click Lab 1, and then click Insert Feature.

    3. In the Name field, type eVC_app.

    4. In the GUID field, click New to create a new GUID.

    5. In the Description field, type a description for the feature. 6. In the Version field, type 1 in the leftmost field and 0 in the other three

    fields.

    6 错误?使用“开始”选项卡将 heading 1 应用于要在此处显示的文字。

    7. In the Vendor field, type your name. 8. In the Locale field, enter the HEX value 0409 for English. 9. Click OK.

     To add a Build Method to the Feature 1. Right-click the eVC_app Feature, and then click Insert Build Method. 2. In the GUID field, click New to create a new GUID. 3. In the Step field, select PreMakeImg.

    4. In the CPUs field, select x86.

    5. In the Supported CoreOS area, click Select None to deselect all. 6. Click OK.

To add a Copy Action to your BuildRel Build Method

    1. Right-click your current PreMakeImg Build Method, select Insert Action,

    and then click Copy

    2. In the Source File field, type:

    $(_WINCEROOT)\PUBLIC\MyPlatform\eVC_app\X86Dbg\eVC_app.

    exe

    3. In the Target Directory field, type $(_FLATRELEASEDIR).

To add another Copy Action to your BuildRel Build Method

    1. Right-click your current PreMakeImg Build Method, select Insert Action,

    and then click Copy

    2. In the Source File field, type:

    $(_WINCEROOT)\PUBLIC\MyPlatform\eVC_app\eVC_App.reg

    3. In the Target Directory field, type $(_FLATRELEASEDIR).

     To add a BIB File to your feature 1. Right-click the eVC_app Feature, and then click Insert BIB File.

    2. In the GUID field, click New to create a new GUID. 3. In the CPUs field, select x86.

    4. Click OK.

     To add a BIB Record to your BIB file 1. Right-click your new Bib Record, which should be labeled as x86, and then

    select Insert BIB Record.

    2. In the File Path field, type $(_FLATRELEASEDIR)\eVC_app.exe

    3. In the Image Name field, type eVC_app.exe

    4. In the Memory Section field, select NK.

    This puts NK in the ROM image, NK.bin. 5. In the BIB Sections field, change the Record Type to Modules.

    6. Click OK.

     To finalize and save the CEC file

     错误?使用“开始”选项卡将 heading 1 应用于要在此处显示的文字。 7

1. On the File menu, click CEC Properties.

    2. In the Name field, type MOC.CEC.

    3. In the GUID field, click New to create a new GUID.

    4. In the Description field, type the description for the CEC file.

    5. In the Vendor field, type your name.

    6. Click OK.

    7. On the File menu, click Save As.

    8. In the Save As dialog box, type MOC as the file name and leave the Save as

    type at Catalog files (*.cec). Place the file in \Program Files\Windows CE

    Platform Builder\4.00\cepb\cec which should be the default shown. 9. Click Save but do not close the file in the CEC Editor.

    10. Using Windows Explorer, navigate to the \Program Files\Windows CE

    Platform Builder\4.00\cepb\cec directory and verify that your MOC.cec file

    was saved.

    Note: There are two bugs with the CEC Editor that involve file saving. One

    is that if you manually add the file extension of cec in all capitol letters, the

    file will not save. The other is that the CEC Editor will not warn you that

    you are trying to save into a read-only directory.

     Close the CEC Editor. 11.

    8 错误?使用“开始”选项卡将 heading 1 应用于要在此处显示的文字。

    Exercise 3

    Importing the CEC File and Downloading the Image In this exercise, you will use the Platform Builder to import the CEC file in order to add the feature information into the Platform Builder Catalog. You will also build the platform, download the image to your device, and verify that the newly added application is present and functioning on the device. To import the CEC file

    1. Return to Platform Builder.

    2. On the File menu, click Manage Catalog Features.

    3. Click the Import button.

    4. Browse to the \Program Files\Windows CE Platform Builder\4.00\cepb\cec

    directory.

    5. In the CEC directory, select the MOC.cec file.

    6. Click Open.

    7. Click OK to close the Manage Catalog Features dialog.

    This imports the CEC file that you created and adds the Feature information into the Platform Builder Catalog.

     To add the Feature and build the Platform

    1. Locate eVC_app: In the Catalog, expand MOC folder and select the

    eVC_app feature.

    2. Drag the eVC_app Feature to the FeatureView window and drop it on the

    MyPlatform platform name.

    The eVC_app Feature should now appear in your platform.

    3. On the Build menu, click Makeimg.

    We can skip to the last phase of the build, or Makeimg, here because the

    Build methods added by eVC_app only affect the Makeimg step. After the

    build has completed, examine the output window for errors.

To download the image to the device

    1. Verify that the MyPlatform platform is displayed in the FeatureView

    window in the IDE.

    2. On the Target menu, click Download/Initialize, and then click OK. The

    connection information was already set during Exercise 1. 3. Reboot the CEPC.

    While the CEPC is rebooting, you can monitor progress by watching the

    output window and the status bar.

    When the download is completed information is displayed in the Debug

    window. The status bar indicates that the Target Control (CESH) and Target

    Messages (CETerm) are running and the Debugger will show as running or

    breaking.

    After the image has successfully booted, the Windows CE operating system

    is displayed on the CEPC screen.

     错误?使用“开始”选项卡将 heading 1 应用于要在此处显示的文字。 9

To verify the Application

    1. To start a program, on the Target menu, click Run Programs.

    2. A drop-down list displays available programs to run. Select eVC_app.exe.

    The eVC_app should run and display the registry key added by

    eVC_app.reg. You may change this registry key by either running Remote

    Registry Editor on the live device or by editing eVC_app.reg in the

    _FLATRELEASEDIR, running Makeimg and downloading the new image.

Report this document

For any questions or suggestions please email
cust-service@docsford.com