aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoritz Fischer <moritz.fischer@ettus.com>2015-07-21 17:32:12 -0700
committerMoritz Fischer <moritz.fischer@ettus.com>2015-07-21 17:33:12 -0700
commit691c4305620c0ff615150c1073120c6250497718 (patch)
tree48e2fd47bfbf53b51e5c7e0b406585c837964d0a
parente889d685b4d8b94c2534f258a04b9725dc776695 (diff)
downloaduhd-691c4305620c0ff615150c1073120c6250497718.tar.gz
uhd-691c4305620c0ff615150c1073120c6250497718.tar.bz2
uhd-691c4305620c0ff615150c1073120c6250497718.zip
e3xx: Fix firmware to actually write fuse values.
The fuses weren't written correctly before, as we were lacking parameters to avrdude. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
-rw-r--r--firmware/e300/battery/Makefile8
-rw-r--r--firmware/e300/battery/main.c1
2 files changed, 7 insertions, 2 deletions
diff --git a/firmware/e300/battery/Makefile b/firmware/e300/battery/Makefile
index c2d530e36..1ce0bf279 100644
--- a/firmware/e300/battery/Makefile
+++ b/firmware/e300/battery/Makefile
@@ -39,17 +39,18 @@ MMCU = attiny88
PROGRAMMER = jtag3isp
PORT = usb
AVRDUDE = avrdude -p $(MMCU) -c $(PROGRAMMER) -P $(PORT) -V
+FUSES = -U hfuse:w:hfuse.hex:i -U lfuse:w:lfuse.hex:i -U efuse:w:efuse.hex:i -u
##################################################
# Global Targets
##################################################
-all: $(TARGET).hex size
+all: $(TARGET).hex size hfuse.hex lfuse.hex efuse.hex
clean:
$(RM) *.o *.elf *.hex
install: all
- $(AVRDUDE) -U flash:w:$(TARGET).hex:i
+ $(AVRDUDE) -U flash:w:$(TARGET).hex:i $(FUSES)
size: $(TARGET).hex
@$(SIZE) --format=SysV --mcu=$(MMCU) $(TARGET).elf
@@ -67,6 +68,9 @@ lfuse.hex: fuses.hex
hfuse.hex: fuses.hex
$(SREC) $< -Intel -crop 0x01 0x02 -offset -0x01 -O $@ -Intel
+efuse.hex: fuses.hex
+ $(SREC) $< -Intel -crop 0x02 0x03 -offset -0x02 -O $@ -Intel
+
$(TARGET).hex: $(TARGET).elf
$(OBJCOPY) -R .eeprom -R .fuse -O ihex $< $@
diff --git a/firmware/e300/battery/main.c b/firmware/e300/battery/main.c
index eec9e8293..723816924 100644
--- a/firmware/e300/battery/main.c
+++ b/firmware/e300/battery/main.c
@@ -35,6 +35,7 @@
FUSES = {
.low = (FUSE_CKSEL0 & FUSE_SUT0),
.high = (FUSE_EESAVE & FUSE_SPIEN),
+ .extended = EFUSE_DEFAULT,
};