assemblycompilationcross-compilingcoldfire

Cross Compiling Code for coldfire (MCF5225X)


I am currently building a processor model for the coldfire V2 architecture but I am running into issues testing it primarily because I can't seem to compile any coldfire code. All of the cross-compilers I find for GNU are targeted at 68k which is not the same as the coldfire architecture (they lie in the same general family but the specific ISA for each are definitely distinct and thus many instructions throw errors). Does anyone know of any GNU toolchains that will work?

GNU itself says it provides support for targeting these architectures but when i use the -march=5225 flag it doesn't work (just says all instructions unknown)


Solution

  • Assembling ColdFire code works with the GNU 68k assembler.

    You can start by looking in the ColdFire Programmer's Reference Manual to find out in which version of the ISA (instruction set architecture) the instructions you're using were made available.

    If you then run the GNU 68k assembler with the --help switch you'll see a list of arguments for the -march switch to specify the ISA you need. For example, -march=isab would select ISA_B. ColdFire support might require a non-ancient version of the GNU assembler. I used the one from binutils 2.22.

    Keep in mind that some 68k instructions have fewer addressing modes available when using a ColdFire ISA.