[Top][All Lists]

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

Re: [avr-gcc-list] Linker sections

From: E. Weddington
Subject: Re: [avr-gcc-list] Linker sections
Date: Fri, 07 Mar 2003 09:41:26 -0700

On 7 Mar 2003 at 17:14, 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.
> =
> -Wl,--section-start=EXT_RAM=0x801100,--section-start=.bootloader=0xd00
> 0,-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.
> Any comments, suggestions ?

I have an experimental header file that supplies bootloader support 
functionality (eventually to be submitted to avr-libc) that has been 
tested with success on a number of platforms (especially the 

The way that you are trying to relocate your bootloader section works 
for me. The one caveat you have to watch out for is that I've noticed 
the AVR data sheets list the bootloader addresses as WORD addresses. 
You need to give a BYTE address to the --section-start flag.

Without knowing which processor you're using, I can't verify that 
your address is correct or incorrect. But try looking at that first.

Let me know if you want a copy of my boot.h which supplies bootloader 
support routines.


reply via email to

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