-
Notifications
You must be signed in to change notification settings - Fork 252
Set default value for upload.verify #8
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
Conversation
Arduino IDE 1.6.9 and newer allow the -V option to be added to the AVRDUDE command if File > Preferences > Verify code after upload is unchecked. In previous versions of the IDE this option had no effect, going back for some time. As with many changes made to the IDE, this broke backwards compatibility, though in this case there was delay. Arduino AVR Boards 1.6.11 added the {upload.verify} property to the tools.avrdude.upload recipe to support the File > Preferences > Verify code after upload setting. In Arduino IDE versions 1.6.8 and previous this property is set to true or false depending on the preferences setting which causes Upload with Arduino IDE 1.6.8 to generate AVRDUDE commands like: avrdude -CE:\Stuff\misc\electronics\arduino\hardware\MiniCore\avr/avrdude.conf -v true -patmega328p -carduino -PCOM21 -b115200 -D -Uflash:w:C:\Users\per\AppData\Local\Temp\buildb7baad927be9bdd89a5f10c3d4ed06ef.tmp/sketch_sep28a.ino.hex:i AVRDUDE 6.0.1 is able to ignore the spurious true/false item in the command and successfully upload but when used with AVRDUDE 6.3.0 this causes upload to fail: avrdude: no programmer has been specified on the command line or the config file Specify a programmer using the -c option and try again This issue will occur if MiniCore is used with with Arduino IDE 1.6.8 and previous and Arduino AVR Boards 1.6.12 or 1.6.14. Setting a default empty value for the upload.verify property in platform.txt causes Arduino IDE 1.6.8 and older to generate an AVRDUDE command identical to that generated with Arduino AVR Boards 1.6.10 or older(meaning that, as previously, the preferences setting has no effect): avrdude -CE:\Stuff\misc\electronics\arduino\hardware\MiniCore\avr/avrdude.conf -v -patmega328p -carduino -PCOM21 -b115200 -D -Uflash:w:C:\Users\per\AppData\Local\Temp\buildb7baad927be9bdd89a5f10c3d4ed06ef.tmp/sketch_sep28a.ino.hex:i Arduino IDE 1.6.9 and newer overrides the default value of upload.verify, therefore this change has no effect on the AVRDUDE command generated and verification is controlled by the preferences setting as usual.
Wow! I didn't know this! Great work, thank you a lot 👍 Is this something that should be implemented to the other cores as well? |
MiniCore was a bit of an exception because it's the only one of your cores that currently supports the verification preference. MightyCore's platform.txt doesn't have the verify support in the upload or program recipes so this issue won't occur in that core unless Upload Using Programmer is done with one of the Arduino AVR Boards programmers which I don't know of a fix for other than using the MightyCore programmers. So the change on that core would be to add support for the verification preference in a backwards safe manner. I think this would be a nice feature, especially since the ATmega1284P may have large programs uploaded where the extra verification step could take a bit of time. MegaCore is the same situation as MightyCore because it doesn't currently support the verification preference however, MegaCore doesn't include its own programmers so there's no way for the user to avoid the issue with Upload Using Programmer with and Arduino AVR Boards programmer. I just took a look at my pull request on the Arduino IDE repository and there are some promising signs that the developers understand the issue and are at least going to seriously consider merging it. Again, I think adding verification preference support to MegaCore would be a useful thing to do and should be possible to do without any harmful side effects if the default MicroCore's platform.txt also doesn't currently support the verification preference. The issue will only occur with Upload Using programmer with an Arduino AVR Boards programmer. The problem will not occur with the (slow) programmer options. As with the others, adding support for the verification preference could be a nice feature though I'm not sure the amount of time to verify 1kB max is really significant. If you want I'm happy to submit pull requests to those repositories adding verification preference support in a backwards compatible manner. Even though we can't fix it completely, it's good that you are now aware of the cause of the
issue so that if a user reports this on one of your cores you will already know the cause and the solution(updating the Arduino IDE to 1.6.9 or newer, reverting Arduino AVR Boards to 1.6.10 or older, or hopefully updating Arduino AVR Boards to 1.6.15 or newer if my pull request is merged before the release). |
It would be great to add verification preference support to the other cores as well! I've actually never thought of this issue, but more features/less errors is always great 👍 |
9108614 Fix issue with PWM on pin D2 with 328PB This kinda ugly fix is necessary to get PWM working properly when using timer3b or timer4b on ATmega328PB. It's strange, but the PWM functionality gets disabled when PORTD bit 2 is set to zero 2245d4c Merge branch 'master' of https://github.com/MCUdude/MCUdude_corefiles 47ce3a3 Add support for the new *PB variants 903e61b Merge pull request #9 from per1234/test-mightycore 9df002b Update MightyCore core folder name 75464f9 Fix typos in .travis.yml comments a4026bc Update README.md 090c9de Merge pull request #8 from per1234/test-minicore 6c244c7 Merge pull request #7 from per1234/fix-travis ea9f095 Test against MiniCore 57a3c9a Update MajorCore core folder name in .travis.yml git-subtree-dir: avr/cores/MCUdude_corefiles git-subtree-split: 91086148c25fc02bc148374ed180ead001b2d9d7
The purpose of this pull request is to provide Upload compatibility with Arduino IDE 1.6.8 or older and Arduino AVR Boards 1.6.12 or 1.6.14.
Steps to reproduce the issue solved by this pull request:
Arduino IDE 1.6.9 and newer allow the -V option to be added to the AVRDUDE command if File > Preferences Verify code after upload is unchecked. In previous versions of the IDE this option had no effect, going back for some time. As with many changes made to the IDE, this broke backwards compatibility, though in this case there was some delay.
Arduino AVR Boards 1.6.11 added the
{upload.verify}
property to thetools.avrdude.upload
recipe to support the File > Preferences > Verify code after upload setting. In Arduino IDE versions 1.6.8 and previous this property is set to true or false depending on the preferences setting which causes Upload with Arduino IDE 1.6.8 to generate AVRDUDE commands like:AVRDUDE 6.0.1 is able to ignore the spurious true/false item in the command and successfully upload but when used with AVRDUDE 6.3.0 this causes upload to fail:
This issue will occur if MiniCore is used with with Arduino IDE 1.6.8 or older and Arduino AVR Boards 1.6.12 or 1.6.14.
Setting a default empty value for the
upload.verify
property in platform.txt causes Arduino IDE 1.6.8 and older to generate an AVRDUDE command identical to that generated with Arduino AVR Boards 1.6.10 or older(meaning that, as previously, the preferences setting has no effect):Arduino IDE 1.6.9 and newer overrides the default value of
upload.verify
, therefore this change has no effect on the AVRDUDE command generated and verification is controlled by the preferences setting as usual.Tested back to Arduino IDE 1.6.2, the oldest IDE version that supports Boards Manager updates.
Unfortunately a similar issue occurs with Upload Using Programmer. Due to the "platform.txt associated with the selected programmer is used for Upload Using Programmer" nightmare, setting a default value for
program.verify
in the MiniCore platform.txt will have no effect. The only possible solution would be to add MiniCore copies of all the programmers, which would use the MiniCore platform.txt for Upload Using Programmer, allowing the default value to be set forprogram.verify
in the MiniCore platform.txt.I have submitted a pull request to the Arduino IDE repository(arduino/Arduino#5427) which will solve the Upload Using Programmer issue in future Arduino AVR Boards versions if merged but the issue will remain with Arduino AVR Boards 1.6.12 and 1.6.14.