avrdude-dev
[Top][All Lists]
Advanced

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

RE: [avrdude-dev] avrdude elf implimentation


From: Eric Weddington
Subject: RE: [avrdude-dev] avrdude elf implimentation
Date: Tue, 20 Mar 2007 11:34:33 -0600

 

> -----Original Message-----
> From: Colin O'Flynn [mailto:address@hidden 
> Sent: Tuesday, March 20, 2007 8:24 AM
> To: Eric Weddington
> Cc: address@hidden; 'Joerg Wunsch'
> Subject: Re: [avrdude-dev] avrdude elf implimentation
> 
> Hey Eric,
> 
> You need to 
> modify the following file in the binutils source:
> 
> binutils/ld/scripttempl/avr.sc
> 
> In the MEMORY section it becomes:
> 
> MEMORY
> {
>   text   (rx)   : ORIGIN = 0, LENGTH = $TEXT_LENGTH
>   data   (rw!x) : ORIGIN = 0x800060, LENGTH = $DATA_LENGTH
>   eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
>   lfuse  (r!w!x): ORIGIN = 0x820000, LENGTH = 1
>   hfuse  (r!w!x): ORIGIN = 0x820010, LENGTH = 1
>   efuse  (r!w!x): ORIGIN = 0x820020, LENGTH = 1
> }
> 
> and in the SECTION you have to add:
> 
>   .lfuse ${RELOCATING-0} (NOLOAD):
>   {
>     *(.lfuse*)
>   } ${RELOCATING+ > lfuse}
> 
>   .hfuse ${RELOCATING-0} (NOLOAD):
>   {
>     *(.lfuse*)
>   } ${RELOCATING+ > hfuse}
> 
>   .efuse ${RELOCATING-0} (NOLOAD):
>   {
>     *(.lfuse*)
>   } ${RELOCATING+ > efuse}
> 

One small change needs to be done. You have the same input section,
*(.lfuse*), going to all output sections. As a suggestion, I would also add
another input section if we want to create a section for the older AVRs that
just have one fuse byte, and we want to have a separately named .fuse
section. The changes would be:


   .lfuse ${RELOCATING-0} (NOLOAD):
   {
     *(.lfuse*)
     *(.fuse*)
   } ${RELOCATING+ > lfuse}
 
   .hfuse ${RELOCATING-0} (NOLOAD):
   {
     *(.hfuse*)
   } ${RELOCATING+ > hfuse}
 
   .efuse ${RELOCATING-0} (NOLOAD):
   {
     *(.efuse*)
   } ${RELOCATING+ > efuse}


> I'm not 100% sure everything I've done is 'kosher', as I 
> haven't worked with 
> GCC linker scripts before. 

No worries. I'm still a novice myself. But from what I can tell, the above
looks good.

> At any rate it is a binutils 
> change, which takes a 
> while to get officially rolled into the project I take it?

True. But, if everyone agrees, we can certainly start trying it out with
patches in the distros.
 
> As well this change doesn't include anything for the older 
> AVR's that just 
> have a fuse, none of this lfuse/hfuse/efuse fanciness.

See change above.
 
> The idea of having a symbol defined in the ELF file that 
> tells you what AVR 
> you should have is a great idea to me as well... not sure if 
> we need a new 
> section for that?

Let's consider that in another thread. Right now the "architecture" is
already in the elf file. But I agree that the device name in the elf file is
needed. I just don't know if a separate section is needed, or what.

Thanks again for putting this together!

Joerg, what are your thoughts on the matter? Any objection to the direction
that this is going?

Eric







reply via email to

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