[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-chat] Re: GUI wrapper for avrdude (fwd)
From: |
Michael Hennebry |
Subject: |
Re: [avr-chat] Re: GUI wrapper for avrdude (fwd) |
Date: |
Thu, 30 Aug 2007 07:32:58 -0500 (CDT) |
I suspect that the previous edition was quietly eaten by security.
---------- Forwarded message ----------
Date: Wed, 29 Aug 2007 16:55:00 -0500 (CDT)
From: Michael Hennebry <address@hidden>
To: address@hidden
Subject: RE: [avr-chat] Re: GUI wrapper for avrdude
On Tue, 28 Aug 2007, Eric Weddington wrote:
> > -----Original Message-----
> > From: address@hidden
> > [mailto:address@hidden
> > On Behalf Of Michael Hennebry
> > Sent: Tuesday, August 28, 2007 7:02 AM
> > To: Joerg Wunsch
> > Cc: address@hidden
> > Subject: Re: [avr-chat] Re: GUI wrapper for avrdude
> >
> > Even with hex files, there are alternatives to fixed offsets.
> > The bytes, if any, after the first record that
> > specifies zero bytes could go into eeprom.
> > Their addresses would be taken mod eeprom size.
> > The byte, if any, after the second record that
> > specifies zero bytes would go into lfuse.
>
> No.
>
> > We might also consider adding record type 8.
>
> No.
>
> The offsets are, at least, minimally intrusive, and fit somewhat within the
> standard Intel Hex file format. I will not change the basic Intel Hex File
> format.
We could also abuse record type 2.
I'm not sure what the measure of intrusivenes is.
We're both suggesting keeping the syntax and changing the semantics.
Tools would need revising in either case.
With a new record type, an unaware tool is more likely
to complain than to blindly do the wrong thing.
> I will note that Rick Altherr has given a set of patches on the avr-libc-dev
> list to implement setting fuses within an application.
>
> Patches to avrdude are welcome to read an ELF file, and to program flash,
> eeprom, and fuses from a single ELF file.
How do you feel about wrappers?
avrelfsuit:
# make an array new_args
# add most of "$@" to new_args
# expand if the file of a -U argument is an elf file
EEPROM_S=.eeprom
LFUSE_S=.lfuse
HFUSE_S=.hfuse
EFUSE_S=.efuse
FLASH_H=.flash.hex
EEPROM_H=.eeprom.hex
LFUSE_H=.lfuse.hex
HFUSE_H=.hfuse.hex
EFUSE_H=.efuse.hex
j=0
u=0
for arg_in in "$@" ; do
if [ $arg_in = -U ] ; then
u=1
elif [ $u -eq 1 ] ; then
# if the file is an elf file we edit
# otherwise, pass it through
subargs=( $(echo $arg_in | tr : ' ') )
if grep -q ELF ${subargs[2]} ; then
# elf
# figure out what we need
for mem in $(echo ${subargs[0]} | tr , ' ') ; do
case $mem in
(f | flash)
avr-objcopy -R $EEPROM_S -R $LFUSE_S -R $HFUSE_S \
-R $EFUSE_S -O ihex \
${subargs[2]} $FLASH_H
new_args[$((j++))]=-U
new_args[$((j++))]=${mem}:${subargs[1]}:$FLASH_H
;;
(e | eeprom)
avr-objcopy -j $EEPROM_S -O ihex \
--set-section-flags=${EEPROM_S}="alloc,load" \
--change-section-lma ${EEPROM_S}=0 \
${subargs[2]} $EEPROM_H
new_args[$((j++))]=-U
new_args[$((j++))]=${mem}:${subargs[1]}:$EEPROM_H
;;
(l | lf | lfuse | fuse)
avr-objcopy -j $LFUSE_S -O ihex \
--set-section-flags=${LFUSE_S}="alloc,load" \
--change-section-lma ${LFUSE_S}=0 \
${subargs[2]} $LFUSE_H
new_args[$((j++))]=-U
new_args[$((j++))]=${mem}:${subargs[1]}:$LFUSE_H
;;
(h | hf | hfuse)
avr-objcopy -j $HFUSE_S -O ihex \
--set-section-flags=${HFUSE_S}="alloc,load" \
--change-section-lma ${HFUSE_S}=0 \
${subargs[2]} $HFUSE_H
new_args[$((j++))]=-U
new_args[$((j++))]=${mem}:${subargs[1]}:$HFUSE_H
;;
(e | ef | efuse)
avr-objcopy -j $EFUSE_S -O ihex \
--set-section-flags=${EFUSE_S}="alloc,load" \
--change-section-lma ${EFUSE_S}=0 \
${subargs[2]} $EFUSE_H
new_args[$((j++))]=-U
new_args[$((j++))]=${mem}:${subargs[1]}:$EFUSE_H
;;
(*)
echo I don\'t understand memory type $mem
;;
esac
done
u=0
else
# not elf
new_args[$((j++))]=-U
new_args[$((j++))]=$arg_in
fi
else
new_args[$((j++))]=$arg_in
fi
done
avrdude "address@hidden"
--
Mike address@hidden
"Horse guts never lie." -- Cherek Bear-Shoulders
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [avr-chat] Re: GUI wrapper for avrdude (fwd),
Michael Hennebry <=