Skip to content
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

Set unused bits of extended fuse to 1 #5182

Merged
merged 2 commits into from
Mar 7, 2017

Conversation

descampsa
Copy link
Contributor

@descampsa descampsa commented Jul 29, 2016

Avrdude has changed the way it handle unused bits in the extended fuse for atmega 328 and atmega 168, they are now at 1 instead of 0.
See http://svn.savannah.nongnu.org/viewvc?view=rev&root=avrdude&revision=1335 for more info.
This causes avrdude to fail when one try to write the fuse with the unused bits at 0, because the value it read back is not the same than the one it tried to write. This commit fixes the fuse value for all boards that use atmega328 or 168.

See also issue #5175

I only tested that fix with a usbasp programmer on arduino uno, it would probably be good that someone test it with other programmer/board (especially one atmega168) to be sure.

Update: According to the discussion in #5175 , the patch indeed fix the problem for Atmega328 with usbasp, USBtinyISP and ArduinoISP.
A separate but related issue appears with AVRISP mkII programmer, but this issue can't be easily fixed in Arduino code alone, avrdude.conf has to be changed.

Avrdude has changed the way it handle unused bits in the extended fuse for atmega 328 and atmega 168, they are now at 1 instead of 0.
See http://svn.savannah.nongnu.org/viewvc?view=rev&root=avrdude&revision=1335 for more info.
This causes avrdude to fail when one try to write the fuse with the unused bits at 0, because the value it read back is not the same than the one it tried to write. This commit fixes the fuse value for all boards that use atmega328 or 168.
@per1234
Copy link
Collaborator

per1234 commented Jul 31, 2016

Just a clarification, I tested with Tools > Programmer > Arduino as ISP, which is an Arduino running the ArduinoISP sketch. I didn't test with Tools > Programmer > ArduinoISP because I don't own that programmer.

@per1234
Copy link
Collaborator

per1234 commented Jul 31, 2016

Forgot to fix ethernet board in previous commit
@descampsa
Copy link
Contributor Author

Yes, thanks, it's fixed.

@per1234
Copy link
Collaborator

per1234 commented Aug 1, 2016

I successfully tested Burn Bootloader on all ATmega168 based boards in this boards.txt using USBasp, Arduino as ISP, USBtinyISP, and Atmel AVRISP mkII(with arduino/avrdude-build-script#2 applied).

@matthijskooijman
Copy link
Collaborator

This looks like a good change to me. I think it would be good if a second person would verify the new settings against the datasheet, to prevent accidental changes. And of course testing, I think @facchinm was planning to do some testing as well.

@descampsa
Copy link
Contributor Author

@facchinm

Should'nt this patch be included in #5374?
It is not strictly essential, but currently the avrdude warning is printed at upload.
Seems kind of strange to not fix our own warnings ;-)

@facchinm
Copy link
Member

facchinm commented Sep 21, 2016

@descampsa
we simply can't update the core this way because it would break backwards compatibility (in fact, this modification only works with avrdude 6.3). Updating the AVR core standalone (without the tools) on older installations is possible and would be much more difficult to solve (without patching avrdude 6.0.1).

But sooner or later we'll surely merge it 😄

@matthijskooijman
Copy link
Collaborator

@facchinm, huh? but a core / platform specifies what versions of the tool it needs in the JSON? Or did I misunderstand something here?

@facchinm
Copy link
Member

Yes, but only in the json, so fetching the core manually will leverage on installed tools (or latest tools if the IDE is > 1.6.10 but this is a corner case)

@matthijskooijman
Copy link
Collaborator

You mean when someone manually copies the arduino/avr directory out of git? That doesn't sound like a usecase we need to support?

@facchinm
Copy link
Member

There were a couple of other cases which I can't remember right now, but I'm not saying we shouldn't merge this patch,I would only give give people some time to update their tools 😄

@cmaglie cmaglie removed this from the Release 1.6.13 milestone Jan 19, 2017
@facchinm facchinm added this to the Release 1.8.2 milestone Feb 8, 2017
@cmaglie cmaglie merged commit a700af1 into arduino:master Mar 7, 2017
@cmaglie cmaglie removed the On Hold The pull request is blocked from being merged label Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Avrdude 6.3 Specific to AVRDUDE version 6.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants