|
From: | E. Weddington |
Subject: | Re: [avr-gcc-list] memory layout for bootloader |
Date: | Wed, 15 Jun 2005 18:58:39 -0600 |
User-agent: | Mozilla Thunderbird 1.0 (Windows/20041206) |
Torsten Mohr wrote:
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?
No preference, just different designs. One way is to build an application with an integrated bootloader; that's what the example is hinting at. Some people, the bootloader *is* the application and they do move the .text section, and also move the interrupt vectors to the bootloader area.
I'm confused about the addresses.
Yes, they are confusing. The addresses in the datasheet are *word* addresses, so take that and multiply by two to get the *byte* addresses. Byte addresses are what is used throughout the entire GNU toolchain. I wish Atmel would change their datasheets, or at least put in a note to reflect this.
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?
Somehow I doubt it. I would think that you should be able to use all of it for code. Because this device is so new, the best thing to do would be to check the datasheet or ask Atmel directly about this.
I assume that the ATMega128 can execute program in all its 128kB, is that correct?
Yes, that is correct.
Can i really DISABLE SPI programming by fuse bit SPIEN?
Sorry, I don't know about this one. HTH Eric
[Prev in Thread] | Current Thread | [Next in Thread] |