Microsoft KB Archive/238076

From BetaArchive Wiki
Knowledge Base


HOWTO: Use MINCOMM Configuration to Debug Applications Using Parallel Download & Serial Debugger on CEPC

PSS ID Number: 238076

Article Last Modified on 1/29/2000



The information in this article applies to:

  • Microsoft Windows CE Platform Builder 2.11



This article was previously published under Q238076

SUMMARY

This procedure applies to building and debugging an application by using the MINCOMM configuration. In this configuration, there is no graphical user interface (GUI), and therefore you cannot use remnet (Remote network dialing application module) to connect to the workstation. This procedure shows how to download and debug a MINCOMM application.

MORE INFORMATION

The system configuration is:

  • Microsoft Windows NT 4.0 workstation, Service Pack 4 (SP4), Platform Builder 2.11, Visual C++ 6.0
  • A Windows CE PC (CEPC)
  • Serial cable between COM1s on both computers
  • CEPC parallel cable

Here are the step-by-step procedures for building the operating system, the application, and for debugging the application:

  1. Build a MINCOMM operating system with IMGNODEBUGGER= (nothing).
  2. In Platform Builder, on the Build menu, click Configuration. Create a new configuration and call it MINCOMM. You must copy the appropriate include and library directories during the configuration. The wizard will direct you through this process.
  3. Export the MINCOMM Software Development Kit (SDK) if you want to use Visual C++ 6.0. If you want to use Platform Builder for your applications, you don't need to export the MINCOMM SDK. If you have already exported a MAXALL SDK, you probably don't need to export the MINCOMM SDK, because MINCOMM is a subset of MAXALL and all the *.h and *.dll files will be present. (This has not been explicitly tested.)
  4. Build your application (for example, Myapp.exe) with the following Platform Builder 2.11 or Visual C++ 6.0 settings:

    • Active WCE Configuration = MINCOMM
    • Active Configuration = Win32 (Windows CE x86) Debug
    • Default Device = MINCOMM (in Visual C++ 6.0 only)


    Platform Builder may display an error message at link time because many libraries are not included in the MINCOMM directory. On the Project menu, click Settings. Click the Link tab, in the Category box, click Input, in the Additional Library Path box, set the path to point to the MAXALL libraries at:

    F:\WINCE211\PUBLIC\MAXALL\cesysgen\sdk\lib\x86\i486\CE\debug

    This process should resolve the problem with the link libraries. Substitute the appropriate drive letter.
  5. Depending on your project settings, the output files (.exe and .pdb) may or may not be copied to your release directory. If the output files are not copied, manually copy the Myapp.exe and Myapp.pdb files to your release directory.
  6. Start Windows CE Shell (CESH). From the build window, type start cesh -p cepc nk.bin (the debug size is approximately 1.3 MB).
  7. Create a Windbg shortcut by copying the shortcut for the debugger from your Windows NT workstation. Click Start, point to Programs, point to Platform Builder 2.11 point to x86 Tools, and copy Debugger for x86. Set the properties to:

    F:\WINCE211\SDK\BIN\I386\WINDBG.EXE -y %_FLATRELEASEDIR% -k cepc com1 38400 -g

    This uses COM1 on a Windows NT workstation. Also, connect the cable to COM1 on CEPC for serial debugging. Before you start downloading, make sure you invoke Windbg and that it is running. The following message is displayed, "Kernel debugger waiting to connect on COM1: at 38400 baud."
  8. On CEPC, type loadcepc /B:38400 /C:1 /D:3 /P nk.bin to download Nk.bin through the parallel port. When the download is complete, note that the modules are loaded on the Windbg window and a CESH prompt is given.
  9. In the CESH window, type break. This action will break you into the debugger.
  10. At debugger command window, type bp {,,myapp.exe}WinMain. This action sets a break point at entry to the WinMain function in your application. The debugger window may display the error message:

    Breakpoint not instantiated


    This error message occurs because your application is not loaded yet. You can disregard the error message. Click GO in the debugger window to continue. You can also use the name of any other valid function (instead of WinMain) in your program in the breakpoint command.
  11. In the CESH window, type s myapp. This action loads your application from the release directory and will hit the break point you just set. You will be in the debugger and can do symbolic debugging out of the source code, set other breakpoints, single step, look at variables, and so on.


REFERENCES

Platform Builder version 2.11 Online books

Keywords: kbhowto KB238076
Technology: kbAudDeveloper kbSDKSearch kbWinCESDK211 kbWinCESDKSearch kbWinCESearch