As part of any software development project, we spend a lot more time and effort to correct and improve existing code than developing new code. A development environment with efficient debug tool can help minimize the time and effort needed to resolve bugs and improve the code.
In part-8 of this getting started series, we will talk about the debugging tools available as part of the Compact 7 development environment and work through couple of examples, showing how to use Compact 7 remote tools to debug a KITL enabled OS image launched on a target device.
The Compact 7 getting started series consist of 9 different articles, to provide information about OS design, application development and related development tools. When application, hands-on examples written in step-by-step format with graphic illustrations are provided.
For more information about this series, visit:
To work through the exercises in this guide, we need to have the following:
· Development PC with Visual Studio 2008 with SP1 and Windows Embedded Compact 7.
· Successfully compiled a Compact 7 OS image and deploy the image to a target device.
Target Device: eBox-3300MX
The exercise in this guide is created using an eBox-3300MX (eBox) as the target device. Refer to the following URL for more information about the eBox:
Alternative Target Device: Virtual PC
Using a Virtual PC as target device, we can work through the same exercise in this guide. To do so, an OS runtime image generated from the OS design created using the Virtual PC board support package (BSP) is needed.
To work through the sample exercises using Virtual PC as the target device, refer to part-3a of this series, Develop OS Design for Virtual PC, for more information about developing an OS design and downloading OS runtime image to a Virtual PC target device.
Within a Compact 7 project, there are different debugging environment for different development stages, where each of these stages may require different connectivity and tools for debugging, such as:
· Application development.
· Bootloader development.
· Device driver development.
· OS design development.
In part-4 of this series, Managed code application for Compact 7, we talked about CoreCon and work through an example, showing the steps to develop a managed code application, download the application to the target device and debug the application as the code execute on the target device. Refer to this application note for information about debugging application.
Debugging Bootloader and Device Driver
Bootloader and device driver development are advanced subject and is not within the scope for this getting started series to cover.
Debugging OS Design
To debug Compact 7 OS runtime on a target device, you can use Target control and the following remote tools, provided as part of the Compact 7 software:
· Remote File Viewer
· Remote Process Viewer
· Remote Profiler
· Remote Registry Editor
· Remote Resource Consumer
· Remote Resource Leak Detector
· Remote System Information
· Remote Zoom
· Remote Timeline Viewer
· Remote Kernel Tracker
· Remote Performance Monitor
· Remote Power Monitor
KITL, short for Kernel Independent Transport Layer, is used to establish connectivity between the VS2008 development workstation and the target device to support remote tools.
In order to use and establish KITL connectivity, network driver for the target device must include KITL support. A quality Compact 7 board support package (BSP) should include KITL support. For more information about KITL, refer to the following URL:
Using the existing OS design project from part-3 of this series, Develop a Compact 7 OS Design, we will go through the following steps to configure the OS design and build a KITL enabled OS image to support the remote tools:
If you don’t have access to an eBox, you can use the OS design project from part-3a of this series, using Virtual PC as the target device.
1. Launch the OS design project, MyCompact7 (eBox as target device) or MyVPC (Virtual PC as target device), using Visual Studio 2008.
2. From VS2008 menu, select ViewàSolution Explorer to bring focus to the Solution Explorer window.
3. From the Solution explorer window, right mouse click on the OS design project node, MyCompact7 (eBox as target device) or MyVPC (Virtual PC as target device), and click on Properties, as shown in Figure-1, to bring up the MyCompact7 Property Pages screen.
Figure – 1
4. From the left pane on the MyCompact7 Property Pages screen, expand the Configuration Properties node and select Build Options.
5. From the right pane, double click Enable KITL to enable this build option, as shown in Figure-2.
Figure - 2
6. From MyCompact7 Property Pages screen, click Apply follow by OK to save and close the screen.
7. From VS2008 IDE, click on Catalog Items View tab to bring focus to the Catalog Items View window.
8. From the Catalog Items View window, expand the \Third Party\Embedded101\ folder, uncheck the AutoLaunch_v300_Compact7 component and associated sub-components, as shown in Figure-3.
Figure – 3
The AutoLaunch and AutoLaunch-CoreCon components were added to the OS design in the earlier application notes, to support application development. The AutoLaunch-CoreCon component is in conflict with the KITL connectivity, needed to support the remote tools.
9. From VS2008 menu, select BuildàBuild Solution to build and generate an OS image.
10. Download the OS image to the target device.
For information about downloading OS image to the target device, refer to the following post:
Using the KITL enabled OS image (downloaded to the target device) from the previous section, work through the following steps to use the Remote Registry Editor to view and edit the target device’s registry settings:
1. From VS2008 menu, select ToolsàRemote ToolsàRegistry Editor to bring up the Remote Tools Shell, with a Connecting to device screen, attempting to establish connection to the target device, as shown in Figure-4:
Figure - 4
2. After connection is established, the Remote Tools Shell is shown with the Registry Editor, as shown in Figure-5.
Figure - 5
3. From the above Remote Tools Shell, we can view and edit the target device’s registry settings remotely from the development workstation.
Using the same steps as above, we can launch the other remote tools.
Some of the remote tools involve additional steps and requires other resources to function as intended, refer to the following URL for more detail information about these remote tools:
While the Target Control shell is not categorized as one of the remote tools, this is a very useful tool to help debug OS image running on a target device. Functioning like a remote command console, we perform debugging functions from the command prompt.
Using the KITL enabled OS image from the previous section (downloaded to the target device), work through the following Target Control exercise:
1. If still active, terminate the remote tools shell.
2. From the VS2008 menu, select TargetàTarget Control to bring up the Windows CE Command Prompt window (Target Control shell), as shown in Figure-6.
Figure - 6
3. From the Target Control shell, enter the following command:
Windows CE>gi proc
4. After pressing enter to execute the above command, the Target Control shell displays all of the processes currently running on the target device, as shown in Figure-7.
Figure - 7
5. From the Target Control shell, we can launch application on the target device remotely. From the Target Control shell, enter the following command to launch the control panel:
Windows CE>s control.exe
6. After pressing enter to execute the above command, the control panel will launch on the target device.
7. From the Target Control shell, enter the “gi proc” command to display all processes currently running on the target device, as shown in Figure-8.
Figure - 8
8. From the Target Control shell, the control panel application, control.exe, is shown as process 10, “P10: control.exe”.
9. From the Target Control shell, enter the following command to terminate the control panel application.
Windows CE>kp 10
10. After the pressing enter to execute the above command, the control panel terminates on the target device. The Target Control shell display a message to indicate the attempt to terminate the “P10: control.exe” process is succeed, as shown in Figure-9.
Figure - 9
The Target Control shell is a very useful tool, with many functions. Refer to the following URL for more information:
Efficient debugging tools can help streamline the process to identify software issues, help minimize development schedule, which directly contribute to cost saving for the overall project. In addition to the efficient coding environment to support managed and native code development, the Windows Embedded Compact debugging tools are valuable cost-saving resources for the development team.
Hi Samuel Please help me configure RDP in Win EC 7. Db
Hi Samuel, More details: When checking file properities the 5.01 CoreCon files say they are for the Platform Builder product while the 1.0 files say for VS2008. I am using one instance of VS2008 to run PlatformBuilder so I can download the O/S image and debug it or also debug my c++ sub Projects and the C++ debugging works. But to debug C# apps I use a 2nd instance of VS2008 via the (auto)Ether device to connect which it does. Then the PB output window shows CoreCon loading and runing and my app loading too. But debugging does not works on the VS2008 side. The app loads but does not start running. But I can run the deployed app via Remote Display.
Hi Samuel, I been struggling for several weeks w/ trying to debug C# code for a Compact 7 device but Breakpoints dont get hit after sucessfull connect and deployment of app. I think I may know the cause of my problem but dont know how to fix it. For some reason I have these two subdirectories: C:\Program Files (x86)\Common Files\microsoft shared\CoreCon\5.01\... and C:\Program Files (x86)\Common Files\microsoft shared\CoreCon\1.0\... If I rename the 1.0 dir then VS2008 will not care but if I rename the 5.01 dir then VS2008 will get a popup error (package 'vscoreconpkg package' has failed to load) So it seems that VS is using some files in 5.01. But when I look at the ConManClient2.exe used in the Compact7 image they come from the 1.0 dir. So I suspect there is a comflict of CoreCon versions between my device and VS. The thing is that I dont know how to get VS2008 to switch and use what ever files it needs from CoreCon 1.0. I also dont know where CoreCon 5.01 came from and what it is used for? (possibly something related to Windows Mobile?) I know my PC also has VS2010 installed and it may have come from there. Could this mix of version be the cause of my debugging problem? How do I finally fix this? Thanks for any advice/Jose
View this page in another language: