How to Copy a File to a Target Device by Using File Viewer (Windows Embedded CE 6.0)

1/5/2010

You can copy a file from a development workstation that has Platform Builder installed to a target device by using the File Viewer remote tool. In this procedure, you create a sample file, export the file to the target device, and then use the Target Control window to run a command on that file.

You can also use File Viewer to perform the following tasks:

  • Import files from the target device to the development workstation
  • Display the properties of a file or a folder on a target device
  • Rename a file or a folder on the target device
  • Delete a file or a folder on the target device

Hardware and Software Assumptions

  • You are familiar with how to use the remote tools. For more information, see Remote Tools.
  • If your target device is a Windows Embedded CE PC-based platform (CEPC), you have already set up the CEPC for downloading and debugging a run-time image. For more information, see How to Set Up a CEPC.
  • If you are using a computer that runs Windows Vista, you are running Platform Builder for Windows Embedded CE 6.0 with administrator privileges.

Steps

Step Related Information

1. Create the file that you want to copy to the target device.

  • Create a .bat file that is named file.bat by using a text editor.
  • In the file, type a command that is compatible with the features on your target device.
  • Save file.bat in %_WINCEROOT%\OSDesigns\%_TGTPROJ%\Wince600\<BSP>\OAK\files.

No further information

2. Open an OS design, or use the Windows Embedded CE OS Design Wizard to select a design template and the initial components of your design.

After you create the OS design, choose Catalog Item View and ensure that it includes the required Catalog items. The OS design must include support for the following SYSGEN variables:

  • SYSGEN_SHELL
  • SYSGEN_RELFSD
  • SYSGEN_CPP_EH_AND_RTTI

To use ActiveSync transport for the configured connection, the OS design must include support for ActiveSync. For more information, see ActiveSync OS Design Development.

To use TCP/IP transport for the configured connection, the OS design must include support for TCP/IP. For more information, see TCP/IP OS Design Development.

Creating an OS Design with the Windows Embedded CE OS Design Wizard

3. Customize the OS design to include support for the type of file that you want to copy to the target device.

Enabling Support for File Types in an OS Design

4. Choose a Debug or Release Configuration to target when Platform Builder builds the OS design into a run-time image.

To use the kernel debugger, ensure that support for the kernel debugger is enabled.

Levels of Debugging Support

Building a Run-Time Image From a Debug Configuration

Building a Run-Time Image From a Release Configuration

5. Enable the Target Control Service.

Enabling the Target Control Service

6. If you expect the size of either the debug or the release run-time image to exceed 32 MB, enable support for a large run-time image in the settings for the OS design.

Ee479571.note(en-US,WinEmbedded.60).gifNote:
Debug run-time images are typically larger than release run-time images. If you choose a debug configuration and the OS design contains many features, it is likely that the size of the run-time image will exceed 32 MB.

Enabling a Run-Time Image Size Larger Than 32 MB

7. If you have not built your run-time image, build the OS design into a run-time image.

Building a Run-Time Image

8. In the Output window, on the Output tab, verify that the build contains no errors.

Build Error Debugging Process

9. Choose a download service appropriate for the connection hardware. The download service will download a run-time image to the target device.

  • To use ActiveSync transport with File Viewer, you must choose the serial download service and then complete further configuration steps.
  • To use KITL transport with File Viewer, you can use either Ethernet or serial download services.
  • To use TCP/IP transport with File Viewer, you must choose the Ethernet download service and then complete further configuration steps.

Download Service Selection

ActiveSync Transport

TCP/IP Transport

10. Set up and configure the connection hardware required for the download service. The connection hardware connects the target device to the development workstation, on which Platform Builder is installed. Examples of connection hardware include cables, a hub, or Ethernet network adapters.

Hardware Configuration

11. If you selected Serial Download Service in step 8, configure the HyperTerminal terminal emulation application to display the serial debug output from the serial port on the target device.

This configuration requires a null-modem cable connected to a serial port, such as COM1.

Configuring HyperTerminal for BSPs

12. Turn on the target device so that it becomes active on the Ethernet network or over the serial connection, and so that Platform Builder can discover it.

No further information

13. Configure the connection to the target device.

Choose the appropriate topic based on whether the development workstation and the target device are connected by an Ethernet network or a serial port connection.

Configuring an Ethernet Remote Connection

Configuring a Serial Remote Connection

14. Download the run-time image to the target device through the configured connection.

Wait until all modules are loaded onto the target device.

  • To ensure that File Viewer successfully connects to your run-time image, download a run-time image from the local release directory for your OS design. The default location of the release directory for your OS design is %_WINCEROOT%\OSDesigns\%_TGTPROJ%\RelDir\%_TGTPLAT%\%_TGTCPUFAMILY%_Release. For information about the contents of the release directory, see Opening the Release Directory.

Downloading a Run-Time Image

15. Start the File Viewer tool by doing one of the following:

  • Choose Start, choose All Programs, choose Microsoft Visual Studio 2005, choose Visual Studio Remote Tools, and then choose Remote File Viewer.
  • In Platform Builder, on the Target menu, choose Remote Tools, and then choose File Viewer.

No further information

16. Connect File Viewer to the target device.

  • If you are using TCP/IP transport, you must configure the connection by using the steps in TCP/IP Transport.
  • If you are using ActiveSync transport, you must first complete the pre-requisites in ActiveSync Transport.

Configuring the Connection to a Target Device Using Platform Manager

Troubleshooting a Connection to a Target Device That Uses Platform Manager

17. Copy the file that you created to the target device.

  • In this example, copy it to the Release folder.

Exporting a File to a Target Device

18. In Platform Builder, open the Target Control window.

  • On the Target menu, choose Target Control.

No further information

19. In the Target Control window, run the .bat file.

  • Type run file.bat.

Target Control Debugging Commands

See Also

Tasks

Displaying the Properties of a Folder or File
Creating a New Folder on a Target Device

Reference

Application Connectivity

Concepts

Target Control Service

Other Resources

Debugging and Testing How-to Topics