[Top][All Lists]

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

Re: [avr-gcc-list] Locating Assembly Code at a Fixed Address

From: Jesper Hansen
Subject: Re: [avr-gcc-list] Locating Assembly Code at a Fixed Address
Date: Mon, 7 Apr 2003 21:26:31 +0200

If you only are linking the bootloader code, it's much easier to 
just add the following line to your linker flags : 

-Ttext 0x3C00

This assumes a mega161, loading the bootloader at 0x3C00 (word 
address 0x1E00).


----- Original Message ----- 
From: "Louis Beaudoin" <address@hidden>
To: <address@hidden>
Sent: Monday, April 07, 2003 9:09 PM
Subject: [avr-gcc-list] Locating Assembly Code at a Fixed Address

> I'm trying to add some assembly code located in the bootloader section to my
> project.  I followed the avr-libc's FAQ on how to relocate code to a fixed
> address, but the linker just places the assembly code in the middle of the
> text section.  If I replace the assembler code with a C function, the code
> is placed at the correct address.  Has someone done this before?
> Relevent portions of assembler (.S) file:
>         .global SpmCommand
> SpmCommand:
>         movw    r30, r24        ; First argument is page address
> ...
> Relevent portions of header file:
> void SpmCommand(u_short addr, u_char function) __attribute__ ((section
> (".spmcmd")));
> Relevent portions of linker map file:
> Address of section .spmcmd set to 0x1e000
> ...
>  .text          0x00000f60    0x1e01c assm.o
>                 0x0001ef60                SpmCommand
> ...
> .spmcmd         0x0001e000        0x0
> Thanks,
> Louis Beaudoin
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://www.avr1.org/mailman/listinfo/avr-gcc-list

reply via email to

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