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

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

Re: [avr-gcc-list] Linker sections


From: Klaus Rudolph
Subject: Re: [avr-gcc-list] Linker sections
Date: Fri, 07 Mar 2003 18:50:28 +0100

Marko Panger wrote:
> 
> Hello all !
> 
> I am developing a application which uses external RAM and must have the
> capability to update some data arrays which are stored in flash.
> 
> For variables which must be placed in XRAM I used the
> "--section-start=EXT_RAM=0x801100" linker command and it seems to work. Now,
> my problem is that I have to place some functions (kind of bootloader) into
> the upper part of the flash. I tried to declare a function with
> "__attribute__ ((section (".bootloader")))" attribute and passed this
> section in the same way I did with variables.
> 
> (LDFLAGS
> = -Wl,--section-start=EXT_RAM=0x801100,--section-start=.bootloader=0xd000,-M
> ap=$(TARGET).map,--cref)
> 
> The linker didn't complained and the generated *map file looks OK, but If I
> upload the code in FLASH and then I read it out there is NO valid code at
> 0xd000. (See below part of my map file)
> 
> .bootloader     0x0000d000       0x22
>  .bootloader    0x0000d000       0x22 flash.o
>                 0x0000d000                WriteFlash
> 
> I presume I am doing something wrong when I am passing "section-start"
> commands to the linker.

If the linker give no errors and warnings and the map file is ok please
read the symbol table from the generated output file with avr-nm.

If you find your bootloader section at the correct place the only
problem
can be the upload to the target here. Which file do you upload? 
Is it possible that you do not upload the complete file? Maybe
only the .text section? is section eeprom also uploaded?
Have you looked in a srec file maybe?

if I do an eeprom update I use:
avr-objcopy -j .eeprom --set-set-section-flags=.eeprom="alloc,load"
--change-scection-lma .eeprom=0 -O srec a.srec


I tried a avr-objcopy with a bootcore at 0xd000 and my srec contains the
bootcore date
there without any additional options for avr-objcopy :-(
I have actual no device to run on, so I canĀ“t continue at
that point :-(

Fuses set for loading bootcore segment, maybe not allowed?

Not much, but hope that helps :-)

Klaus


reply via email to

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