-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Add menu to choose which part of flash gets erased #4380
Conversation
Currently the new menu item is called "Erase Settings" and the options are "Only Sketch", "SDK Settings", and "All Flash Contents". Suggestions about better naming are very welcome. Another option to give users a way to erase flash would be to create a plugin, similar to the SPIFFS upload plugin, but that needs some (even if small) effort to install. One more option is to make the IDE perform flash erase when "Burn Bootloader" menu item is chosen. I thought this way was guaranteed to cause confusion, and went for the option implemented in this PR. |
tools/boards.txt.py
Outdated
@@ -1109,6 +1123,7 @@ def all_boards (): | |||
print 'menu.DebugLevel=Debug Level' | |||
print 'menu.LwIPVariant=lwIP Variant' | |||
print 'menu.led=Builtin Led' | |||
print 'menu.FlashErase=Erase Settings' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest "Erase Flash" here. "Erase Settings" is a bit confusing.
tools/boards.txt.py
Outdated
'flash_erase_menu': collections.OrderedDict([ | ||
( '.menu.FlashErase.none', 'Only Sketch' ), | ||
( '.menu.FlashErase.none.upload.erase_cmd', '' ), | ||
( '.menu.FlashErase.sdk', 'SDK Settings' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest "Sketch + SDK Settings" here, to reflect reality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 (or 'Sketch + WiFi settings' ?)
- fix argument parsing for flash erase command (-ce) - add region erase command (-cz)
65e5b47
to
788001b
Compare
788001b
to
2570a7d
Compare
CI check for boards.txt has successfully triggered here after I forgot to commit my boards.txt changes: Also noticed that I was formatting |
Here is a sketch to try with OTA.
|
Fix a compiler ambiguity introduced with a floating point frequency option for tone(). Thanks to @Rob58329 for discovering this and proposing the fix. Match original analogWrite behavior by going from 0...1023 (PWMRANGE) and not 0...1024, and also explicitly set the analogWrite pin to an OUTPUT. Thanks to @JAndrassy for finding this. Fixes esp8266#4380 discovered by @cranphin where interrupts were disabled on a stopWaveform(). Remove that completely and bracket the update of non-atomic fields in the structure with disable/enable IRQs for safety.
* Compatibility and IRQ fixed for waveform/tone/pwm Fix a compiler ambiguity introduced with a floating point frequency option for tone(). Thanks to @Rob58329 for discovering this and proposing the fix. Match original analogWrite behavior by going from 0...1023 (PWMRANGE) and not 0...1024, and also explicitly set the analogWrite pin to an OUTPUT. Thanks to @JAndrassy for finding this. Fixes #4380 discovered by @cranphin where interrupts were disabled on a stopWaveform(). Remove that completely and bracket the update of non-atomic fields in the structure with disable/enable IRQs for safety. * Fix tone(int,int,int) infinite loop Explicitly cast the frequency, when passed in as an int, to an unsigned int. Verified with snippet: tone(D1, (int)1000, 500); tone(D1, (unsigned int)1000, 500); tone(D1, 1000.0, 500); tone(D1, (int)1000); tone(D1, (unsigned int)1000); tone(D1, 1000.0);
While troubleshooting some WiFi connection issues it is often required to erase flash contents, specifically SDK configuration (last 4 sectors of flash).
This PR adds a menu which allows selecting between:
To support these changes, esptool-ck is updated to 0.4.13.