Bug#824815: Bootloader burning verification error

2016-12-08 Thread Milan Kupcevic

The attached patch reflects the mask change avrdude uses when reading
efuse and lock values. I'm getting ready to NMU arduino to fix this
issue for stretch.

Milan
Description: avrdude fuse read mask change
Author: Milan Kupcevic 
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=824815
Forwarded: not-needed
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/hardware/arduino/boards.txt
+++ b/hardware/arduino/boards.txt
@@ -8,11 +8,11 @@
 uno.upload.speed=115200
 uno.bootloader.low_fuses=0xff
 uno.bootloader.high_fuses=0xde
-uno.bootloader.extended_fuses=0x05
+uno.bootloader.extended_fuses=0xfd
 uno.bootloader.path=optiboot
 uno.bootloader.file=optiboot_atmega328.hex
-uno.bootloader.unlock_bits=0x3F
-uno.bootloader.lock_bits=0x0F
+uno.bootloader.unlock_bits=0xff
+uno.bootloader.lock_bits=0xcf
 uno.build.mcu=atmega328p
 uno.build.f_cpu=1600L
 uno.build.core=arduino
@@ -28,11 +28,11 @@
 
 atmega328.bootloader.low_fuses=0xFF
 atmega328.bootloader.high_fuses=0xDA
-atmega328.bootloader.extended_fuses=0x05
+atmega328.bootloader.extended_fuses=0xfd
 atmega328.bootloader.path=atmega
 atmega328.bootloader.file=ATmegaBOOT_168_atmega328.hex
-atmega328.bootloader.unlock_bits=0x3F
-atmega328.bootloader.lock_bits=0x0F
+atmega328.bootloader.unlock_bits=0xff
+atmega328.bootloader.lock_bits=0xcf
 
 atmega328.build.mcu=atmega328p
 atmega328.build.f_cpu=1600L
@@ -49,11 +49,11 @@
 
 diecimila.bootloader.low_fuses=0xff
 diecimila.bootloader.high_fuses=0xdd
-diecimila.bootloader.extended_fuses=0x00
+diecimila.bootloader.extended_fuses=0xf8
 diecimila.bootloader.path=atmega
 diecimila.bootloader.file=ATmegaBOOT_168_diecimila.hex
-diecimila.bootloader.unlock_bits=0x3F
-diecimila.bootloader.lock_bits=0x0F
+diecimila.bootloader.unlock_bits=0xff
+diecimila.bootloader.lock_bits=0xcf
 
 diecimila.build.mcu=atmega168
 diecimila.build.f_cpu=1600L
@@ -70,11 +70,11 @@
 
 nano328.bootloader.low_fuses=0xFF
 nano328.bootloader.high_fuses=0xDA
-nano328.bootloader.extended_fuses=0x05
+nano328.bootloader.extended_fuses=0xfd
 nano328.bootloader.path=atmega
 nano328.bootloader.file=ATmegaBOOT_168_atmega328.hex
-nano328.bootloader.unlock_bits=0x3F
-nano328.bootloader.lock_bits=0x0F
+nano328.bootloader.unlock_bits=0xff
+nano328.bootloader.lock_bits=0xcf
 
 nano328.build.mcu=atmega328p
 nano328.build.f_cpu=1600L
@@ -91,11 +91,11 @@
 
 nano.bootloader.low_fuses=0xff
 nano.bootloader.high_fuses=0xdd
-nano.bootloader.extended_fuses=0x00
+nano.bootloader.extended_fuses=0xf8
 nano.bootloader.path=atmega
 nano.bootloader.file=ATmegaBOOT_168_diecimila.hex
-nano.bootloader.unlock_bits=0x3F
-nano.bootloader.lock_bits=0x0F
+nano.bootloader.unlock_bits=0xff
+nano.bootloader.lock_bits=0xcf
 
 nano.build.mcu=atmega168
 nano.build.f_cpu=1600L
@@ -115,8 +115,8 @@
 mega2560.bootloader.extended_fuses=0xFD
 mega2560.bootloader.path=stk500v2
 mega2560.bootloader.file=stk500boot_v2_mega2560.hex
-mega2560.bootloader.unlock_bits=0x3F
-mega2560.bootloader.lock_bits=0x0F
+mega2560.bootloader.unlock_bits=0xff
+mega2560.bootloader.lock_bits=0xcf
 
 mega2560.build.mcu=atmega2560
 mega2560.build.f_cpu=1600L
@@ -136,8 +136,8 @@
 mega.bootloader.extended_fuses=0xF5
 mega.bootloader.path=atmega
 mega.bootloader.file=ATmegaBOOT_168_atmega1280.hex
-mega.bootloader.unlock_bits=0x3F
-mega.bootloader.lock_bits=0x0F
+mega.bootloader.unlock_bits=0xff
+mega.bootloader.lock_bits=0xcf
 
 mega.build.mcu=atmega1280
 mega.build.f_cpu=1600L
@@ -156,8 +156,8 @@
 leonardo.bootloader.extended_fuses=0xcb
 leonardo.bootloader.path=caterina
 leonardo.bootloader.file=Caterina-Leonardo.hex
-leonardo.bootloader.unlock_bits=0x3F
-leonardo.bootloader.lock_bits=0x2F
+leonardo.bootloader.unlock_bits=0xff
+leonardo.bootloader.lock_bits=0xef
 leonardo.build.mcu=atmega32u4
 leonardo.build.f_cpu=1600L
 leonardo.build.vid=0x2341
@@ -177,8 +177,8 @@
 esplora.bootloader.extended_fuses=0xcb
 esplora.bootloader.path=caterina
 esplora.bootloader.file=Caterina-Esplora.hex
-esplora.bootloader.unlock_bits=0x3F
-esplora.bootloader.lock_bits=0x2F
+esplora.bootloader.unlock_bits=0xff
+esplora.bootloader.lock_bits=0xef
 esplora.build.mcu=atmega32u4
 esplora.build.f_cpu=1600L
 esplora.build.vid=0x2341
@@ -198,8 +198,8 @@
 micro.bootloader.extended_fuses=0xcb
 micro.bootloader.path=caterina
 micro.bootloader.file=Caterina-Micro.hex
-micro.bootloader.unlock_bits=0x3F
-micro.bootloader.lock_bits=0x2F
+micro.bootloader.unlock_bits=0xff
+micro.bootloader.lock_bits=0xef
 micro.build.mcu=atmega32u4
 micro.build.f_cpu=1600L
 micro.build.vid=0x2341
@@ -217,11 +217,11 @@
 
 mini328.bootloader.low_fuses=0xff
 mini328.bootloader.high_fuses=0xd8
-mini328.bootloader.extended_fuses=0x05
+mini328.bootloader.extended_fuses=0xfd
 mini328.bootloader.path=optiboot
 mini328.bootloader.file=optiboot_atmega328-Mini.hex
-mini328.bootloader.unlock_bits=0x3F
-mini328.bootloader.lock_bits=0x0F
+mini328.bootloader.unlock_bits=0xff

Bug#824815: Bootloader burning verification error

2016-05-19 Thread Milan Kupcevic
Package: arduino
Version: 2:1.0.5+dfsg2-4
Severity: important
Control: tags -1 patch


Since avrdude version 6.2 efuse bitmask has been changed for ATmega168
and ATmega328, arduino has not been able to burn bootloaders to the
boards with the mentioned microcontrollers.

Please update arduino efuse values accordingly.

A patch with necessary updates is attached.

Milan
diff --git a/hardware/arduino/boards.txt b/hardware/arduino/boards.txt
index de9f4ef..0769116 100644
--- a/hardware/arduino/boards.txt
+++ b/hardware/arduino/boards.txt
@@ -8,7 +8,7 @@ uno.upload.maximum_size=32256
 uno.upload.speed=115200
 uno.bootloader.low_fuses=0xff
 uno.bootloader.high_fuses=0xde
-uno.bootloader.extended_fuses=0x05
+uno.bootloader.extended_fuses=0xfd
 uno.bootloader.path=optiboot
 uno.bootloader.file=optiboot_atmega328.hex
 uno.bootloader.unlock_bits=0x3F
@@ -28,7 +28,7 @@ atmega328.upload.speed=57600
 
 atmega328.bootloader.low_fuses=0xFF
 atmega328.bootloader.high_fuses=0xDA
-atmega328.bootloader.extended_fuses=0x05
+atmega328.bootloader.extended_fuses=0xfd
 atmega328.bootloader.path=atmega
 atmega328.bootloader.file=ATmegaBOOT_168_atmega328.hex
 atmega328.bootloader.unlock_bits=0x3F
@@ -49,7 +49,7 @@ diecimila.upload.speed=19200
 
 diecimila.bootloader.low_fuses=0xff
 diecimila.bootloader.high_fuses=0xdd
-diecimila.bootloader.extended_fuses=0x00
+diecimila.bootloader.extended_fuses=0xf8
 diecimila.bootloader.path=atmega
 diecimila.bootloader.file=ATmegaBOOT_168_diecimila.hex
 diecimila.bootloader.unlock_bits=0x3F
@@ -70,7 +70,7 @@ nano328.upload.speed=57600
 
 nano328.bootloader.low_fuses=0xFF
 nano328.bootloader.high_fuses=0xDA
-nano328.bootloader.extended_fuses=0x05
+nano328.bootloader.extended_fuses=0xfd
 nano328.bootloader.path=atmega
 nano328.bootloader.file=ATmegaBOOT_168_atmega328.hex
 nano328.bootloader.unlock_bits=0x3F
@@ -91,7 +91,7 @@ nano.upload.speed=19200
 
 nano.bootloader.low_fuses=0xff
 nano.bootloader.high_fuses=0xdd
-nano.bootloader.extended_fuses=0x00
+nano.bootloader.extended_fuses=0xf8
 nano.bootloader.path=atmega
 nano.bootloader.file=ATmegaBOOT_168_diecimila.hex
 nano.bootloader.unlock_bits=0x3F
@@ -217,7 +217,7 @@ mini328.upload.speed=115200
 
 mini328.bootloader.low_fuses=0xff
 mini328.bootloader.high_fuses=0xd8
-mini328.bootloader.extended_fuses=0x05
+mini328.bootloader.extended_fuses=0xfd
 mini328.bootloader.path=optiboot
 mini328.bootloader.file=optiboot_atmega328-Mini.hex
 mini328.bootloader.unlock_bits=0x3F
@@ -238,7 +238,7 @@ mini.upload.speed=19200
 
 mini.bootloader.low_fuses=0xff
 mini.bootloader.high_fuses=0xdd
-mini.bootloader.extended_fuses=0x00
+mini.bootloader.extended_fuses=0xf8
 mini.bootloader.path=atmega
 mini.bootloader.file=ATmegaBOOT_168_ng.hex
 mini.bootloader.unlock_bits=0x3F
@@ -259,7 +259,7 @@ ethernet.upload.speed=115200
 
 ethernet.bootloader.low_fuses=0xff
 ethernet.bootloader.high_fuses=0xde
-ethernet.bootloader.extended_fuses=0x05
+ethernet.bootloader.extended_fuses=0xfd
 ethernet.bootloader.path=optiboot
 ethernet.bootloader.file=optiboot_atmega328.hex
 ethernet.bootloader.unlock_bits=0x3F
@@ -280,7 +280,7 @@ fio.upload.speed=57600
 
 fio.bootloader.low_fuses=0xFF
 fio.bootloader.high_fuses=0xDA
-fio.bootloader.extended_fuses=0x05
+fio.bootloader.extended_fuses=0xfd
 fio.bootloader.path=arduino:atmega
 fio.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
 fio.bootloader.unlock_bits=0x3F
@@ -302,7 +302,7 @@ bt328.upload.disable_flushing=true
 
 bt328.bootloader.low_fuses=0xff
 bt328.bootloader.high_fuses=0xd8
-bt328.bootloader.extended_fuses=0x05
+bt328.bootloader.extended_fuses=0xfd
 bt328.bootloader.path=bt
 bt328.bootloader.file=ATmegaBOOT_168_atmega328_bt.hex
 bt328.bootloader.unlock_bits=0x3F
@@ -324,7 +324,7 @@ bt.upload.disable_flushing=true
 
 bt.bootloader.low_fuses=0xff
 bt.bootloader.high_fuses=0xdd
-bt.bootloader.extended_fuses=0x00
+bt.bootloader.extended_fuses=0xf8
 bt.bootloader.path=bt
 bt.bootloader.file=ATmegaBOOT_168.hex
 bt.bootloader.unlock_bits=0x3F
@@ -366,7 +366,7 @@ lilypad328.upload.speed=57600
 
 lilypad328.bootloader.low_fuses=0xFF
 lilypad328.bootloader.high_fuses=0xDA
-lilypad328.bootloader.extended_fuses=0x05
+lilypad328.bootloader.extended_fuses=0xfd
 lilypad328.bootloader.path=atmega
 lilypad328.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
 lilypad328.bootloader.unlock_bits=0x3F
@@ -387,7 +387,7 @@ lilypad.upload.speed=19200
 
 lilypad.bootloader.low_fuses=0xe2
 lilypad.bootloader.high_fuses=0xdd
-lilypad.bootloader.extended_fuses=0x00
+lilypad.bootloader.extended_fuses=0xf8
 lilypad.bootloader.path=lilypad
 lilypad.bootloader.file=LilyPadBOOT_168.hex
 lilypad.bootloader.unlock_bits=0x3F
@@ -408,7 +408,7 @@ pro5v328.upload.speed=57600
 
 pro5v328.bootloader.low_fuses=0xFF
 pro5v328.bootloader.high_fuses=0xDA
-pro5v328.bootloader.extended_fuses=0x05
+pro5v328.bootloader.extended_fuses=0xfd
 pro5v328.bootloader.path=atmega
 pro5v328.bootloader.file=ATmegaBOOT_168_atmega328.hex
 pro5v328.bootloader.unlock_bits=0x3F
@@