avr-gcc-list
[Top][All Lists]
Advanced

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

[avr-gcc-list] .data section


From: Markus Assfalg
Subject: [avr-gcc-list] .data section
Date: Thu, 27 Mar 2003 10:04:22 +0100

Hi,

I have troble with the following code:

typedef struct
{
        AVR_USART_UDR_REG       *udr;
        AVR_USART_UCSRA_REG     *ucsra;
        AVR_USART_UCSRB_REG     *ucsrb; 
        AVR_USART_UCSRC_REG     *ucsrc;
        AVR_USART_UBRRH_REG     *ubrrh;
        AVR_USART_UBRRL_REG     *ubrrl;
} _IF_CFG;

static const _IF_CFG    _if_cfg[2] =
                {
                        {
                                (AVR_USART_UDR_REG *) AVR_USART0_UDR,
                                (AVR_USART_UCSRA_REG *) AVR_USART0_UCSRA,
                                (AVR_USART_UCSRB_REG *) AVR_USART0_UCSRB, 
                                (AVR_USART_UCSRC_REG *) AVR_USART0_UCSRC,
                                (AVR_USART_UBRRH_REG *) AVR_USART0_UBRRH,
                                (AVR_USART_UBRRL_REG *) AVR_USART0_UBRRL
                        },
                        {
                                (AVR_USART_UDR_REG *) AVR_USART1_UDR,
                                (AVR_USART_UCSRA_REG *) AVR_USART1_UCSRA,
                                (AVR_USART_UCSRB_REG *) AVR_USART1_UCSRB,
                                (AVR_USART_UCSRC_REG *) AVR_USART1_UCSRC,
                                (AVR_USART_UBRRH_REG *) AVR_USART1_UBRRH,
                                (AVR_USART_UBRRL_REG *) AVR_USART1_UBRRL
                        }
                };

When I compile it, the initial values of _if_cfg[] are not in the coff file,
so I get 0xFFFF as address (initial value of empty flash).
The hexfile contains it correct and the pointers are set correct.
I think it's a problem with the linker-script (.data section) because
the .data-section mapped to 0x00800100 and this addressearea
are not included in the coff-file (?).

Memory Configuration

Name             Origin             Length             Attributes
text             0x00000000         0x00020000         xr
data             0x00800060         0x0000ffa0         rw !x
eeprom           0x00810000         0x00010000         rw !x
*default*        0x00000000         0xffffffff

[some text]

.data           0x00800100       0x18 load address 0x00000cd0
                0x00800100                PROVIDE (__data_start, .)
 *(.data)
 .data          0x00800100       0x18 uart.o
 *(.gnu.linkonce.d*)
                0x00800118                . = ALIGN (0x2)
                0x00800118                _edata = .
                0x00800118                PROVIDE (__data_end, .)

TARGET: ATmega128

Have anybody an idea whats wrong ?

Thanks

Markus


reply via email to

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