This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARM exception vector question


On Wed, Feb 27, 2008 at 10:25 AM, Gary Thomas <gary@mlbassoc.com> wrote:
>
> Tom Deconinck wrote:
>  > Hi,
>  >
>  > Perhaps of topic... because not 100% eCos related
>  >
>  > I was wondering, is there a limitation on the address you can jump to
>  > from an exception vector of an ARM 7? Can I jump to just any address?
>  > (I thought I read something about this, but I can't find it
>  > anymore...)
>  >
>  > I have 2 setups: one running code exclusively out of internal and
>  > external ram, and that works fine.
>  >
>  > The other one is running the exact same code, but from external flash.
>  > If I dump the memory where the exception vectors are located (code
>  > running from external flash), I get this:
>  > 00000000 : 0xe59ff018  - 442503144  ....
>  > 00000004 : 0xe59ff018  - 442503144  ....
>  > 00000008 : 0xe59ff018  - 442503144  ....
>  > 0000000c : 0xe59ff018  - 442503144  ....
>  > 00000010 : 0xe59ff018  - 442503144  ....
>  > 00000014 : 0xeafffffe  - 352321538  ....
>  > 00000018 : 0xe59ff018  - 442503144  ....
>  > 0000001c : 0xe59ff018  - 442503144  ....
>  > 00000020 : 0x10000040    268435520  @...
>  > 00000024 : 0x10000164    268435812  d...
>  > 00000028 : 0x10000188    268435848  ....
>  > 0000002c : 0x100001b4    268435892  ....
>  > 00000030 : 0x100001d0    268435920  ....
>  > 00000034 : 0xe59e0100  - 442629888  ....
>  > 00000038 : 0x100002d0    268436176  ....
>  > 0000003c : 0x10000298    268436120  ....
>  > 00000040 : 0xe92d500e  - 382906354  .P-.
>  >
>  > e.g. the IRQ vector (0x34) jumps directly to an address in external
>  > flash, is this allowed or do I need to jump to another location first?
>  >
>
>  Have you looked at the sources (hal/arm/arch/current/src/vectors.S)?
>
>  On the ARM, you can jump indirect through a pointer.  This is done
>  using the instruction
>    ldr pc,<loc>
>  where <loc> is a longword that has the address you want to jump to.
>
>
>
Yes I have. It's using the technique you described
e.g. ldr pc, .IRQ  and IRQ is defined as .word IRQ so that explains
why it works.

I got confused because I know there are some architectures that only
allow you to jump to a limited memory region from an exception vector,
and then let you jump to any other address from there on.
So my software hang issue has it's root cause somewhere else ;)

Another question: 0x00000014 and 0x00000034 are marked as a reserved
exception vector
Does it have to be set to zero explicitly or is the garbage data I've
got there now acceptable?

Thanks for the clarification.
Tom

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]