How To Manual Server and PPP for Debugging CE Target (260571)



The information in this article applies to:

  • Microsoft Windows CE Platform Builder 2.11

This article was previously published under Q260571

SUMMARY

There are a several ways to connect to a Windows CE target and debug applications. However, for each configuration, a different set of components may be appropriate because of existing constraints. One way to connect to a Windows CE target computer from a Microsoft Windows NT workstation and then to debug an application is by using Microsoft Visual Studio for Visual C++ 6.0 Manual Server and Point-to-Point Protocol (PPP).

MORE INFORMATION

During application development, you do not need to download the operating system image from a Windows NT workstation to the Windows CE target computer, because the operating system is already on the target computer (that is, in ROM). To simulate this condition, use a CEPC with a MAXALL image downloaded to its local disk and subsequently started from there. This simulates an operating system (OS) startup on the target computer, without having to download the OS image through a connection from the Windows NT workstation.

Use the following procedure to connect to a Windows CE target computer, and then to download and debug an application.
  1. Build the operating system image as follows:

    1. Do not use any environment debugging switches before you build (for example, imgnodebugger=1, wincedebug=retail):
    2. Modify the Platform.bib file to resemble the following:
      
      ===========================
      MODULES
      ;  Name            Path                                           Memory Type
      ;  --------------  ---------------------------------------------  -----------
      IF IMGNODEBUGGER
         nk.exe          $(_FLATRELEASEDIR)\nknodbg.exe                   NK  SH
      ENDIF
      
      ...
      
      
      IF IMGNOCOMM !
      ; @CESYSGEN IF CE_MODULES_REMNET
          remnet.exe      $(_FLATRELEASEDIR)\remnet.exe                   NK  
      
      ;fm-start
          cemgrc.exe     $(_FLATRELEASEDIR)\cemgrc.exe                    NK  
          cetlstub.dll   $(_FLATRELEASEDIR)\cetlstub.dll                  NK
          tlppp.dll      $(_FLATRELEASEDIR)\tlppp.dll                     NK
      ;fm-end
      
      =======================
      
      							
    3. Add the sections between the "fm-start" and "fm-end" labels next to the line for remnet as shown in the code. These must be added because no download connection exists, and therefore the needed modules must be in the original image. These three files are normally copied over by the shell (CESH) from Microsoft Visual C++ 6.0 when you use the CESH server option instead of the Manual server option as your transport layer in Visual C++ 6.0. Therefore, you may need to manually copy them to the release folder (from Windows CE Tools\WCE211\Maxall2.11\Target\x86) before you run the "makeimg" command (see step d) to get included in OS image.
    4. Run makeimg (not blddemo) to build your Windows CE OS after these changes.
  2. Install Regsvr32.exe from the Platform SDK CD-ROM. If you already have Regsvr32.exe on your system, you can skip this step.
  3. Use a working Mansrv.dll version (the version that comes with Platform Builder 2.11 does not work correctly) and put it somewhere on your system for installation.
  4. At a Windows NT command prompt in the folder where you put the Mansrv.dll file, type regsvr32 mansrv. This will put mansrv in your registry.
  5. Set up the PPP connection as follows:

    1. Connect a NULL modem cable to COM2 on the target (CEPC), which is considered the logical COM1.
    2. On your Windows NT workstation, on the Start menu, point to Programs, point to Administrative Tools, and then click User Manager.
    3. Create a user and enable it to have dial-in access (click dialin and give dialin permission). Set a password also.
    4. Open RAS from the same Administrative Tools menu. Set the baud rate to the same number used on your target. Start your NTWS as a RAS server by using its name as the server name in the dialog box that is displayed. You may also have to give your local computer name as the domain in the Select Domain or Server menu item in the RAS admin application. If it is successful, it should see Condition=Running and Server=yourComputerName.

      NOTE: If RAS cannot be started, it may not be installed. To check for installation, open Control Panel and double-click the Services icon. You should see Remote Access Services listed. If not, then you need to install RAS from the Network icon in Control Panel. In the Services section, click Add to add services. Select RAS, and install it from your installation Windows NT CD-ROM.
  6. On the target computer, start remnet. Log in to your Windows NT host from the target computer. The RAS server and port you just started is used to connect. The user name and password you just created are required. The target computer will display "connected".
  7. Open Visual C++ 6.0.
  8. On the Tools menu, click Configure Platform Manager, and then select your exported SDK device. Click PPP transport, click Manual Server, click OK, and then click Test to establish a connection. The Manual Server will display a dialog box and ask you to start Cemgrc.exe on the Windows CE target computer with a command line similar to the following:

    cemgrc /T:TLPPP.DLL /D:88130000

    You will then see a "connection established" message.
  9. Build your application in Visual C++ 6.0 and download to your target computer through the PPP connection that was just established. The build process does this automatically, but you can also click Update Remote File on the Build menu.
You can now use the debugger and single step, set breakpoints, and so on.

REFERENCES

Platform Builder 2.11 Books On Line

Modification Type:MinorLast Reviewed:7/1/2004
Keywords:kbhowto KB260571