# Forum: ARM programming with GCC/GNU tools -mthumb-interwork, works without it

 Author: Carlos Be (cjb) Posted on: 2008-03-05 18:35

Rate this post
 0 ▲ useful ▼ not useful
hi everybody,
first thanks for this great tool WinARM is!

I've been developing some arm code, and now I wan't to build some of it
to thumb mode.

I tried the mthumb-interwork option, but I got a data abort exception
somewhere on my code which wasn't there when using pure arm code. (I
compiled with -mthumb the thumb code).

further experimenting showed me that compiling everything as arm, but
result.

any clues? I'm using the last WinARM suite.

binaries are different of course, but what would make the code fail with
-mthumb-interwork only?

thanks!

 Author: Martin Thomas (mthomas) (Moderator) Posted on: 2008-03-07 15:52

Rate this post
 0 ▲ useful ▼ not useful
Carlos Be wrote:
> I tried the mthumb-interwork option, but I got a data abort exception
> somewhere on my code which wasn't there when using pure arm code. (I
> compiled with -mthumb the thumb code).

Can you track down the data-abort as explained in this text:
http://www.ethernut.de/en/documents/arm-exceptions.html

>
> further experimenting showed me that compiling everything as arm, but
> result.
>
> any clues? I'm using the last WinARM suite.

Maybe a call of subroutines: Do you have any assembler-code in your
project which calls subroutines in thumb-mode with "BL"? This will fail.
Try to replace them with a "ldr, bx-sequence.
Maybe an issue with the interrupt-handling. Do you use
"attribute(interrupt)"?

> binaries are different of course, but what would make the code fail with
> -mthumb-interwork only?

Difficult to help without knowing the code. Try to create a minimal
example to reproduce the issue (makefile, linker-script, startup-code,
simple application-code) and attach it to a message in this forum.

Martin Thomas

• $formula (LaTeX syntax)$