Microsoft KB Archive/260571

= How To Manual Server and PPP for Debugging CE Target =

Article ID: 260571

Article Last Modified on 7/1/2004

-

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.  Build the operating system image as follows:

 Do not use any environment debugging switches before you build (for example, imgnodebugger=1, wincedebug=retail):  Modify the Platform.bib file to resemble the following:

=
============== MODULES IF IMGNODEBUGGER nk.exe         $(_FLATRELEASEDIR)\nknodbg.exe                   NK  SH ENDIF
 * Name           Path                                           Memory Type

...

IF IMGNOCOMM ! remnet.exe     $(_FLATRELEASEDIR)\remnet.exe                   NK
 * @CESYSGEN IF CE_MODULES_REMNET

cemgrc.exe    $(_FLATRELEASEDIR)\cemgrc.exe                    NK      cetlstub.dll   $(_FLATRELEASEDIR)\cetlstub.dll                  NK    tlppp.dll      $(_FLATRELEASEDIR)\tlppp.dll                     NK
 * fm-start
 * fm-end

=
==========

 Add the sections between the &quot;fm-start&quot; and &quot;fm-end&quot; 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 &quot;makeimg&quot; command (see step d) to get included in OS image. Run makeimg (not blddemo) to build your Windows CE OS after these changes.  Install Regsvr32.exe from the Platform SDK CD-ROM. If you already have Regsvr32.exe on your system, you can skip this step.</li> 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.</li> 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.</li> Set up the PPP connection as follows:

 Connect a NULL modem cable to COM2 on the target (CEPC), which is considered the logical COM1.</li> On your Windows NT workstation, on the Start menu, point to Programs, point to Administrative Tools, and then click User Manager.</li> Create a user and enable it to have dial-in access (click dialin and give dialin permission). Set a password also.</li> 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.</li></ol> </li> 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 &quot;connected&quot;.</li> Open Visual C++ 6.0.</li> 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 &quot;connection established&quot; message.</li> 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.</li></ol>

You can now use the debugger and single step, set breakpoints, and so on.

<div class="references_section">