Hi all..
I've used lock.h and fuse.h for include fuse configuration in my c code.
Code:
#if defined A
FUSES = {
.low = 0xFF,
.high = (FUSE_SPIEN & FUSE_JTAGEN & FUSE_OCDEN),
.extended = 0xFF,};
LOCKBITS = (LB_MODE_1 & BLB0_MODE_1 & BLB1_MODE_1);
#elif defined B
FUSES = {
.low = 0xFF,
.high = (FUSE_SPIEN),
.extended = 0xFF,};
LOCKBITS = (LB_MODE_3 & BLB0_MODE_1 & BLB1_MODE_1);
#else
...
Ok. now I want to program all with avrdure. I use a terminal string like this
Code:
avrdude -patmega644p -cavrisp2 -Pusb -e -V -u -Uflash:w:file.elf -Ueeprom:w:file.elf -Uhfuse:w:file.elf -Ulfuse:w:file.elf -Uefuse:w:file.elf -Ulock:w:file.elf
No problem for flash, eeprom and lock area, but avrdude makes error when programming fuses.
The problem is that the area in the elf file is called only fuse, but avrdude wants hfuse, lfuse and efuse.
Code:
avrdude man pages
-U memtype:op:filename[:format]
Perform a memory operation as indicated. The memtype field
specifies the memory type to operate on. The available
memory types are device-dependent, the actual configuration
can be viewed with the part command in terminal mode. Typ‐
ically, a device’s memory configuration at least contains
the memory types flash and eeprom. All memory types cur‐
rently known are:
calibration One or more bytes of RC oscillator calibration
data.
eeprom The EEPROM of the device.
efuse The extended fuse byte.
flash The flash ROM of the device.
fuse The fuse byte in devices that have only a sin‐
gle fuse byte.
hfuse The high fuse byte.
lfuse The low fuse byte.
lock The lock byte.
signature The three device signature bytes (device ID).
There is a workaround for this?
Or the only solution is to make a script that extract the fuse area with
Code:
avr-objdump -d -S -j.fuse file.elf
file.elf: file format elf32-avr
Disassembly of section .fuse:
00820000 <__fuse>:
820000: ff 1f ff
and store single byte in variables and finally pass there to avrdude?
Thanks in advance. |