-
-
Notifications
You must be signed in to change notification settings - Fork 7k
"Burn Bootloader" with Uno fails: "verification error ... 0xfd != 0x05" #5175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
IIRC there is a avrude bug report about his. I ran into this as well using a JTAGICE3 ISP programmer. The problem, I think, is that some programmers return 1 for unused bits, and some return 0. This makes it impossible to fix in Arduino, but it was also tricky to fix in avrdude (the info about what pins are unused was not explicitly available in the right places IIRC). The bug report is here: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#libraryproperties-file-format That suggests the bug is already fixed a while ago, or perhaps only a part of the problem. It seems you're already using the latest Arduino IDE version, which includes the latest avrdude 6.3 as well. What programmer are you using? |
Looking at the avrdude commit, it might be that all programmers are now unified in how they handle things, but perhaps it uses 1s instead of 0s for unused bits on all programmers now? If so, than this indeed needs to be fixed in boards.txt. |
Yes, apparently they have decided that unused bits would not be ignored (replaced by 0s) anymore, but use their actual value of 1 (unprogrammed). It makes more sense like that in my opinion. Are you sure about the difference between programmers? It seems strange that a programmer would return 0s for unused bits, since the micro will, i think, always return 1s. This would mean that some programmers modify the values and replace the unused by 0 internally... |
I can confirm that the same issue occurs with USBtinyISP and Arduino as ISP burning bootloader to Arduino AVR Boards 1.6.12's Uno and other ATmega328P boards . After changing the extended_fuses value to 0xFD the issue is resolved. I encountered a different, possibly unrelated, issue attempting to Burn Bootloader to any board with Atmel AVRISP mkII:
Atmel AVRISP mkII works as expected with Arduino AVR Boards 1.6.11. |
@per1234 This issue with AVRISP mkII looks more like a avrdude bug, probably related to the programmer specific problem @matthijskooijman was talking about. One possible fix/workaround would be that avrdude apply the same change on the lock fuse byte than on the extended fuse byte. It would also be more consistent imho. |
After changing the lock_bits and unlock_bits values in boards.txt the same extended fuse issue occurs with Atmel AVRISP mkII and is solved by changing the extended_fuses value to 0xFD. I'm happy to look into the AVRISP mkII lock and unlock bits issue more on request but from what descampsa said it sounds like it's off topic for this issue report. |
Good to know it works The problem is, there is no way to fix it for all programmers in arduino only, avrdude.conf has to be changed. Making the change to the (un)lock_bits only would fix it for mkII, but break (at least) usbasp, USBtinyISP and ArduinoISP compatibility. A patch has already been proposed for avrdude: see http://savannah.nongnu.org/bugs/?46759 and https://savannah.nongnu.org/patch/index.php?8996 . |
I've successfully tested that patch and reported the issue and my results at arduino/avrdude-build-script#2. |
I just compared the avrdude versions hipped with 1.6.9 and 1.6.10 with the STK500 and JTAGICE3 programmers I have lying around. As I remembered, they return different values for the unused bits (note the differences in the high fuse).
However, with avrdude 6.3, both programmers return "1" for unused bits:
This suggests that indeed the unused bits are now consistent among multiple programmers (though testing on more programmers would be good), however they are inverted as to what boards.txt now lists. I'm mostly confirming what is already stated, though. This bugreport suggests that there might still be a problem (introduced in 6.2) with the lock bits. I'm not sure if this is already fixed in 6.3, and I didn't dig in the code to see. Testing is probably a good idea (if burn bootloader works, then I think it's ok). |
Yes, apparently this issue has not yet been fixed (but a patch has been proposed), @per1234 has run into this problem when testing with AVRISP mkII programmer. He describes the issue and the solution we have found at arduino/avrdude-build-script#2. |
Updated a few days ago and tonight just spent 6 hours trying to figure out why I could no longer burn bootloaders. Seems this was the issue :( |
I couldn't burn a bootloader anymore, so I updated the arduino ide from 1.6.9 to 1.6.10 and the issue was still there. (memory efuse of ATmega328 section)
Edit: "x" means the bit is ignored: [http://www.nongnu.org/avrdude/user-manual/avrdude_13.html#Instruction-Format] |
Fixed with #5374 |
When trying to upload the bootloader to my Arduino Uno board, avrdude fails (see attached log).
The reason seems to be that the extended fuse byte is not read correctly, because avrdude now read the unused bits as 1, which gives 0XFD instead of 0X05. The related commit in avrdude is described here : http://svn.savannah.nongnu.org/viewvc?view=rev&root=avrdude&revision=1335
The problem can be fixed by changing the
uno.bootloader.extended_fuses
value to0xFD
inboards.txt
, or by reverting theavrdude.conf
to its previous behaviour of ignoring the unused bits. I am not sure which one is better.In both cases, other boards/microcontroller models might need to be fixed as well.
Version tested: 1.6.10 Hourly Build 2016/07/26 03:25
The text was updated successfully, but these errors were encountered: