Introduction

This is a supplement to the Compact 7 getting started series, to provide additional information about Core Connectivity for Compact 7, showing the steps to establish Connectivity between the development PC and target device to support application development, using Core Connectivity (CoreCon).

Note:

The Compact 7 getting started series includes the following:

1.       Introduction.

2.       Development Environment & Tools.

3.       Develop a Compact 7 OS Design.

4.       Develop Managed Code Application for Compact 7.

5.       Develop Native Code Application for Compact 7.

6.       Develop SQL Compact Database Application for Compact 7.

7.       Develop Silverlight for Windows Embedded Application for Compact 7.

8.       Debug and Remote Tools.

9.       Deploy OS Runtime to Target Device for Distribution.

For more information about the Compact 7 getting started series, visit the following URL:

http://www.embedded101.com/Compact7/

 

CoreCon is a communication framework to support developers working with Platform Builder and Visual Studio development platforms.  For more information about CoreCon, visit the following URL:

http://msdn.microsoft.com/en-us/library/ee480472(v=winembedded.60)

This application note is created to provide information, showing how to use CoreCon to support Compact 7 application development from the Visual Studio 2008 (VS2008) integrated development environment (IDE).

Prerequisites:

  • Development PC with the following:

o   Visual Studio 2008 with SP1

o   Windows Embedded Compact 7

  • Created an OS design project for the target device.
  • Successfully generated a Compact 7 OS runtime image for the target device, with components to support managed code application development.
  • Successfully downloaded (deployed) the OS image to the target device.
  • Both the development PC and target device are attached to the same LAN with IP addresses assigned within the same subnet.

 Target Device:      eBox-3300MX

The content in this guide is created using an eBox-3300MX (eBox) as the target device, built with a 1.0 GHz Vortex86DX processor, 512 MB RAM, 10/100 Mbps Ethernet, USB, Audio, VGA & etc.

For more information about the eBox-3300MX target device, visit the following URL:

http://www.embeddedpc.net/eBox3300MX/  

Note:     You can use a different model of eBox, such as eBox-3300A, eBox-3310A, eBox-3310MX and eBox-3350MX, as the target device for the exercises in this series of Compact 7 getting started guide.

Alternative Target Device:  Virtual PC

It’s possible to work through the exercises in this series using a Virtual PC as the target device.  A board support package (BSP) for the Virtual PC is provided as part of the Compact 7 software.

The Virtual PC is based on the x86 processor architecture.  Other than the different BSP components which impacts some of the steps in the OS design exercise, you can work through all of the exercise in this series, with minimal variation.

For more information, refer to the following guide:

·         Windows Embedded Compact 7:  Using Virtual PC as Target Device

http://www.embedded101.com/Compact7/Using-Virtual-PC-As-Target-Device/

Alternative Target Device:  Other Hardware

It’s possible to work through the exercises in this series using a different hardware platform.

To use a different hardware platform as the target device, you need an appropriate Compact 7 BSP for the hardware platform.  If you need help, feel free to contact us at the following email alias:

·         wep@embedded101.com

 

Core Connectivity for Application Development

The required CoreCon files are installed to the development station as part of the VS2008 installation to the following folder on the development station:

·         32-bit development station

\Program Files\Common Files\Microsoft shared\CoreCon\1.0\Target\WCE400\<CPU>

·         64-bit development station

\Program Files (x86)\Common Files\Microsoft shared\CoreCon\1.0\Target\WCE400\<CPU>

There are multiple set of CoreCon files installed to sub-folders under the above directory, to support ARM, MIPS and x86 processors, with the processor family as the sub-folder name.  Each of these CoreCon files supports a designated processor family.

To establish connectivity between the Visual Studio IDE and Compact 7 target device, the appropriate CoreCon files need to be launched on the target device when Compact 7 starts.  In order to use these CoreCon files, they must be included to the Compact 7 OS runtime image, copied to the target device’s local storage or make available to the target device via Network share or external storage attached to the target device.

The eBox is engineered with an x86 processor.  The required CoreCon files to support eBox are in the following folder:

·         32-bit development station

\Program Files\Common Files\Microsoft shared\CoreCon\1.0\Target\WCE400\x86\

·         64-bit development station

\Program Files (x86)\Common Files\Microsoft shared\CoreCon\1.0\Target\WCE400\x86\

To establish CoreCon connectivity between an x86 Compact 7 target device and the development PC, the following CoreCon files need to be accessible by the Compact 7 OS running on the x86 target device:

·         Clientshutdown.exe

·         CMAccept.exe

·         ConmanClient2.exe

·         DeviceAgentTransport.dll

·         eDbgTL.dll

·         TcpConnectionA.dll

In addition to making the above files accessible by the Compact 7 OS, the following executable files need to be launched on the device to establish the connection to support application development from the VS2008 IDE:

·         ConmanClient2.exe

·         CMAccept.exe

The CMAccept.exe executable temporary disable system security to enable VS2008 IDE to establish connection with the target device.  After CMAccept.exe is launched, the VS2008 IDE has approximately 3 minutes to establish connection.  Otherwise, the CMAccept.exe executable needs to be launched again.

 

Adding CoreCon Files with AutoLaunch

The AutoLaunch_CoreCon, a sub-component to AutoLaunch_v300_Compact7, is created to help simplify the steps needed to include the required CoreCon files to an OS design.  The AutoLaunch_v300_Compact7 is a 3rd party component for Compact 7, released as an open-source project on Codeplex, available for download from the following URL:

·         http://autolaunch4ce.codeplex.com

The AutoLaunch_v300_Compact7 component is installed to the C:\WINCE700\3rdParty directory.  After installation, the AutoLaunch_v300_Compact7 component is available as part of the Compact 7 catalog component, in the \Third Party\Embedded101 folder.  The CoreCon component is a sub-component, included as part of the AutoLaunch_v300_Compact7 component, as follow:

·         AutoLaunch_v300_Compact7\Autolaunch CoreCon

AutoLaunch is a simple utility, which can be configured to launch one or more application, with configurable time delay, during startup.

The Autolauch CoreCon sub-component does not include the actual CoreCon files.  When included in an OS design, it references and adds the necessary build steps to copy the required CoreCon files to the build release directory and compile as part of the OS runtime image.

In addition to adding the necessary CoreCon files to the OS runtime image, in order for the Visual Studio IDE to establish connectivity to the target device, the following CoreCon executable must be launched from the target device, after the Compact 7 OS is started:

·         Conmanclient2.exe

·         CMaccept.exe

The AutoLaunch_v300_Compact7 component, along with the CoreCon sub-component, is designed to simplify the tasks needed to include CoreCon to the OS runtime image, and configure the OS runtime to launch CoreCon during startup.

When the AutoLaunch_v300_Compact7 and the AutoLaunch_v300_Compact7\Autolaunch CoreCon components are included in the OS design, the following registry entries are also added.

[HKEY_LOCAL_MACHINE\Init]

    "Depend99"=hex:14,00,1e,00,32,00

    "Launch99"="AutoLaunch.exe"

 

[HKEY_LOCAL_MACHINE\System]

    "CoreConOverrideSecurity"=dword:1

               

[HKEY_LOCAL_MACHINE\Startup]

    "Process0"="ConmanClient2.exe"

    "Process0Delay"=dword:00001388

The “CoreConOverrideSecurity” entry is added to disable security.  With this entry, the CMAccept.exe executable is not needed.

The registry entries under the HKLM\Init key configure the OS runtime image to launch the AutoLaunch.exe utility during startup.

As the AutoLaunch.exe utility launches, it scans the HKLM\Startup key to launch software components with proper entries.  The following HKLM\Startup entries configure the AutoLaunch utility to launch ConmanClient2.exe during startup, with 5 seconds delay (1388 in HEX is qual to 5000 in decimal which represent 5000 ms or 5 seconds).

[HKEY_LOCAL_MACHINE\Startup]

    "Process0"="ConmanClient2.exe"

    "Process0Delay"=dword:00001388

As part of the OS design exercise in Part-3 of the Compact 7 getting started series, the AutoLaunch component and the AutoLaunch-CoreCon sub-component are included as part of the MyCompact7 OS design project.  The OS runtime image generated from this OS design included the necessary CoreCon files and configured to launch the required binary during startup.

Core Connectivity from VS2008 to Target Device

A VS2008 application project is needed to shows the steps to establish Core Connectivity between the VS2008 IDE and the target device.

Work through the following steps to create a VS2008 application and establish Core Connectivity to the target device:

1.       Download/deploy Compact 7 OS runtime image on the target device.

2.       From the target device, with Compact 7 OS runtime launched, from the Windows task bar, double click on the network icon to bring up the network information screen to find the target device’s IP address (we will need this IP address in the later steps.

3.       On the development PC, from the VS2008 File menu, select New and click on Project to bring up the New Project wizard screen.

4.       From the Project types pane on left, expand the Other Languages\Visual C# node and select Smart Device.

5.       From the Templates pane on right, select Smart Device Project.

6.       Enter CoreCon as the name for the project and click OK to continue.

7.       From the Target platform selection, select Windows CE.

8.       From the Templates selection, select Device Application and click OK to continue.

At this point, a blank managed code application project is created.

Work through the following steps to configure the application project:

1.       From the Target Device selection on the VS2008 IDE, select the SDK for the target device, as shown in Figure 1 (The MyCompact7_SDK is created as part of the OS design exercise for the eBox).

Fig-1

Figure 1

2.       Click on the Device Options icon, as shown in Figure 2, to bring up the Options screen, as shown in Figure 3.

Fig-2

Figure 2

Fig-3

Figure 3

3.       From the Show devices for platform selection, select the SDK for the target device and click on Properties to bring up the Device Properties screen, as shown in Figure 4.

Fig-4

Figure 4

4.       Click on Configure to bring up the Configure TCP/IP Transport screen, as shown in Figure 5.

Fig-5

Figure 5

5.       Select the “Use specific IP address” option, enter the target device’s IP address and click OK to close the screen and continue.

6.       From the Device Properties screen, click OK to close the screen.

7.       From the Options screen, click OK to close the screen.

8.       From the VS2008 IDE, click on the Connect to Device icon, as shown in Figure 6, to connect to the target device.

Fig-6

Figure 6

9.       As the VS2008 IDE successfully connected to the target device, the Connection succeeded message is shown on the Connecting screen, as shown in Figure 7.

Fig-7

Figure 7

10.   Click Close to close the Connecting screen.

11.   With CoreCon connection established, from the VS2008 Debug menu, click on Start Debugging to bring up the Deploy CoreCon screen, as shown in Figure 8.

Fig-8

Figure 8

12.   Select the SDK for the target device and click Deploy.

13.   At this point, an error message is raised, “There were deployment errors, Continue?”, as shown in Figure 9.

Fig-9

Figure 9

14.   Click Yes to continue.  The application is now deployed to the target device.

About the Application Deployment Error

This error is caused by the VS2008 IDE attempting to deploy the latest version of Compact Framework to the target device.

Work through the following steps to remedy this error:

1.       From the VS2008 Debug menu, click on Stop Debugging to stop the application.

2.       From the VS2008 Project menu, click on CoreCon Properties to bring up the CoreCon properties page, as shown in Figure 10

Fig-10

Figure 10

3.       Click on the Devices tab and uncheck the “Deploy the latest version of .NET Compact Framework” option.

4.       Now, deploy the application again.  The error should go away.