Forum: ARM programming with GCC/GNU tools efsl+AT91SAM7S: sudden jump out of RAM-execution

von Chris B. (chris301)

Rate this post
0 useful
not useful

I have integrated efsl into my application on AT91SAM7S256 
(olimex-board, yagarto-toolchain). I can create and write files on 
SD-cards, everythings works fine.

However when i remove the SD-card while efsl is busy writing, strange 
things happen: in case the program is located in RAM, pc jumps for some 
reason to a memory location outside the program's RAM-section. I haven't 
confirmed 100%, but it seems like pc jumps to adress 0.
When the program is located in FLASH, this jump most probably also 
occurs, but the program continues to work.

Watchdog is disabled and reset is also not triggered by interrupts, 
timeouts etc.

The application environment (makefile, linker file, startup-file etc.) 
should be OK, as i have been using it since a while and never observed 
such a behaviour.

Besides any hints on this problem i would also be grateful if you could 
tell me how to check the last line of valid RAM-code before PC jumps to 
0000 (or any other adress outside of the valid RAM-area).


von Andreas S. (andreas) (Admin) Flattr this

Rate this post
0 useful
not useful
Check the content of the link register (r14) and the call stack 
("backtrace" in gdb), this will give you the functions that were called 
before the error occured. It's not always that easy, because the stack 
might already have been corrupted by the program at this point, but it's 
a good place to start.


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.