Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: gcc problem / why (or not) to use ARM mode

2005-07-18 by lpc2100_fan

Hi,

just a brief comment about ARM mode and THUMB mode. Depending on the
memory architecture and access time ARM mode can be good (faster) or
very bad (larger and slower).

If you have a 16-bit memory interface or worse a 16-bit Flash
interface, use Thumb mode under all circumstances! It is faster and
smaller code. 

If you have a 32-bit interface and any kind of waitstates associated
with it, Thumb is probably still faster and always smaller. A 32-bit
RAM with zero watistates though will give you up to 30% higher
performance in ARM mode compared to Thumb with the up to 30% code size
penalty. 

Using busses like the LPC2106 has them (128-bit to the Flash), ARM
mode will definitely be faster. The same applies as for the RAM above.
Using ARM mode for a complete program would be waste of code memory
space, using ARM mode in interrupt service routines (that are entered
in ARM mode anyhow) is a smart idea with the Philips devices. 

Be aware though that most other embedded Flashs will not work faster
in ARM mode from Flash because of limited bus width (e.g. Atmel, Oki)

Hope this clarifies why ARM mode is benefitial

Cheers, Bob

--- In lpc2000@yahoogroups.com, 42Bastian Schick <bastian42@m...> wrote:
> Michal Krestan <krestan@h...> schrieb am Mon, 18 Jul 2005 16:22:11
+0200:
> 
> >
> > I'm using LPC2106 in my application with gcc 4.0.0. I've compiled
all my 
> > sources in ARM mode and it works fine, but for IAP routine call I
had to 
> > use -mthumb-interwork flag for gcc. After this, my application will 
> > crash in few sec (not on IAP call, but inside IRQ function). The
problem 
> > is in IRQ routine. When I'll make call of function inside ISR, gcc
will 
> > generate wrong code without returning address. If i'll not use 
> > -mthumb-interwork flag, the code is compiled correctly.
> 
> 0) Why do you use ARM mode ? (IMHO it has no benefit despite some rare
> situations)
> 1) Do you use this flag for all stages (i.e. compile,assemble,link) ?
> 2) Do you have the .glue7 and .glue7t sections in your linker script ?
> 
> 
> -- 
> 42Bastian Schick

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.