This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problems compiling assembly for cortex m3

Note: This was originally posted on 20th February 2011 at http://forums.arm.com

Hi,

My platform is Stellaris Cortex M3 and I'm using one of the recent releases of Codesourcery Lite toolchain.

I'm trying to put an assembly source file to my project and edit my makefile to compile it along with all the *.c files.
My issue is that I'm getting the following error message, compiling the assembly file:
asmFile.s:235: Error: ARM register expected -- `ldrsh xi,[a,#2]'


Currently I'm configuring my compiler flags like this:
ASMFLAGS = -mthumb -mcpu=cortex-m3 -x assembler-with-cpp -adhlmns

The assembly file is using #define's for re-defining register names, as well as macros for some pre-defined actions.

I think I need some basic suggestions on how to configure my arm-none-eabi-gcc compiler, to compile and pre-process an assembly file.

Any hints on how to tweak the compiler to correctly compile my assembly?

Regards
palsson
0