[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Memory section different of .text section

From: Yannick PODGORSKI
Subject: Re: [avr-gcc-list] Memory section different of .text section
Date: Wed, 24 Nov 2004 12:04:39 +0100

Thanks Ned,
In fact, I made a mistake because I can't write a variable
in flash. In fact, you are right. I want to create a section in SRAM where I put specific variables (I want to try to control this possibilities). But there are conflict with .bss section
if I don't choose good address.
Sorry for this question.


On Tuesday 23 November 2004 Ned Konz wrote:

What happens if you make a section in RAM for the variable? I wouldn't think that you'd be able to put a variable into flash at 0x1d000 (because then it
wouldn't be "variable", right?).

Also, I'd think it would be easier to maintain using a custom linker file
rather than using command-line settings of section addresses.

Have you tried moving the .data section using something like the command line


(that, according to the avr-libc docs would move the .data section to 0x1100).
You have to add 0x800000 to the actual RAM address.

Ned Konz

On Tuesday 23 November 2004 10:24 am, Yannick PODGORSKI wrote:
I saw it in gcc 3.4.2 manual, there is an example.
I use --section-start=.function=0x1D000 and the section is well create.

I use __attribute__ ((section(".function"))) in front of functions and it
works :
    uint16_t section_fct(void); __attribute__ ((section(".function")))
The function is well put in memory at 0x1D000

I try with variables but it doesn't work :
uint16_t var_section __attribute__ ((section(".function"))) = 0;
The linker doesn't link :-). The error is about "section type conflict".

reply via email to

[Prev in Thread] Current Thread [Next in Thread]