Adama0

Hi all,

I've been trying to debug a Windows CE 5.0 based device with VS 2005. Since this device doesn't have a full serial port or USB client port available, I've turned to debugging without ActiveSync (I did try merging in some AS partnership information from another device into the registry, but haven't quite gotten AS to connect.)

I've used the instructions pointed to elsewhere, e.g.

http://blogs.msdn.com/vsdteam/archive/2005/04/28/413304.aspx

http://msdn2.microsoft.com/en-us/library/ms228708.aspx

However, there appears to be no manual startup server option -- VS 2005 seems to insist that ActiveSync be used as the Startup Server/Bootstrapper. When I try to connect after following the above instructions, it always tells me "ActiveSync is not installed" (or something like "could not connect with ActiveSync" when I do have AS installed). It appears that this bootstrap info is configured in some XSL files for CoreCon 1.0 (I tried manually manipulating the bootstrap settings in the files, to no avail).

I did verify that it works fine with VS 2003 using the Smart Device Authentication Utility. I'm suspecting that it would work fine with VS 2005 as well if it would get past trying to use ActiveSync as the startup server.

Has anyone else encountered this problem I've found only one other mention of it, with no resolution.

Thanks,

Adam



Re: Smart Devices General Debugging without ActiveSync -unable to get Visual Studio 2005 to cooperate

Anr

You dont require ActiveSync to debug a WinCE 5.0 device. This error appears when the connection could not be made with current settings.

In Tools --> Options , Select Win CE 5.0 and click the properties. Click the configure button.

Verify the following

  • Use specific Ip address option is selected and the IP address is same as that of IPaddress of the device
  • Use fixed port number is uncheked

(extract from http://msdn2.microsoft.com/en-us/library/ms228708.aspx)

copy the following files to the \Windows\ folder on the device. These files are located on the development computer by default at \Program Files\Common Files\Microsoft Shared\CoreCon\1.0\Target\wce400\<CPU>.

  • Clientshutdown.exe
  • ConmanClient2.exe
  • CMaccept.exe
  • eDbgTL.dll
  • TcpConnectionA.dll

  1. From the command prompt on the device, run conmanclient2.exe.

  2. Run CMaccept.exe

In Visual Studio, do 'Connect to device' from tools menu.

Select WinCE 5.0 device. Now connection should succeed.






Re: Smart Devices General Debugging without ActiveSync -unable to get Visual Studio 2005 to cooperate

Adama0

Thanks for the response. As I wrote in my original post, though, after following those instructions (the "standard" instructions for debugging without ActiveSync), connecting to the device always fails, with a message complaining that "ActiveSync is not installed" (or when I do have it installed, that it is not able to connect via ActiveSync).

So even though you are *supposed* to be able to debug without ActiveSync, my VS 2005 installation does not seem to know this. I can't figure out how to convince it not to try to use ActiveSync as the Startup server. I've tried this on a couple different machines, one that didn't have Platform Builder 5.0 or VS 2003 on it, just in case there was any conflict, but always the same result.

Has anyone seen this I'm assuming there must be some issue with my CE image -- It happens so readily, I just can't see how it wouldn't happen to many people unless it is something specific to my CE OS configuration. But if so, I simply don't know what component or setting my image might be missing.

--Adam





Re: Smart Devices General Debugging without ActiveSync -unable to get Visual Studio 2005 to cooperate

Anr

Few more things to verify

When you run the conmanclient2.exe in device, is it exiting immediately or is it running (if it is running, you wont get the prompt in cmd window). It should not exit immediately.

Before debugging can you just try connecting to the Win CE 5.0 device (tools -> Connect to device -> WinCE5.0 device).

If connection fails then can you try the following,

Close all visusl studio instances, emulator and device emulator manager running (if any). Go to <SystemDrive>\program files\common files\microsoft shared\corecon directory. Delete the 1.0 directory present there.

Now try the steps i have mentioned in the thread earlier.






Re: Smart Devices General Debugging without ActiveSync -unable to get Visual Studio 2005 to cooperate

Sivarv

Hi,

I would suggest trying manual bootstrap steps on a clean WinCE5.0 device by soft/hard resetting it. If it still didn't work, answers to the following questions will help in trouble shooting the problem:

1. When you run conmanclient2.exe, is it exiting immediately or keeps running

2. When you run cmaccept.exe, is it exiting immediately or after few minutes (around 3min)

If the answer to either of the above questions is "Yes", you haven't copied cpu matching binaries to your device.

Another thing you might want to check is whether you can ping your WinCE5.0 IP address from your VS05 desktop machine.

Device binaries copied to WinCE5.0 must from the same VS version using which a connection attempt is made. For example, copying VS05 beta binaries and later trying to connect from VS05 RTM (build 50727.42) will fail.

Thanks

Siva





Re: Smart Devices General Debugging without ActiveSync -unable to get Visual Studio 2005 to cooperate

Adama0

Thank you Siva and Anand.

I am able to ping the device, telnet to it, etc. But, as you both describe

1) conmanclient2.exe and cmaccept.exe exit immediately -- they do not remain running. I'd not recognized this problem earlier.

2) Running a packet sniffer on the desktop, I can see that the packets being sent from the desktop to port 5655 are not being accepted. (This seems consistent with the above -- I suppose that conmanclient2 is supposed to listen on that port, but is not running.)

The question becomes, then, why are they not running The versions of the binaries do *seem* to be correct, as far as I can tell. I took them from the CoreCon path specified in the instructions linked to above -- they are dated 9/23/2005, which matches the dates of my other VS 2005 install files (I've never had a VS 2005 beta on this machine). The only other conmanclient2.exe's on my machine are elsewhere in my Wince500, and are dated much earlier (from 2004). And I took them from the ArmV4i target directory, which matches my target device. (I also generally see an CE error message if I run a binary which is not built for the correct processor.)

My conclusion, then, is that there is some component or setting they require that is not present in my OS image. I encountered a post or two regarding dependencies for TCP/IP debugging, and had included everything they listed (I'll look them up again to double check). Does anyone know what component(s) I might be missing (Note that I have been able to connect with VS 2003, so it seems like it would have to be some new requirement for the VS 2005 conmanclient2 and cmaccept.)

Thanks,

Adam

Another note: I have the bootstrap files built directly into the OS image. I don't expect this is a problem, but I have also tested it by copying them over cesh with a kitl based image, and it made no apparent difference.





Re: Smart Devices General Debugging without ActiveSync -unable to get Visual Studio 2005 to cooperate

T_

We're still having this issue. We haven't made any progress in figuring out why the conmanclient2.exe and cmaccept.exe do not stay running when launched on our platform. We have examined the binary versions -- they are definitely correct for our platform CPU type.

Everything else seems to be in order, so we're at a standstill on this point.

Anyone have other suggestions






Re: Smart Devices General Debugging without ActiveSync -unable to get Visual Studio 2005 to cooperate

Alex Feinman

I've tried to read the thread very carefully, but nowhere I could see the exact platform-specific directory from which you get the target corecon binaries.

For the bulk of CE5 devices it'll be

C:\Program Files\Common Files\Microsoft Shared\CoreCon\1.0\Target\wce400\armv4i

However if your device is not typical, it'll be a different directory. What are your device and your CPU

Another pointer - when you run CMShutdown, it is supposed to create a guid-named directory, which means it worked






Re: Smart Devices General Debugging without ActiveSync -unable to get Visual Studio 2005 to cooperate

Alex Feinman

One more thing - TCP corecon transport expects to find iphlpapi.dll. Make sure the image has it




Re: Smart Devices General Debugging without ActiveSync -unable to get Visual Studio 2005 to cooperate

_Tim

Alex,

Thanks for the response.

Our platform is Xscale-based. The binaries are sourced from the \program files\common\microsoft shared\corecon\1.0\target\wince400\armv4i. The iphlpapi.dll is built and present in the system image.

The behavior is consistent. When we launch conmanclient2.exe or cmaccept.exe from a command prompt, nothing happens; no error message, but the apps do not continue to run.

However, when we launch the clientshutdown.exe, a new directory with a GUID name is created, with a 0-length file created called CLIENT_NOT_RUNNING. So perhaps this is good, at least this applications is launching and executing code without error.

Any other ways I can see what might be failing when the applications start






Re: Smart Devices General Debugging without ActiveSync -unable to get Visual Studio 2005 to cooperate

Alex Feinman

What if anything is in the registry under HKEY_CURRENT_USER\Software\Microsoft\CoreCon

This is after you attempt to run conmanclient2.

To enable Corecon debug logging you can set the following under HKLM\Software\Microsoft\VSD\Logging

VSD_LogEnabled: DWORD:1,0

VSD_LogToDebugger: DWORD:1,0

VSD_LogToConsole: DWORD: 1,0

VSD_LogToFile: DWORD:1,0

VSD_LogLevel: DWORD - set to at least 4, up to 9

VSD_LogFile: REG_SZ (default VSDLogFile.txt)






Re: Smart Devices General Debugging without ActiveSync -unable to get Visual Studio 2005 to cooperate

_Tim

After running conmanclieht2.exe, there isn't anything populated under "HKEY_CURRENT_USER\Software\Microsoft\CoreCon."

I added the debug keys to the registry, however, and now I see a lot more information. That was helpful! Here is the command line output.

\Windows> conmanclient2.exe
47ea37e6:47c25066: Time: 8:02:41 PM: Enter: WinMain Command Line

47ea37e6:47c25066: Time: 8:02:41 PM: PrimaryInstance Specifies Transport

47ea37e6:47c25066: Time: 8:02:41 PM: startListening transport tcpconnectiona.dll

47ea37e6:47c25066: Time: 8:02:41 PM: startListening hPower = NULL

47ea37e6:47c25066: Time: 8:02:41 PM: DisconnectAllConnections

47ea37e6:47c25066: Time: 8:02:41 PM: Exit DisconnectAllConnections

47ea37e6:47c25066: Time: 8:02:41 PM: startListening CloseMsgQueue

47ea37e6:47c25066: Time: 8:02:41 PM: startListening Deleting critical sections

47ea37e6:47c25066: Time: 8:02:41 PM: unloadTransportLoader

47ea37e6:47c25066: Time: 8:02:42 PM: unloadTransportLoader result

47ea37e6:47c25066: Time: 8:02:42 PM: startListening HR=80004005

47ea37e6:47c25066: Time: 8:02:42 PM: Exit: WinMain HR=80004005






Re: Smart Devices General Debugging without ActiveSync -unable to get Visual Studio 2005 to cooperate

Alex Feinman

Odd, from what I can see this can only ( ) happen if your platform does not support power management - i.e. if RequestPowerNotifications returns NULL. Is there any way you could check that




Re: Smart Devices General Debugging without ActiveSync -unable to get Visual Studio 2005 to cooperate

_Tim

Alex,

You were exactly correct, there was a problem in the PM system for our platform. The fix was a trivial change to a registry value for an activity timer, and the conmanclient2.exe and cmaccept.exe tools are working well now.

Thanks for your assistance.






Re: Smart Devices General Debugging without ActiveSync -unable to get Visual Studio 2005 to cooperate

Sivarv

Hi,

Conmanclient uses Power notifications so that it can shutdown when battery is low. Currently, conmanclient2 will fail to run if the OS doesn't support power management.

Thanks

Siva