[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] rjmp across FLASHEND
From: |
Joerg Wunsch |
Subject: |
Re: [avr-libc-dev] rjmp across FLASHEND |
Date: |
Fri, 7 Oct 2011 11:42:29 +0200 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
As Bernhard Kuemel wrote:
> I could ask Atmel. They do respond to such questions. I'm pretty sure it
> is ok to jump across flashend.
I think that might be useful, just to be sure.
> Should the odd case happen, that the application starts beyond the
> range of rjmp I have to use jmp in the loader. This makes the loader
> bigger by one word and the reset rjmp changes by one word. So I have 2
> different rjmps which I have to consider as sync word. I want to
> minimize the number of sync words to make syncing most reliable.
OK, I see.
The following should be possible to work around the situation:
#include <avr/io.h>
.global main
main:
rjmp beyond_vectors
nop
/* vectors follow */
jmp foo
jmp foo
foo: rjmp foo
beyond_vectors:
jmp tinyloader
.org FLASHEND+1-0x3e
tinyloader:
rjmp tinyloader
Btw., .org is a "DONT" in a relocation assembler. Already during the
days of the venerable Z80, this was avoided. The correct way would be
to establish a separate section, and then assign the section start
address to the linker either within the linker script, or from the
linker commandline.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
----- End forwarded message -----
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)