DOC

Lab1 Using Platform Builder

By Lillian Hawkins,2014-04-12 20:41
6 views 0
Lab1 Using Platform Builder

    Lab1: Using Platform Builder Objectives

    After completing this lab, you will be able to: ; Create a platform

    ; Localize, build and download an operating system image ; Boot the operating system

Prerequisites

    Before working on this lab, you must have:

    ; Familiarity with the following terms as they are defined in the Platform

    Builder online Glossary:

    ; Platform

    ; Project

    ; Board Support Package (BSP)

    ; Configuration

    ; Feature

    ; CEPC

    Estimated time to complete this lab: 35 minutes

2

Exercise 1

    Lab Setup

    This lab assumes that…

    1. You selected the Emulator microprocessor when you installed Platform

    Builder.You installed Platform Builder in the default directory provided by the Setup program.

     3

    Exercise 1

    Using Platform Builder with the CEPC Emulator The purpose of this exercise is to guide you through the high-level steps of creating and configuring a platform, then building an operating system Image. You will be introduced to common tasks that you will use to develop, test, and export your platform and applications. You will run the operating system image on the new hardware Emulator, familiarizing yourself with the steps of downloading an image to the Emulator for Windows CE. In this exercise you will learn how to:

    ; Create a platform

    ; Verify active configuration

    ; Modify to localize a platform

    ; Build an operating system image

    ; Set up an Emulator connection

    ; Download and boot an operating system image on the Emulator ; Create and build an application

    ; Run an application on the Emulator

    ; Export a Software Development Kit (SDK)

    ; Debug using an image built for the Emulator.

To create a platform

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

    3. From the list of available BSPs, select EMULATOR:X86, and then click

    Next.

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

    5. In the Platform name box, type 2530Lab1 as the name for your platform,

    and then click Next.

    Note where does Platform Builder creates directory for your Platform files. 6. Verify that Internet Appliance is selected, and click Next.

    7. Select the Internet Appliance standard from the Step 4 popup for

    configuration variants. Click Next.

    8. Review the Application & Media defaults. Remove the check for

    BETA .NET Compact Framework and click Next.

    9. Review the Networking & Communications defaults and click Next to

    accept the default values.

    10. A Security Warning dialog regarding networking issues displays next.

    Review this and click Next.

    11. Click Done to manually build the image with the Platform Builder

    integrated development environment (IDE).

    Platform Builder now generates the initial platform files. Progress can be

    seen in the status bar at the lower right corner of the IDE.

    4

To verify active configuration

    1. On the Build menu, click Set Active Configuration.

    2. Verify that 2530Lab1 EMULATOR Win32 (WCE emulator) Debug is

    selected.

    Note that this window reflects the setting shown in the drop down on the

    toolbar. You may also change the active configuration from this drop down. 3. Click OK.

To localize a platform and set-up memory

    1. On the Platform menu, click Settings.

    2. Verify that in the Settings For box, EMULATOR Win32 (WCE emulator)

    Debug is selected.

    3. On the Locale tab, from the Locales box, make sure that German

    (Germany) is highlighted.

    4. From the Default Language drop down, select German (Germany).

    5. From the Environment tab, click New.

    6. Add the Variable Name IMGRAM64 and set the Variable Value to 1.

    7. Click Ok.

    8. Click OK to close the Platform Settings dialog box.

     To make an operating system image for the Emulator with the kernel

    debugger enabled

    1. On the Platform menu, click Settings.

    2. In the Settings For box, confirm that the 2530Lab1 - EMULATOR Win32

    (WCE emulator) Debug configuration is selected.

    3. On the Build Options tab, verify that Enable Kernel Debugger check box

    is selected, and then click OK.

    4. On the Build menu, click Build Platform.

    Watch the status bar, lower right corner, for the status monitor application.

    These keep track of the state of processes on your target device.

    The length of time that Platform Builder takes to build the image depends

    on the number of features that are included in the platform. In this exercise,

    you are building a large configuration, so the build time will be several

    minutes. During this time, data appears in the Build window.

    When the Status Monitor bar shows the Build status as Not Building, you

    have successfully built the operating system Image. The next step is to

    download operating system image to the Emulator.

To set up a connection to the Emulator

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

    2. On the Configure Remote Connection dialog box, click the Services tab.

    3. From the Download box, select Emulator.

     5

4. Click the Configure button. In the System box, set the Memory (MB)

    dropdown to 64. Click OK.

    5. From the Kernel Transport box, click Emulator.

    6. Click the Settings Tab.

    7. Under Download / Initialize Device, verify that the Connect to Device

    check box is selected, and then click OK.

    The Remote Services are now configured for the Emulator for Windows CE,

    and you are now ready to establish the connection and download the

    operating system Image.

     To download and boot an operating system image for the Emulator 1. Verify that in the IDE, in the FeatureView window, the 2530Lab1 features

    platform is selected.

    2. On the Target menu, click Download/Initialize.

    3. When the Emulator loads it will display a KITL Security Warning Dialog.

    Review this and click OK.

    Wait until the operating system image appears in the Virtual CEPC window.

    This can be a lengthy process, depending on the size of the operating system

    image being downloaded. While the image is being loaded, there will be

    intermittent activity in the Debug Tab of the Output window, and the Status

    Monitor window will indicate that the Target Control (CESH), Target

    Messages (CETerm), and the Debugger are in a Waiting state. As the

    download proceeds, these services will change to a Running state.

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

    operating system is displayed in the Virtual CEPC window.

    You can move, resize, or minimize the Virtual CEPC window, but you Note

    should only close it when instructed to do so.

     To create and build an application

    1. In the Platform Builder, on the Target menu, click Disconnect. Click OK

    to accept stopping services. Click Yes to stop the debugger. 2. On the Emulator menu of the Emulator, click Shut Down, select Turn off

    Emulator, and then click OK.

    3. In the Platform Builder, on the File menu, click New Project or File.

    4. In the New Project or File dialog box, click the Projects tab, and then

    verify that the WCE Application is selected.

    5. In the Project Name text box, type Hello, and then click OK.

    6. Select A typical "Hello World!" application, and then click Finish.

    7. On the Build menu, click Build Hello.exe to build the application.

    When the Status Monitor window shows the Build status as Not Building,

    your application has been built. You will also see the following in the Build

    tab of the output window:

    Hello.exe 0 error(s), 0 warning(s)

    6

    By completing this step, you have successfully created an application. You

    are now ready to run that application on the emulator.

To run a program on the Emulator

    1. On the Target menu, click Download/Initialize.

    The Emulator appears, and your localized operating system image executes

    in this window after being successfully downloaded. Remember to click

    through the KITL Security Warning.

    2. In the Platform Builder, on the Target menu, click Run Programs.

    3. In the Available Programs box, select Hello.exe, and then click Run.

    Hello.exe is then downloaded from the development workstation and is run

    on the Emulator. Verify this by switching to the Emulator and viewing the

    Hello application loaded.

    By completing this step, you have executed a user created application on the

    Emulator. You are now ready to export an SDK.

To create and export an SDK for eMbedded Visual C++ 4.0

    1. On the Platform Builder Target menu, click Disconnect. Click OK to

    disconnect services then Yes to stop debugging

    2. On the Emulator menu of the Emulator, click Shut Down, select Turn off

    Emulator and then click OK.

    3. On the Platform menu, click Configure SDK, and then click Next.

    4. Enter information in the required fields, and then click Next.

    5. Select either .NET Compact Framework or eMbedded Visual C++ v4.0

    support and then click Next.

    6. Inside the dialog window, click the link Build my SDK now.

    7. If .NET Compact Framework was chosen, click OK to the .NET warning

    dialog.

    The Wizard displays information while the SDK is being built. 8. When the build is complete, click Done to close the Platform Export SDK

    Wizard.

    Your SDK is in $(_WINCEROOT)\Public\2530Lab1\SDK\2530Lab1.msi.

    Congratulations. After successfully completing all the steps in this exercise, you have created a Windows? CE SDK for the Emulator environment.

     7

    Exercise 2

    Debug in the Emulator

    The purpose of this exercise is to debug the operating system on the Emulator using the Kernel debugger.

     To debug the operating system on the Emulator using the kernel

    debugger

    1. On the Target menu, click Download/Initialize.

    The Emulator appears, and your localized operating system image executes

    in this window after being successfully downloaded. Click OK on the

    KITL Security Warning.

    2. On the Debug menu of Platform Builder, click Break.

    3. On the File menu, click Open.

    4. Browse to

    $(_WINCEROOT)\Platform\Emulator\Drivers\Kbdmouse\Emulkbms,

    select PS2MOUSE, and then click Open.

    You have opened the Ps2mouse.cpp file, which contains source code for

    the mouse driver.

    5. On the Edit menu, click Find.

    6. In the Find what box, type _move, and then click Find Next. It takes to a

    piece of code in the Ps2mouse.cpp file that handles a mouse move event.

    7. Press the F9 key to set a breakpoint in the source code at the mouse move

    event. The red dot in the margin shows that the breakpoint has been set. 8. On the Debug menu, click Go.

    9. From the taskbar, click 2530Lab1 - Emulator for Windows CE to display

    the 2530Lab1 - Emulator for Windows CE window.

    10. Move the cursor over the 2530Lab1 - Emulator for Windows CE window.

    The breakpoint activates and the IDE displays. You will notice a yellow

    instruction point or current instruction arrow on the breakpoint symbol. 11. On the Edit menu of the IDE, click Breakpoints.

    12. Click Remove All, and then click OK to remove the breakpoint that you set.

    13. On the Debug menu, click Go. You have successfully halted the operating

    system, set and activated a breakpoint in one of the drivers, and removed the

    breakpoint. Follow the remaining steps to stop debugging the operating

    system.

    14. On the Debug menu, click Stop Debugging. Click Yes. Control returns to

    the IDE.

    15. On the Target menu, click Disconnect, and then click OK.

    16. Turn off the Emulator.

Report this document

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