I'm trying to store the fuse byte for ATtiny20 in my .elf file to be used for production programming. Currently, I'm using Atmel Studio 7 for the production GUI but am open to other options.
I'm running into a couple issues:
First, the avr/io.h file for the ATtiny20 (iotn20.h) defines the fuse memory size as 0:
#define FUSE_MEMORY_SIZE 0
and therefore the standard method of defining FUSES after including <avr/fuse.h> do not work.
So, is this a bug in avr-libc?
Second, trying to declare and define my own __fuse value, I'm not getting the production programmer tool in Atmel Studio 7 to recognize the fuse section in the elf. If I load up the elf file, it un-disables the "Flash" checkbox but not the "Fuses" checkbox. This tells me Atmel Studio is not properly detecting the .fuse section. However, according to avr-objdump, it seems to be there.
#include <avr/io.h> #include <avr/fuse.h> unsigned char __fuse FUSEMEM = 0xDF;
> avr-objdump -s -j .fuse out/production.elf out/production.elf: file format elf32-avr Contents of section .fuse: 800042 df .
Of note, I'm using my own build scripts on Windows 10.
Any idea how Atmel Studio parses .elf files for Fuses section?