1

I'm using a AT32UC3B0256 microcontroller in combination with AVR32Studio 2.6 and I wouuld like to please a constant variable at a fixed address ( e.g. at position 0x80799999) at the end of the flash.

const int variable __attribute__((section(????))) = 1234;

Any ideas?

  • possible duplicate of [How to place a variable at a given absolute address in memory (with GCC)](http://stackoverflow.com/questions/4067811/how-to-place-a-variable-at-a-given-absolute-address-in-memory-with-gcc) – Ignacio Vazquez-Abrams Aug 18 '15 at 08:15

1 Answers1

1

In Program use

const int variable __attribute__((section(".varaddress"))) = 1234;

and in your linker script add this flag:

-wl,--section-start=.varaddress=0x80799999

Also you can check Memory Sections in AVR

Nasr
  • 2,482
  • 4
  • 26
  • 31