The simplest setup to do application debugging is to connect your host PC to the Toradex module target by both a USB cable (ActiveSync) and Ethernet. However, there are situations where the USB client port is not available and only Ethernet can be used for debugging - as for example with Windows Embedded Compact 2013
This article describes how to setup the host PC and the target device for this purpose.
Newer Toradex Windows CE images show have a built-in tool to prepare the system to accept a debugger connection. Our tool does the same steps as Microsoft describes, we just simplified the process. It can be launched under:
START → Programs → ColibriTools → Start Debugger Client
Once started, the debugger client shows the module's IP address in a message box when the debug client gets started. The message box can be deactivated by setting the following registry key:
[HKEY_LOCAL_MACHINE\SOFTWARE\Toradex\Debugger] "DisplayMode" = "dword:1" ;Default is 1. 1 = show message box, 0 = show IP on desktop.
The debugger client uses, by default, the Ethernet interfaces directly supported by the module. If you need to use a different interface for application debugging (ex: Wi-Fi or modem connection) you need to add an additional parameter to the registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Toradex\Debugger] "CheckAdapterName" = "dword:0" ;Default is 1. 1 = use only standard adapters, 0 = use any adapter that has a valid IP address
On the target device, either
In the default configuration, the target device is setup to get its IP address from a DHCP server. So the address can change after a reboot of the target.
If you want to automatically launch the debugger client on booting the device, you can add it to the init section in the registry like this:
[HKEY_LOCAL_MACHINE\init] "Launch98" = "VSDebugger.exe"
This registry entry is already there in newer images but it is disabled by a "_" prefix.
Note: Our most recent Windows Embedded Compact images (for Tegra, iMX6, iMX7 and Vybrid) have the debug tools already included, you find them under:
Start->Programs->Colibri Tools->Visual Studio Debugger If you can't find this entry or you are building your own image, you have to copy them manually.
C:\Program Files\Common Files\microsoft shared\CoreCon\1.0\Target\wce400\armv4i or C:\Program Files (x86)\Common Files\microsoft shared\CoreCon\1.0\Target\wce400\armv4i
%CommonProgramFiles(x86)%\Microsoft Shared\Embedded Tools\CoreCon\12.0\Target\wce800\armv7\ or %CommonProgramFiles(x86)%\Microsoft Shared\Embedded Tools\CoreCon\14.0\Target\wce800\armv7\
When more than one ethernet adapter is connected to the system, by default only the first (on-module) adapter is available as a debug interface.
The 2nd ethernet adapter can be enabled for debugging by adding a registry key.
The exact value of the multi-string ("AX88772B2","AX8877B1") depends on the module and ethernet adapters you use. The adapters are listed under [HKEY_LOCAL_MACHINE\Comm].
[HKEY_LOCAL_MACHINE\Comm\TCPIP\Linkage] "Bind"=multi_sz:"AX88772B2","AX8877B1" ; List all adapter instances
Just click on the following start menu item:
Start->Programs->Colibri Tools->Visual Studio Debugger->Start debugger client
If you don't find the Start debugger client on the target device you have to do this.
After you have started CMAccept, you have only 3 minutes to start the debug session on the Visual Studio side!
VS2008 will start to communicate with the target device. Another dialog should appear and announce a successful connection.
Debug session is started automatically when you choose to deploy or debug/run your application.
If you haven't set an IP for your target device, you'll have to insert it when prompted.
We discovered that inserting the IP on first execution/deployment often leads to a non-responsive Visual Studio 2013/2015 instance.
It's better to configure your device's IP in advance as described in the instructions above.