-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Upload to Uno WiFi Rev2 fails on fuse5 verification when using AVRDUDE 7.0 #119
Comments
I completely agree that changing FUSE5 (SYSCFG0) in the core is the right solution. Would you mind creating the PR too? Thanks! |
@facchinm I'm really struggling to understand this. AVRDUDE's recommended SYSCFG0 fuse value only changes reserved bit 2 from My understanding is that all the reserved fuse bits are intended to be changed to I am also having a lot of confusion from the datasheets. Microchip has been flipflopping on this subject from one revision to another: DS40002015A (02/2018)From section 5.8:
DS40002015B (03/2019)From section 5.8:
From section 31.1 (revision history)
DS40002015C (08/2019)From section 5.8:
DS40002173A (01/2020)From section 7.8:
DS40002173B (06/2020)From section 7.8:
DS40002173C (02/2021)From section section 7.8:
There is no mention of the change back to requiring |
@per1234 what a mess 🙂 |
Unfortunately I don't have any ATmega4809 other than on my Uno WiFi Rev2 and Nano Every boards and none of the component suppliers I checked have stock. Do you happen to have access to one @facchinm? |
Sure, I'll try to get some of them |
avrdude git main should have fixed the issue with pull request #1053 merged. |
@mcuee I just tried with an Arduino WiFi rev2 and #1053 does not seem to fix this problem.
I guess we have to wait to have some Nano Every "virgin edition" or am I missing something? |
Interesting that you still have issues. I am not so sure what you mean by Nano Every "virgin edition". I have the official Arduino Nano Every and I do not have issues with avrdude 7.0. Ref: please refer to my run log. So maybe "Arduino WiFi rev2" may have some different FW version. Edit: I see that you mean by unprogrammed blank ATmega4809, sorry I do not have that. |
In this case, maybe you want to create a new issue in avrdude. Thanks. |
I run some tests with the result
While this is with the old avrdude 6.3.0-arduino17, the version we are currently using in the latest version of the avr core. result
With avrdude 7.0-arduino.3: result
At this point I think the problem is specific to the Uno WiFi Rev2. Yes, it has the same atmega 4809 but uses a different programmer ( |
I think you mean to say "Arduino Nano Every".
Good to narrow down to Uno WiFi Rev2 using xplainedmini_udpi. In that case, maybe you can raise an issue with avrdude. Unfortunately other than Uno WiFi Rev 2, I am not so sure if there are any other boards using xplainedmini_udpi with ATmega4809 or similar chips for others to reproduce the issue. There are two boards from Microchip using ATmega4809, the ATmega4809 Curiosity Nano and ATmega4809 Xplained Pro. But they are using adifferent programmers. |
This issue has been fixed in the latest Avrdude 7.2 release. @umbynos has yet to release a statically built version at arduino/avrdude-packaging.
|
That is amazing news! I will try to release 7.2 static as fast as possible |
Excellent! The reason for all this is that the on-board mEDBG programmer on the UNO Wifi Rev2 has "fuse protection", enabled through the SUFFER register, which prevents the user from "bricking" their board when playing around with the fuse bit settings (probably intended for Xplained Nano/Mini users). Previously you'd need a special Python tool to read and change the current value, but Avrdude 7.1 and 7.2 support reading and writing to this register (it was a fun evening project 😄). Use I believe the UNO Wifi Rev2 SUFFER register value is 0x7F, but I've changed mine to 0x7E to play with the fuses without any constraints. Here's what the bits represent (from Avrdude's jtag3.c file):
|
Released 7.2! arduino/avrdude-packing#28 |
Describe the problem
The handling of unused configuration fuse bits changed in version 6.2 of the AVRDUDE tool used for uploading to the boards of this platform:
http://savannah.nongnu.org/bugs/?46759
This change caused verification of fuses to fail when using AVRDUDE commands and configurations that were valid for previous versions of the tool:
As a workaround, a patch was made to Arduino's build of AVRDUDE which produced a warning instead of an error under these conditions:
https://github.com/arduino/avrdude-build-script/blob/master/avrdude-6.3-patches/80-Avoid-failing-fuse-check-if-different-bits-are-reserved.patch
When uploading to the Uno WiFi Rev2, the patch resulted in this warning:
The patch was also submitted upstream:
https://savannah.nongnu.org/patch/index.php?9110
That patch was accepted and is now part of the AVRDUDE 7.0 release. For this reason, Arduino's patch was removed from the Arduino build of AVRDUDE 7.0:
https://github.com/arduino/avrdude-packing/tree/7.0-arduino.3/patches
🐛 The upload fails during the
fuse5
verification when uploading to the Uno WiFi Rev2 using AVRDUDE 7.0-arduino.3.To reproduce
Equipment
Steps
https://github.com/arduino/avrdude-packing/releases/tag/7.0-arduino.3
~/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude
%LOCALAPPDATA%\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17\bin/avrdude.exe
~/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude
🐛 The upload fails:
Expected behavior
Upload is successful.
Additional context
This could of course be worked around by modifying Arduino's build of AVRDUDE as before, but the current goal is to maintain the fewest possible number of patches necessary for AVRDUDE to meet Arduino's requirements. So I think the best place to start the investigation is by considering whether the issue can be solved by adjusting the fuse values specified in the boards definitions of this platform:
This would have the additional benefit of removing the warning which frequently causes concern or acts as a "red herring" for new users of the Uno WiFi Rev2 (e.g., #71, #121, arduino/Arduino#9443, forum#954001)
The text was updated successfully, but these errors were encountered: