|
楼主 |
发表于 2010-4-22 17:25:45
|
显示全部楼层
能查到的资料关于icc和cvavr的比较多,关于avr studio很少的。帮助文件中的Memory Settings,说的很简单。以flash为例说的。模模糊糊的。
The purpose of this property page is to enable easy configuration of memory segments and bootloaders.
The upper part of this page displays information about the currently selected part.
Flash Size is specified in words while Sram Size and Eeprom Size is specified in bytes.
A List Control is used for showing the defined segments.
To add a segment, double-click somewhere in the control or press the "Add" button
The following dialog appears:
Select the Memory Type, name and address for the new segment and press Ok.
To specify a bootloader for example, set memory type to "Flash", give the bootloader a name and specify one of
the allowed addresses for a bootloader on the current part. It is recommended to use .bootloader as name for
bootloaders. It has become more or less a standard and avr-libc supports this by providing a macro BOOTLOADER_SECTION
that can be put in front of a function to put that function into the section named .bootloader.
(defined in <avr/boot.h>).
The address must be given as a hexadecimal number prefixed with 0x. It is interpreted as a word address for flash memory
and as byte addresses for sram and eeprom memory.
If you want to relocate one of the predefined sections (.text, .eeprom or .data), just use the name of the section you
want to relocate. (Include the dot).
To edit an entry in the List Control, double-click the entry you want to edit.
To remove an entry, select the entry and press "Remove".
It is also possible to specify an initial stack address to use. This can be useful when setting up external memory.
Notes about the AVR port of gcc:
The AVR is a Harvard architecture CPU. This means that it separates instruction memory and data memory.
The gcc was originally designed to support Von Neumann architectures which define a single storage structure to
hold both instructions and data.
This dichotomy is solved by a series of nifty tricks in the AVR port of gcc, of which three should be noted:
The .text segment starts at 0x0.
The .data segment starts at 0x800000.
The .eeprom segment starts at 0x810000.
These peculiarities have been abstracted away by the GUI of this plug-in, but users will see the truth when
building projects with relocated segments.
A relocation definition for flash will be passed to the GNU linker via avr-gcc as the option:
-Wl,-section-start=bootloader=0x1fc00
Note that the address has been multiplied by 2 to get the byte address.
A relocation definition for the .data section will be passed as:
-Wl,-section-start=anewdatasegment=0x800 |
|