Topic : Compiling in thumb mode with interwork option + ARCH type

Forum : ARM

Original Post
Post Information Post
June 17, 2007 - 5:39pm
Guest

Hi All

There is a post about this (http://www.raisonance.com/Forum/punbb/viewtopic.php?id=2167) but it doesn't seem to reach a conclusion, therefore I will ask here again.

I am using RIDE Version 06.10.22, Build number BN745-ST7-ARM-80C51.

When I set the target option "Use Thumb mode" I get Thumb code. In the log file the GCC option -mthumb is seen.
When I set both "Use Thumb mode" and "Enable Interwork" the GCC option -mthumb-interwork is seen and the generated code is ARM code

Only when not using -mthumb-interwork is the -mthumb flag also being set.

Is this a problem in the RIDE version which I am using?

I see also that the project (set up for STR912F44) is using the flag -march=armv5te. The GCC has also a cpu flag (-mcpu=arm966e-s) - is there any advantage of setting this as well???

Best regards

Mark Butcher

Replies
Post Information Post
+1
0
-1
June 18, 2007 - 10:30am
Raisonance Support Team

Hi,

When the interwork option is active, it means that you plan to compile some files in ARM and some other files in thumb. Therefore, the global "thumb" option in the target options is not used anymore. Instead, the thumb option in the compiler options is used.

Activate the interwork option in the target options. Then, click "options"->"project"->"GCC-ARM"->"ARM-specific options", and you will see the "generate thumb code" option that was not there before you activated interwork. (and also an option in the assembler section) Now you can use this new option to select thumb or ARM specifically for each source file using the local options. (right-click on a source file in the project view, then select "options"->"local options")

I hope it answers your questions.

Best Regards,

Vincent

+1
0
-1
June 18, 2007 - 1:11pm
Guest

Hi Vincent

You are correct, it does operate this way (although it is not very obvious).

I solved it by doing the following:

I didn't select any of the options but added –mthumb and -mthumb-interwork to the GCC C options under ‘more’ and -mthumb-interwork to the asm options under 'more'.

I have just reworked it with your technique and obtained the same result. Thanks.

Regards

Mark