avr-libc-dev
[Top][All Lists]
Advanced

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

[avr-libc-dev] Re: Unified ELF file [was: RE: [avr-chat] Re: GUI wrapper


From: Erik Christiansen
Subject: [avr-libc-dev] Re: Unified ELF file [was: RE: [avr-chat] Re: GUI wrapper for avrdude]
Date: Thu, 30 Aug 2007 16:55:02 +1000
User-agent: Mutt/1.5.9i

On Thu, Aug 30, 2007 at 07:16:24AM +0200, Joerg Wunsch wrote:
> address@hidden (Erik Christiansen) wrote:
> 
> >    .global some_symbol_if_desired
> 
> >    .section .avrfuses,"a"
> > some_symbol_if_desired:
> >    .byte <fuse_value1>
> >    .byte <fuse_value2>
> >    .byte <fuse_value3>
> 
> Something like that, where we could probably also provide similar
> symbolic names and macros as we do in C.  The preprocessor knows the
> __ASSEMBLER__ symbol for assembly-language jobs.

Can't say I've used it. I just assemble with avr-as, and link with
avr-ld. Poor old avr-gcc doesn't need to figure in Eric's assembler-only
scenario. (Admittedly, using xxxx.S files and the preprocessor allows
use of the 'C' headers, as you've pointed out on occasion.)

Whatever assembler macro magic is needed, it should not be difficult.
:-)

> I'd like to get everything into a single section for all fuses (rather
> than three different sections), as that would make it easier to extend
> the scheme once a new AVR suddenly comes out that needs low, high,
> extended, and superiour fuse bytes ;-), but I don't have a
> proof-of-concept for that idea yet.  

Sounds good. We should then only need:

   .global lfuse, hfuse, efuse, lock, sig

   .section .allavrfuses,"a"
lfuse: .byte <fuse_value1>
hfuse: .byte <fuse_value2>
efuse: .byte <fuse_value3>

   .org <magic_address_2>   ; Relative to the start of the section.
lock:  .byte <lock_byte>

   .org <magic_address_3>   ; Relative to the start of the section.
sig:   .byte <sig_byte>

OK, we may want to prepend '_' to these symbols, for the traditional
and practical reason.

I'm not sure small attachments will make it to the list, but at least
you'll receive the small demo that this works as expected.

> If all else fails, we could still opt for differently named input
> section (lfuse, hfuse, efuse), and combine them in the linker script
> into one output section.  Again, that would be similar to combining
> .eeprom* input sections into just one .eeprom output section right
> now.

Actually, I think that's neater, not least because the magic addresses
are not seen in the assembler source, but reside only in the linker
script, where they belong. (A ". = 0x????" between input sections is all
that is needed to plonk'em where desired.)

Anyway, the attachments may amuse. (Please ignore RAMEND, I missed
stripping it out for the demo.)

Erik

P.S. Going up to the farm, to battle with >500 trees felled by storms,
some weeks back, so will be off-line for a week, but will try to snoop
the archive tomorrow night, before leaving. Can fix anything on return.

Attachment: fuse_demo.s
Description: Text document

Attachment: fuse_demo.ld
Description: Text document

Attachment: fuse_demo.map
Description: Text document

Attachment: fuse_demo.objdump
Description: Text document


reply via email to

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