Topic : How to generate verifiable thumb code with STR91x?

Forum : ARM

Original Post
Post Information Post
March 16, 2007 - 9:58am
Guest

I am using the evaluation version of RIDE with the following settings.

With Options-->TarGet
1) device = STR91xFx44
2) boot mode = flash
3) thumb mode: Enable interwork (checked) Use thumb mode (checked)

With Options-->Project-->GCC-ARM-->Generate Thumb code (-mthumb) (checked)
-->AS-ARM---->Assemble Thumb code (-mthumb) (checked)

During the compilation of the C codes, only the option of -mthumb-interwork is used. During the linking process, the options of both -mthumb-interwork and -mthumb are used.

When I debug the generated .elf file, I choose Data dump-->Disassembly code and notice that all of the instructions are still in 32-bit addresses. I thought if I turned on the thumb code options, they should be 16 bits address.

Can you tell me what I have done wrong here?

Many Thanks,

Jim

Replies
Post Information Post
+1
0
-1
March 16, 2007 - 10:35am
Raisonance Support Team

Hi,

I checked here and it works fine: If I select thumb mode, then the compilation is done using "-mthumb" option. (even with interwork enabled)

Please check that you are not using some local options (red dot on the file in the project view) which could force the ARM mode for some files.

If not, then please try this: (which is what I just did here)
1. Open the test example in "c:\RIDE\examples\STRx\test"
2. Change the target option for using your STR9, thumb mode and interwork.
3. Compile and link.
4. Look at the file "main.o.log" that has been generated in the project's directory, and tell me if it's been compiled using Thumb or ARM mode.

If this doesn't help, then please send us your project or any sample project that shows the problem. (we need a complete compiled project with sources, includes, listings, logs, etc.)

Note: I don't expect the "-mthumb" option to the linker to have much effect. It's when compiling that it makes a difference...

Note2: If you are not using any local options, then interwork is useless, because all your files will be in the same mode, except the startup which is always in ARM mode but doesn't need interwork to call a "main" in Thumb mode...

Best Regards,

Vincent

+1
0
-1
March 16, 2007 - 10:51am
Guest

Hello vincent,

Thanks for your quick reply.

After read your post, I tried with the test project and my own project again, both of them are compiled with -mthumb option.

However, when I debug both version and enable data dump-->disassembly code, what I see is still the 32 bit wide instructions, the ARM code. Not the 16 bit wide thumb code. Is that the same in your debug screen too?

Many Thanks,

Jim

+1
0
-1
March 16, 2007 - 3:30pm
Raisonance Support Team

Hi,

It looks like there is a problem in the STR9 startup. Please try to copy, in "c:\RIDE\lib\STRx", the two files from this folder:
"ftp://www.raisonance.com/pub/forum/STR9_Startup_thumb/..."

And then build the project again.

Best Regards,

Vincent

+1
0
-1
March 16, 2007 - 3:44pm
Raisonance Support Team

Hi,

Sorry, it seems that the problem is in the simulator, not in the startup. I'll need a little time to understand it better.

Are you debugging using the simulator or RLink?

Best Regards,

Vincent

+1
0
-1
March 16, 2007 - 6:48pm
Guest

Hello vincent,

I am using simulator to debug. my starter kit should arrive next monday.

The insider's guide to the STR91x ARM 9 from Hitex gives me an example about what the interworking should be. In this manual, it explains the concept at chapter 2 and shows a code example and debuggin session in its chapter 5.

I download the document from http://mcu.st.com/mcu/modules.php?name=mcu&file=familiesdocs&FAM=101 However, the link seems broken now.

Many Thanks for looking into the issue.

Jim