SparkFun Forums 

Where electronics enthusiasts find answers.

Everything ARM and LPC
By fll-freak
#168065
I am trying to compile code that was originally for an Atmel AT91SAM7S256 using the IAR compiler. It is littered with __arm keywords in function definitions. My Goggling leads me to believe that the __arm tells the compiler to compile the routine in Thumb mode. The keyword is not recognized by the Yagarto (gcc) compiler. I have yet to find out if Yagarto has an equivalent and what it might be. My Goggling has not gotten me far. Anyone here know?
By UhClem
#168069
-mthumb will tell the compiler to use thumb mode. If you want to specify that on a function by function basis I think that there is an attribute. But if you mix thumb and regular functions you have to enable interworking which is disabled by default. Enabling it adds code.
By fll-freak
#168072
Sounds like my simplest solution is just to define __arm as nothing and just have the routines as ARM and not Thumb. A bit bigger code I would imagine, but unless I run into problems it will have to do.

Thanks.
By stevech
#168128
usually, that __arm directive is there to say that the section of code must compile to run in ARM mode, not thumb mode. Such as ISRs and some special functions.
By fll-freak
#168134
Talked to some one today at work who informed me of the same thing. Strange the developer felt it necessary to add the keyword to just about every routine and not just those called from and ISR.

Again, thanks for the help