none
How to cross compile x86 dll and .exe for ARM architecture. RRS feed

  • Question

  • Hi,

    I have a .dll file which I had compiled the file in x86 architecture and executed it successfully on my system. But I want to run the same .dll on SOC which has ARM processor. Hence I need to cross compile the application to generate .dll for ARM based board, but I don't know how to do so. Is there any tool available to accomplish this task or any other mechanism.

    Thanks.


    Bhavesh

    Thursday, March 20, 2014 9:07 AM

All replies

  • which version of windows CE you are working on it? What is the purpose of the DLL, is it an API dll or a Driver DLL?

    Please mark as answer, if it is correct.
    Please vote,if it is helpful post.
    Vinoth.R

    http://vinoth-vinothblog.blogspot.com
    http://www.e-consystems.com/windowsce.asp

    Thursday, March 20, 2014 10:04 AM
  • Thank you for your response,

    I am currently working on "Windows Embedded Compact 7". I wish to implement MODBUS functionality for the same. I have .c code of the same, which I had complied successfully and generated .dll for x86 platform and tested it using C application. The testing was successful, but now I want to implement the same protocol for my SOC which is an ARM7 platform. Also, this is API dll. So how should I compile the code so as to make it compatible for ARM platform.

    Thank you.


    Bhavesh


    Thursday, March 20, 2014 11:01 AM
  • so you have your own MODBUS protocol stack. ok.  Looks like you have a ARM7 based WEC7 device on your hand.you need an platform SDK which can be obtained from the device vendor. Once you installed the platform SDK for VS2008, you can create a smart device project and you do the porting work. Please contact your device vendor.

    Please mark as answer, if it is correct.
    Please vote,if it is helpful post.
    Vinoth.R

    http://vinoth-vinothblog.blogspot.com
    http://www.e-consystems.com/windowsce.asp

    Thursday, March 20, 2014 11:31 AM
  • Hi Vinoth, 

    This is Partap. Me and Mr. Bhavesh are working together in WINCE team in PHYTEC. We are own manufacturer of SOM's...... 

    We have download the modbus from https://github.com/stephane/libmodbus/ We compiled it for x86 machine and test with two different systems. It is working fine on x86 machine. Now, we want to move it from x86 to ARM platfrom.. Means, we want to implement it in our BSP under drivers or sub project. How to do this ???

    We are searching ?????

    Thursday, March 20, 2014 11:38 AM
  • The answer depends on how you built the original DLL.

    1. Visual Studio with an SDK - as Vinoth pointed out, you will need an ARM SDK.  You obtain the SDK from your vendor or create it yourself.

    2. Visual Studio with Platform Builder and a BSP - you will need an x86 BSP.  Of course, Platform Builder comes with CEPC which is an x86 BSP.   If you do not have the CEPC BSP it is either because you deleted it, or because you did not install x86 support with Platform Builder, so simply re-install.


    Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http://geekswithblogs.net/bruceeitman Eurotech Inc. www.Eurotech.com

    Thursday, March 20, 2014 12:34 PM
    Moderator
  • Are you using serial or ethernet for communication for the MODBUS? if it is ethernet you have to use socket programming. if it is serial port, you will use the COM APIs.

    it is up to you for designing a protocol based on your usage.

    if the existing source code is exposing it as APIs, you can build it as an API dll (A simple DLL either in sub project or driver folder) and add it in your .bib files to include it. This dll will be loaded when you run the application which is calling these APIs.

    if it is already in stream driver format ( Init, Deinit, read, write etc...) you can port it as a stream driver and load it by Builtin registry. then you have to create your own APIs dll on top of it or directly calling CreateFile with the prefix for accessing it from your application.


    Please mark as answer, if it is correct.
    Please vote,if it is helpful post.
    Vinoth.R

    http://vinoth-vinothblog.blogspot.com
    http://www.e-consystems.com/windowsce.asp

    Thursday, March 20, 2014 12:53 PM
  • Hello Friends,

    @Bruce Eitman, We did not install x86 BSP during the time of installing the platform builder. Also we have our own SDK. The point is, it is necessary to re - install platform builder.

    @Vinoth, We have both methods. RTU and TCP. But, we have only tested with rtu... We have each an every thing but for win32. I think so there is need to follow the stream driver method but this is my thoughts. May be we have to do only by this way. Acc. to current case, we only need to cross compile it for our board and we have to just modify the user API code........

    Friday, March 21, 2014 3:12 AM