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: Colin O'Flynn
Subject: Re: [avrdude-dev] avrdude elf implimentation
Date: Tue, 20 Mar 2007 11:24:28 -0300
User-agent: KMail/1.8.2

Hey Eric,

> What might be better, is to change the linker scripts
> (<install>/avr/lib/ldscripts). Perhaps there is a way to set the attributes
> of default fuse sections, such that it won't get pulled in to the objcopy
> command to create the application hex file. 

I played around a bit, and found out it can be cleanly done. 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}

I'm not 100% sure everything I've done is 'kosher', as I haven't worked with 
GCC linker scripts before. At any rate it is a binutils change, which takes a 
while to get officially rolled into the project I take it?

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.

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?

Regards,

 -Colin




reply via email to

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