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


Comments (24)
  1. Anonymous says:

    Barry Bond has just posted instructions for getting the ARMV4I Emulator working from Windows CE 5.0 Platform…

  2. ronaldsloot says:

    I just tried it. I had to wait for about 2 minutes or so until it made it through booting the image. Then I heard a startup sound and saw that the display in the Device Emulator window is all screwed up. I see the image repeated about 6 times horizontally. Vertically it is not repated. When I press keys I hear audible feedback so I guess the emulation is still running. Does this ring a bell ? Is there a workaround for the scrambled display ? I tried 320x240x16 but the same thing happens basically.

    Ronald

  3. bzwaga says:

    I had the same problem with the "screwed up" display. Found that the BSPArgs struct was cleared in the bootloader.

    So in ebootmain.c remove at line 758  memset(pBSPArgs, 0, sizeof(BSP_ARGS))

    Bonne

  4. jothishankar says:

    Hi Barry,

    After i attach the device, i get the following error saying that it’s an invalid image.

    Sent BOOTME to 255.255.255.255

    Sent BOOTME to 255.255.255.255

    Locked Down Link 1

    Src IP 192.168.1.74 Port 0800   Dest IP 192.168.1.68 Port 0530

    EthDown::TFTPD_OPEN::boot.bin

    -EbootSendBootmeAndWaitForTftp

    Download file information:

    ——————————————————————————-

    [0]: Address=0x80001000  Length=0x2E99B50  Name=

    ****** OEMVerifyMemory Checking Range [ 0x80001000 ==> 0x82E9AB4F ]

    ****** OEMVerifyMemory FAILED – Invalid Memory Area ******

    !OEMVERIFYMEMORY: Invalid image

    I created a basic internet appliance based image using the MS DeviceEmulator BSP. The image was built without any errors. But when i tried to download it to the emulator, i get this error. Is there a problem with the size of the image that i’m trying to download? is there any restriction on the size of the image that we can download to this emulator?

    Thanks,

    Jothishankar

  5. zsun says:

    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.

  6. Barry Bond says:

    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.

  7. rlesavre says:

    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,

  8. Barry Bond says:

    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

  9. rlesavre says:

    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 ?’ )

  10. Jose says:

    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,

  11. hnakayam says:

    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,

  12. nihat says:

    Excellent article. Thanks a lot barry

  13. tea333 says:

    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

  14. tea333 says:

    I was able to obtain partial success with the above. I use the BSP with two different designs. In one case, I choose a design template in PB 5.0 of "Mobile Handheld" while in the other test case, I choose "Enterprise Web Pad" per the instructions in the RTF.

    The "Mobile Handheld" build is able to load fine when I run it manually from the command line, but the generated SDK does not show up in VS2005 as a target device choice. By contrast, the "Enterprise Web Pad" build does not load manually from the command line because the image is too large. I got the OEMVERIFYMEMORY error as someone else above did. But in this case, the SDK generated by PB 5.0 does show up as a target device in VS2005.

    My guess is the "Mobile Handheld" template is missing something such that VS2005 doesn’t consider it viable. Does anyone know the OS Design requirements, or any other PB 5.0 requirements, to have a target device of an SDK show up in VS2005 once the sdk itself is installed? My guess is the Web Pad has all it needs, but that’s not what I want anyway. I want something close to the Smartphone SDK but I want to keep the image size to somewhat of a minimum.

    Thanks in advance for any help.

    Regards,

    Tom

  15. tea333 says:

    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.

  16. Prabhu Kumar says:

    Thanks a lot barry! nice article to get you started with the real work.. 🙂

  17. Anonymous says:

    Guys

    I'm having problems installing DeviceEmulatorBSP.msi from the link http://www.microsoft.com/…/details.aspx

    When 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

  18. Anonymous says:

    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 "http://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

  19. Anonymous says:

    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.

  20. I'm having problem with memory when creating a windows ce 5 with ARM processor, the same problem this topic

    blogs.msdn.com/…/541634.aspx

    Michele Sun, Mar 5 2006 6:07 PM #

    Hi Mike!

    I am Attempting to work with this emulator on platform builder 5.0

    I 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?

Comments are closed.

Skip to main content