Yahoo Groups archive

Lpc2000

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

Message

Re: [lpc2000] ARM mode

2005-10-18 by Charles Manning

On Tuesday 18 October 2005 12:17, Tom Walsh wrote:
> Yannick Hildenbrand wrote:
> >Hello,
> >
> >
> >
> >I just would like to add a small remark to this excellent analysis
> >
> >
> >
> >The BLX instruction is available on architectures V5 and above (see the
> >Addison-Wesley ARM Architecture Reference Manual). The LPC 2000 family
> > uses the V4T architecture, and this means that BLX cannot be used. Be
> > careful when specifying the core variant in the assembler argument list.
> > If the right architecture is not correctly specified (or the default is
> > e.g. V5 or above), the assembler may accept BLX but the code may have
> > strange behavior on a LPC2000. Double checking this may avoid long hours
> > of debugging.

Instead of doing a blx, the following will work pretty well:
	ldr  r0,=func_addr  (assumes func_addr has 1 set for Thumb funcs)
	mov lr,pc
        bx r0

>
> I had been wondering which arch type was for the LPC2xxx family, thank
> you.  So, I would imagine that even if I built an arm9tdmi (armv5t) GCC
> compiler that I could restrict the code generation with "-mcpu=arm7tdmi
> -march=armv4t" then?

That is correct. 
>
> I'm asking as I also have an ARM920T system that I also build code for.
> I'm still pretty new to the details of the ARM variants (seems to be a
> lot of them ;-).

There are quite a few, and some of the versioning is pretty confusing too (eg. 
ARM7dtmi  uses V4T instruction sets). 
>
>
> TomW

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.