Search code examples
armcross-compilingstm32

Is it possible to cross-compile an already compiled file? ARM Cortex M4


I'm working on a project where I have to port a compiled file for x86 architecture to a STM32F401RE, which has an ARM Cortex M4 processor.
Is it possible to cross-compile the already compiled file? I don't have access to the c code, since the output is given by a parser that directly translate the higher level language to the executable file.


Solution

  • I'm going to say it's not possible. Even if you somehow managed to translate all x86 instructions to ARM instructions. An executable compiled for x86 from a higher level language most definitely relies on an operating system for loading, memory access, IO etc. You will not have such an OS on a Cortex M4.