AT921SAM7: jump to address in flash

Jun 09, 2008 0 Replies

Hello,



MCU: at91sam7s256 toolchain: Yagarto (based on gcc-4.2.1)



First image XXX bytes length is burnt on the flash at the very beginning, by address 0x100000; second image resides on the flash at the (0x100000 + XXX). First image prints a short debug message out on DBGU port and then should jump to (0x100000 + XXX) and run the second image, which also prints out DBGU and lights on LED.



What I did:



1) C-startup code of the 1st application is based on some of Atmel's examples
2) C-startup code of the 2nd application:

- puts a "dummy" vector table in ROM; this dummy section contains only jump on RESET where remap and etc. being done, other vectors are NOP



- places IRQ handler in to RAM as well



- does remap



Both codes compile cleanly, but the whole thing doesn't work as I expected it to. First application prints, then runs second application, which lights LED on but instead of printing string it outputs some garbage on a DBGU port.



Obviously this issues is related to C-startup code, what could I miss?


Best regards, Roman


Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required