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

If you have downloaded the BSP from https://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

https://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

Comments

  • Anonymous
    March 15, 2006
    Barry Bond has just posted instructions for getting the ARMV4I Emulator working from Windows CE 5.0 Platform...
  • Anonymous
    April 04, 2006
    The comment has been removed
  • Anonymous
    April 06, 2006
    The comment has been removed
  • Anonymous
    April 13, 2006
    The comment has been removed
  • Anonymous
    April 13, 2006
    It seems there is problem about the step #4:

    ================================
    4) In that command window, do the following:

    cd /d "%programfiles%microsoft device emulator1.0

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

    I can build-up the image successfully, but there is problem to connect through ethernet.
  • Anonymous
    April 17, 2006
    jothishankar:  the image size,  0x2E99B50 bytes, is too large to fit in the emulator.  The CE 5.0 BSP supports images only up to 32mb in size.  You may need to switch to a retail image, rather than debug.
  • Anonymous
    April 19, 2006
    Hi Barry,

    First of all, I will say that after installing the Deviceemulator, everyone should read the file:
    :WINCE500PLATFORMDeviceemulatorUsing the CE DeviceEmulator.rtf
    It helps a lot to use the builded SDK in VS2005.

    I would like to know what should i do to enable Network communications inside the Emulator. My image boots fine into the emulator, from Visual 2005, but I can't see any network card inside the CE os.

    I've tried to check the two checkbox Enable network card in the emulator properties -> tab network. I've also tried to add the support for the NE2000 pcmcia network card in Platform Builder, nothing worked.

    If i check the Enable CS8900 network card, it won't boot. I assume that i have to pass the parameter /n as asked in the step 9, but i do not know where can i do such a thing in Visual 2005.

    Thanks,



  • Anonymous
    April 21, 2006
    rlesavre:  The DeviceEmulator defaults to having no network connectivity.  If you need it, this blog explains how to use ActiveSync:  http://blogs.msdn.com/akhune/archive/2005/11/16/493329.aspx.  For full network connectivity, download the Virtual Machine Network Driver from http://www.microsoft.com/downloads/details.aspx?FamilyID=dc8332d6-565f-4a57-be8c-1d4718d3af65&displaylang=en, then enable the NE2000 checkbox.  You must also follow the instructions in the .rtf file to include the NE2000 PCMCIA driver and wired network code.

    The CS8900 netcard does not have a "product" ethernet driver in Windows CE, so it cannot be used for general-purpose networking.  Its only purpose is to support Platform Builder's KITL-over-ethernet.

    Barry
  • Anonymous
    April 23, 2006
    Thanks, barry,

    I've used this solution and it works, I think that the URL of this blog entry should be past at:

    http://blogs.msdn.com/mikehall/archive/2005/12/20/505891.aspx (titled 'VS 2005 and Windows CE 5.0 - Where's my emulator ?' )
  • Anonymous
    May 13, 2006
    HI,
    Thanks a lot for the emulator.
    I am having a problem when executing the emulator, at the end of the session if I try to save the state it shows "Saving state..." and never ends...
    Any idea why this is happening?
    thanks in advance,
  • Anonymous
    May 16, 2006
    Barry,

    Thanks a lot for this detailed guidance.

    By using your guide, I successfully made Device Emulator image for my preference. But making (east asian) localized image made so BIG, often failed in loader OEMVerifyMemory.

    In the boot loader code, the supported emulator RAM size for RAMIMAGE seems limited to 32MB, and often the first 4KB is reserved, results 32MB - 4KB is the largest RAMIMAGE image size loaded. When I reduced the image size fit in this size ... it works!

    I also checked the existing WM5.0 Device Emulator Images, including the Japanese ones. All the images are all fit in this 32MB limit so ... is there any way to expand this RAMIMAGE size limit?

    Thanks,

  • Anonymous
    July 06, 2006
    Excellent article. Thanks a lot barry
  • Anonymous
    August 08, 2007
    Hi Barry,Great article. Thanks for taking the time to make the emulator available. It's key to testing ARM related code without a device with PB 5.0.Regards,Tom
  • Anonymous
    August 08, 2007
    The comment has been removed
  • Anonymous
    September 26, 2007
    The memory issue was resolved by making the image smaller.As with Jose, I am unable to save state when closing down the emulator. Since I can use the dev em v2 with other images to save state, I'm guessing something about the image is incorrect. Whether that relates to the ARMV4I BSP or not, I don't know.
  • Anonymous
    September 11, 2008
    Thanks a lot barry! nice article to get you started with the real work.. :)
  • Anonymous
    October 16, 2008
    PingBack from http://wetlog.pts.nl/index.php/2008/10/17/building-images-for-arm-emulator-in-ce5/
  • Anonymous
    January 21, 2009
    PingBack from http://www.keyongtech.com/3116686-poor-performance-of-arm-deviceemulator
  • Anonymous
    May 29, 2009
    PingBack from http://paidsurveyshub.info/story.php?title=barrybo-using-the-deviceemulator-armv4i-bsp-for-windows-ce-5-0-from
  • Anonymous
    June 15, 2009
    PingBack from http://workfromhomecareer.info/story.php?id=14705
  • Anonymous
    July 25, 2010
    GuysI'm having problems installing DeviceEmulatorBSP.msi from the link www.microsoft.com/.../details.aspxWhen i try to install i get the error "The Microsoft Installer is attempting to run on a development workstation that does not have a valid platform builder installation, or is configured for tools only version of platform builder. To use this file, be sure platform builder is installed and has a valid %_WINCEROOT%"I have PB installed and its NOT configured for tools only version. But still i cannot install this ? Any thing I'm missing ? Pls help-Kris
  • Anonymous
    December 15, 2010
    Hi,Is it mandatory to install "Virtual Switch driver on the Windows machine"? Actully for me (when i click on point No-2 URL)this is redirecting to another webpage "www.microsoft.com/.../details.aspx (this is for Virtual PC 2007).So, here my question is should i install Virtual PC2007 on my Windows XP machine?Here i would like to mention that i'm able to make the run time image (nk.bin) (The run time image has been made by changing the #if 1 to #if 0 in main.c, as mentioned in point no-1)but when i am attaching it to the device emulator its giving the error as following:The specified CE boot image could not be loaded.The virtual machine may not have enough RAM allocated.Try increasing RAM allocation(if you are using platform builder open the configure remote service dialog,....).I do not have idea from where should i open "configure remote service dialog"??Pls help.Regards,JR
  • Anonymous
    December 19, 2010
    Now i'm able to run the emulator...Great .. :)But the problem is i'm not able to load my UI.exe into the emulator.Its saying "the program memory is low".I incerased the program memory from the control panel.But still the problem is there...Pls suggest..Any link??Thanks.
  • Anonymous
    July 17, 2012
    I'm having problem with memory when creating a windows ce 5 with ARM processor, the same problem this topicblogs.msdn.com/.../541634.aspxMichele Sun, Mar 5 2006 6:07 PM #Hi Mike!I am Attempting to work with this emulator on platform builder 5.0I Followed the procedure describded in your tutorial where you use x86 emulator. But when i attach device, the error windows says "Your virtual machine may not have enough RAM allocated." But in the "target device connectivity options" I am using max memory (256 MB)!What do you think about?is there any solution?