As part of any sizable software development project, the need to perform repetitive testing and debugging tasks is a common routine.  As part of a project to develop custom OS runtime image for a target device, deploying OS runtime image onto the target device for testing and debugging is one of the repetitive tasks.  Without the tool to download the OS runtime image to the target device, it’s tedious and time consuming to have to manually transfer the image onto the device for each test and debug session.

Compact 2013 provides an efficient development environment that enables you to download OS runtime image, generated from the OS design project, directly from the Visual Studio IDE to the target device for testing and debugging.  In addition, the Compact 2013 development environment also provide a suite of tools to remotely debug the OS runtime image as the image execute on the device.

In part-3 of this Compact 2013 getting started series, we will work through the steps to establish connectivity to download OS runtime image to the target device, using an 86Duino EduCake as target device and remotely debug OS image.

Bootable Storage

A target device has to be configured with a mechanism or bootloader to launch OS runtime image from its local storage. 

To establish connectivity between the Visual Studio 2013 (VS2013) IDE and EduCake to Download OS runtime image, the EduCake needs to be configured with BIOSLoader (Bootloader) to launch Eboot (Ethernet bootloader).

BIOSLoader

BIOSLoader is a bootloader for device built with processor based on the x86 architecture, such as Intel, AMD and Vortex86EX.  The 86Duino EduCake is built with Vortex86EX, a low-power System-on-Chip based on x86 architecture.

BIOSLoader can be used to:

  • Launch Compact 2013 OS runtime image from a target device’s local storage.

  • Launch Eboot, an Ethernet bootloader, from a target device’s local storage.

Eboot

Eboot is an Ethernet bootloader.  When launched by BIOSLoader, Eboot establishes connectivity with Visual Studio IDE and initiate the process to download OS runtime image from an active OS design project onto the target device.  Eboot can be configured to work with a static IP address or acquires IP address dynamically from an DHCP server.


Target Device (EduCake) Preparation using DiskPrep

The EduCake can be configured to boot from USB and SD flash storage.  Both USB and SD flash storage can be format and configured with BIOSLoader and Eboot.bin, using Diskprep.

For the exercises in this getting started series, we will use an SD flash storage card.

Here are the steps to format and configure an SD flash storage (These same steps apply to USB flash storage):

  • Insert the SD flash storage to the SD slot on the PC or use an SD-to-USB adapter.

  • After the PC detected the SD flash storage, launch DiskPrep with elevated privilege.

  • From DiskPrep program screen, select SD flash from Disk Selection, as shown in Fig-01.

Fig-01:  Diskprep

  • Select file system. 

  • Click on Browse, next to the “Load specific image file copied from” option, and navigate to locate and select Eboot.bin.

(Eboot.bin is included in the 86Duino_80B BSP, in the \Misc folder)

  • Click on OK to format and configure the SD flash storage.


Target Device for Compact 2013

To establish connectivity and download OS runtime image from VS2013 IDE to the target device, both the development PC and target device must be attached to the same Local Area Network, with IP addresses on the same subnet.

For the example here, the EduCake and development PC are both attached to the same Local Area Network with DHCP service to provide IP address dynamically, as shown in Fig-02.

 

Fig-02:  Development PC and EduCake attached to the same LAN

As part of the development process, we need to establish connectivity and download OS runtime image to the target device repeatedly for debugging and testing.

While we can select TARGET | Attach Device option from the VS2013 IDE to download OS image to the target device, without preconfigured device profile, this process goes through the steps to detect, identify and associate the device with the project for every download.  By creating a target device profile, we can avoid the steps to detect and identify the device when downloading OS runtime image to the device.

Let’s go through the following steps, using MyOSDesign project from part-2 of this series, to create a target device profile for the EduCake:

  • With MyOSDesign project open, from the VS2013 IDE, select TARGET | Connectivity Options to bring up the Target Device Connectivity Options screen, as shown in Fig-03.

Fig-03:  Target Device Connectivity

  • Click on Add Device

  • Enter EduCake as the name for the device and click Add.

  • On the Target Device Connectivity Options screen, click on the top most Settings button, for Kernel Download, to bring up the Ethernet Download Settings screen, as shown in Fig-04.

Fig-04:  Ethernet Download Settings

  • With the Ethernet Download Settings screen waiting for BOOTME messages from the target device, power on the EduCake.

  • As BIOSLoader launches Eboot.bin on EduCake, it broadcasts a series of BOOTME messages, via UDP over the attached LAN.

  • As the Ethernet Download Settings screen deteced the BOOTME message from EduCake, it display device ID from the EduCake, as shown in Fig-05.

Fig-05:  Target device detected

  • From the Ethernet Download Settings screen, click on the device ID in the Active target device window to select the device and click Apply.

  • From the Target Device Connectivity Options screen, click Close.

  • From the VS2013 IDE, click on Device selection list box and select EduCake as the target device, as shown in Fig-06.

 

Fig-06:  Select EduCake as target device.



Download OS Runtime Image to EduCake

With the EduCake and development machine both attached to the same LAN with DHCP service to provide IP address dynamically, insert the SD flash storage configured with BIOSLoader and Eboot.bin into EduCake, and go through the following steps to download OS runtime image generated from MyOSDesign project to EduCake:

  • From VS2013 IDE, select TARGET | Attach Device to start the download process and bring up the Device Status screen, as shown in Fig-07.

Fig-07:  Target device status

  • Power on the EduCake.

  • As Eboot.bin is launched by BIOSLoader on the EduCake, it broadcasts a series of BOOTME messages.

  • As BOOTME message is detected the download process starts and download activity is shown on the Device Status screen, as shown in Fig-08.

Fig-08:  Target device status – Downloading OS runtime image


Kernel Independent Transport Layer (KITL)

The OS runtime image from MyOSDesign project is generated with KITL enabled.  KITL is needed to establish connectivity and remotely debug the OS image running on the target device.  Remote tools provided as part of the Compact 2013 Platform Builder also require KITL to function.  With KITL enabled, as the OS runtime image launches on the EduCake, the Output window on the VS2013 IDE display activities from EduCake, as shown in Fig-09.

Fig-09:  Target device startup activities.


Debug with Target Control

For headless device, without display or user interface, Compact 2013 provides the following useful debugging tools to simplify the tasks needed to debug OS runtime image on the target device remotely:

  • Target Control

  • Remote Tools

In this section, let’s use Target Control to debug OS image on the EduCake.  With MyOSDesign project open and OS runtime image downloaded to EduCake, go through the following steps to launch Target Control and debug OS image running on EduCake:

  • From VS2013 IDE, select TARGET | Target Control to launch the Windows CE Command Prompt, as shown in Fig-10.

Fig-10:  Windows CE Command Prompt

Think of the Windows CE Command Prompt (Target Control) window as the remote command prompt for the connected target device, where you can launch command to interrogate the device and application included as part of the OS runtime image.

Let’s go through the following steps to run different Target Control command:

  • From the Windows CE Command Prompt window, enter the following command to retrieve the target device’s IP address:

    s ipconfig /d 

In the above command, the “/d” parameter redirect the output to the VS2013 IDE’s Output tab, as shown in Fig-11:

Fig-10:  Target control – Retrieve IP address from target device

  • Next, enter the following command to display active processes on the target device:

    gi proc

As the above command execute, it lists the processes that are running on the target device, as shown in Fig-11.

Fig-11:  Target Control – List of running processes from target device

For more information about target control, visit the following URL:

    https://msdn.microsoft.com/en-us/library/ee479807.aspx

Summary

As you can see from the exercises above, Compact 2013 provides an efficient development environment that greatly simplify the tasks to establish connectivity and download OS runtime image to a real target device for testing and debugging.  After the initial setup, all subsequence repetitive to download the OS runtime image to the target device is just a click away.

In part-4 of this getting started series, we will work through the steps to develop application for Compact 2013 device and deploy the application onto the device for testing and debug.