Using the DeviceEmulator ARMV4I BSP for Windows CE 5.0 from Platform Builder

If you have downloaded the BSP from http://www.microsoft.com/downloads/details.aspx?FamilyID=474b03a6-e87d-455d-bc16-b8cf18ef39b4&displaylang=en and want to use it from Platform Builder, read on...

1) Make one small bug fix, to platform\deviceemulator\src\bootloader\eboot\main.c - open the file, and replace the "#if 1" with "#if 0". The code under "#if 1" is a hack for getting the following steps to work if you're on a LAN that does not have a DHCP server... I forgot to disable the hack before releasing the soures. :-(

2) Install the Virtual Switch driver on the Windows machine. The download point is

http://www.microsoft.com/downloads/details.aspx?FamilyID=dc8332d6-565f-4a57-be8c-1d4718d3af65&displaylang=en since it does not ship with VS. Note that this adds one more piece of unsupported software to the mix.

3) Use PB's "Build OS" menu and pick "Open Release Directory" to open a command window

4) In that command window, do the following:

cd /d "%programfiles%\microsoft device emulator\1.0

DeviceEmulator.exe %_FLATRELEASEDIR%\eboot.nb0 /n /c /video 640x480x16

5) Switch back to the PB window. Pick "CE Device" as the deployment target (from the dropdown combobox in the middle of the PB window)

6) Use PB's "Target" menu and pick "Connectivity Options". Wait for the "Target Device Connectivity Options" dialog to appear. Note that it may come up but not get input focus... look for it in the system tray.

7) In that dialog, pick:

Target Device - CE Device

Download - Ethernet

Transport - Ethernet

Debugger - KdStub

8) Now, click the "Settings" button beside either of the "Ethernet" entries (they bring you to the same dialog). You should see a name like "DEVICEEM11471" appear in the "Active Devices:" list. Pick it, and "OK" your way out of the whole "Connectivity Options" dialog.

9) Use PB's "Target" menu and pick "Attach to Device". PB should begin downloading nk.bin into the emulator over ethernet. You have full KITL-over-ethernet, just like you would have to an ethernet-based hardware device.

After you have done this once, the "DEVICEEM11471" name should stay the same from run to run. So on subsequent runs, you should only need to follow steps 3, 4, and 9. The emulator name is generated by the CE bootloader and is based on the IP address it aquires, so it remains stable over time.

That's it! The emulator command line you pass can be anything you want, as long as it includes "/n" to enable the CS8900 network emulation code, which is what KITL-over-ethernet will use.

Behind the scenes, eboot.nb0 is the name of the CE bootloader for the Samsung SMDK2410 board. Normally, you burn eboot.nb0 into flash on the board. Then whenever you power on the board, it broadcasts "BOOTME" packets on the network until a PB discovers it and downloads the .bin file and launches it.

In the DeviceEmulator case, we "burn" eboot.nb0 onto the emulated board by just passing it as the ROM image filename.

Barry