This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Prefetch Abort

Hi All,

I'm getting a PAbt_Handler call and want to trace the source as I'm not sure how this error is occurring...

I'm only using the on-chip flash and ram (target is LPC2148) so how can I be executing code at an invalid memory address??


If I can just return to the calling address that would be better than a total crash.

Thanks for your help,

Malcom

Parents
  • > I'm only using the on-chip flash and ram
    > (target is LPC2148) so how can I be executing
    > code at an invalid memory address??

    Flash+RAM only covers a small portion of the
    (4GB) address space, so there are plenty of
    bad code addresses. Prime candidates:

    1) Bad address in VIC
    2) Indirect call "(*f)()" using an
    uninitialized/mangled pointer.
    3) "return" after overwriting the stack.

    It's not useful to "just return" since it's
    not clear where you would return to -- the
    address in R14 is already known to be bad.
    You can't use the stack directly since you
    may not have gotten there using a call.

    Debugging this is workable but rarely
    formulaic. How much visibility do you have?
    Full debugging (JTAG, e.g.)? Clues:
    1) Does R14 look like anything recognizable?
    (ASCII characters? A valid pointer with
    a stray bit set?) There may be a clue
    here.
    2) Look in SPSR to see what the Abort-ed
    mode was. Use that to find the appropriate
    SP value and work backwards from there.
    Again, you may not have got here using
    a call, so you'll have to interpolate,
    but you can see where you've been
    "recently", which might narrow things
    down.

Reply
  • > I'm only using the on-chip flash and ram
    > (target is LPC2148) so how can I be executing
    > code at an invalid memory address??

    Flash+RAM only covers a small portion of the
    (4GB) address space, so there are plenty of
    bad code addresses. Prime candidates:

    1) Bad address in VIC
    2) Indirect call "(*f)()" using an
    uninitialized/mangled pointer.
    3) "return" after overwriting the stack.

    It's not useful to "just return" since it's
    not clear where you would return to -- the
    address in R14 is already known to be bad.
    You can't use the stack directly since you
    may not have gotten there using a call.

    Debugging this is workable but rarely
    formulaic. How much visibility do you have?
    Full debugging (JTAG, e.g.)? Clues:
    1) Does R14 look like anything recognizable?
    (ASCII characters? A valid pointer with
    a stray bit set?) There may be a clue
    here.
    2) Look in SPSR to see what the Abort-ed
    mode was. Use that to find the appropriate
    SP value and work backwards from there.
    Again, you may not have got here using
    a call, so you'll have to interpolate,
    but you can see where you've been
    "recently", which might narrow things
    down.

Children