[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] memory layout for bootloader
From: |
Torsten Mohr |
Subject: |
[avr-gcc-list] memory layout for bootloader |
Date: |
Wed, 15 Jun 2005 23:40:03 +0200 |
User-agent: |
KMail/1.8 |
Hi,
i'd like to write a bootloader for an ATMega128 and some
questions came up, it would be great if you could give me
some hints.
In avr-libc-usermanual-1.2.3 there is an example in the FAQ
how to put a function into a certain section and how to put
that section to a certain address. In that example the section
".bootloader" is used.
I just made a small example and found in the map-/listing-file
that a function marked with that attribute is put at that fixed
address, but there are lots of other functions that are of course
then not at that fixed address.
To place a bootloader at a fixed address, isn't the preferred way
to put section ".text" to a fixed address?
Or are there some disadvantages in this way?
I'm confused about the addresses. The ATMega has 128 kB of
flash. It has a 16 bit PC. In the data sheet i read that the flash is
organised in 64kB X 16 bits.
When i set (BOOTSZ1:BOOTSZ0) to (0:0), do i set the the address
of the bootloader to 0xF000 or 0x1e000? In the data sheet 0xF000
is used, in the avr-libc-usermanual 0x1E000 is used in the example.
I guess i use 0x1E000, as 0xF000 seems to be based on 16 bits
per address, is that correct?
In the data sheet it is also mentioned that the assembler commands
are either 2 or 4 bytes. What about the ATMega256, can the upper
128 kB only be used for data and not for an executable program?
I assume that the ATMega128 can execute program in all its 128kB,
is that correct?
Can i really DISABLE SPI programming by fuse bit SPIEN?
So if i set this one to 1 i have to program the chip in parallel mode
again to enable it? This is not possible in an easy way on my
board, this is a really dangerous thing, or do i misinterpret the data
sheet?
Best regards,
Torsten.
- [avr-gcc-list] memory layout for bootloader,
Torsten Mohr <=