ARMV4I Emulator – Working with CE 5.0 Platform Builder.


Barry Bond has just posted instructions for getting the ARMV4I Emulator working from Windows CE 5.0 Platform Builder – it’s not as straight forward as using the existing x86 Emulator, but this works pretty well if you want to use the ARM emulator.


BTW – I’m interested to know why you would want to use the ARM emulator from PB instead of the existing x86 based emulator – what are you going to do that you can’t do with the x86 emulator, or are you just wanting to use an ARM instruction set device ?


– Mike


 

Comments (12)

  1. Matt says:

    Good to hear about this.

    If you have a bug in your code where you access an unaligned pointer it will be hidden for X86, but crash on your actual device. In this case an ARM emulator will help you to detect these kind of bugs earlier on.

    You get a more unified build environment, only have to care about ARM compiler/linker settings and build setup.

  2. Matt says:

    This seems to work great.

    One problem I saw though was to have nk.bin larger than 32MB. I doubled RAMIMAGE in "config.bib" to 3C00000. In "loader.h" I changed OS_RAM_IMAGE_SIZE to 0x03C00000. Makeimg runs without errors (nk.bin ROM size became approx 42 MB with my configuration).

    But downloading the file fails stops with checksum error very close to 32 MB:

     ERROR: Checksum failure (expected=0x6E1BF4E  computed=0x6614E78)

     ****** Checksum failure on record 128, ABORT!!! ******

    Did I miss some step to get nk.bin larger than 32MB?

    Btw, is there a reason you would prefer the X86 emulator over the ARM emulator? Performance reasons for instance? Any other reazons why the X86 emulator would be a better choice?

  3. barrybo says:

    Sorry, but growing the nk.bin to larger than 32mb is pretty hard – the board has 64mb of contiguous physical memory, but config.bib and oemaddrtab_cfg.inc spit it into two discontiguous 32mb chunks.

    I won’t be able to support you if you want to keep working at a bigger nk.bin, beyond this hint… in oemaddrtab_cfg.inc, swap the virtual addresses for physical 0x32000000 and 0x30000000 so you get one 64mb contiguous block of virtual address space.  From there, you’ll likely need to patch config.bib to relocate RAM and the common RAM areas a little.

    Barry

  4. barrybo says:

    Why would you prefer the x86 emulator over the ARM emulator?

    It’s all about having an emulation environment as close to your target hardware as possible.  the x86 emulator is a good fit for many Windows CE developers, who target x86 boards.  But for Windows Mobile, developing and testing on an x86 emulator makes little sense when the target hardware is exclusively ARM.  The DeviceEmulator’s goal is to provide high fidelity emulation of a PocketPC or Smartphone, beyond just CPU emulation.  It has a high-res touchscreen, NAND and NOR flash emulation, etc.  Future releases will include emulation of hardware like speakerphone, notification LED, and battery.  These could all be added to an x86 emulator too – it is just less relevant for x86-based CE devices.

    Even writing application code in .NETCF doesn’t completely isolate you from the underlying hardware.  I have seen a problem where the .NETCF app ran fine on x86 but failed on ARM, because of a capacity limitation in the .NETCF JIT compiler that maxxed out sooner with the bigger ARM instructions.

    Makes sense?

    Barry

  5. David Vescovi says:

    Great! works like a charm. Have you tried running the CETK against any of the virtual device drivers?

  6. DMITRY says:

    Cool!

    Does this too supersede the "Microsoft Device Emulator V1.0" which was available for download a year ago?

    Why i do not like the x86 emulator? Besides of data abort with unaligned data on real device speed/performance issues and the lack of GAPI,  I still do remember the time when the x86-emulator was an awkward app in the left corner of the screen with funny windows classes within (e.g "CE_Button" "fake_xxx").

    BTW: Do you know when the ARM inline assembly language support expected to be enabled in embedded VC?

  7. mikehall says:

    Hi Dmitry,

    Don’t expect to see any updates to eMbedded Visual C++ 4.0. You now have two options for developing code on Windows CE based devices, eMbedded Visual C++ 4.0 SP4 or Visual Studio 2005. VS 2005 provides the ability to target devices using either native (Win32,C/C++, MFC, ATL, WTL, STL) or Managed (C#/VB) code.

    – Mike

  8. barrybo says:

    Did we run CETK?  Yes, but there are quite a few known failures – most are due to limitations of the DeviceEmulator, like our lack of emulation of a PCMCIA multifunction card.

    Barry

  9. barrybo says:

    Does this supercede the "Device Emulator 1.0" community tech preview?  No.  It is complimentary.

    This download includes BSP sources that allow Windows CE 5.0 to build and run inside that 1.0 DeviceEmulator.

    I don’t believe there are plans to add inline assembly support for non-x86.

    Barry

  10. barrybo says:

    Does this supercede the "Device Emulator 1.0" community tech preview?  No.  It is complimentary.

    This download includes BSP sources that allow Windows CE 5.0 to build and run inside that 1.0 DeviceEmulator.

    I don’t believe there are plans to add inline assembly support for non-x86.

    Barry

  11. Nicklas says:

    Hi!

    With the Windows CE .NET Emulators it is possible to write desktop and emulator code that communicates using the emulators DMA interface, is this possible when running Windows CE 5.0 inside the 1.0 DeviceEmulator and where do I find the interfaces for that?

    Nicklas

  12. JohnBaik says:

    I downloaded Device Emulator for ARMV4I from http://www.microsoft.com/downloads/details.aspx?FamilyID=474b03a6-e87d-455d-bc16-b8cf18ef39b4&displaylang=en. It has instruction for build image and export SDK.

    I was able to create Image and export SDK.

    From the manual, I have to switch Transport as DMA Transport.

    But I did not see "DMA Transport" on Transport in Device.

    So VS 2005 could not deploy Emulator.

    Any commnets for the issue I had.

    Thanks

    John