-
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
PoC for handling Erase WiFi Setting after OTA #6965
base: master
Are you sure you want to change the base?
Commits on Dec 28, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 6fde10f - Browse repository at this point
Copy the full SHA 6fde10fView commit details
Commits on Dec 30, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 93fb3d3 - Browse repository at this point
Copy the full SHA 93fb3d3View commit details -
Configuration menu - View commit details
-
Copy full SHA for c66ae2e - Browse repository at this point
Copy the full SHA c66ae2eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d882e4 - Browse repository at this point
Copy the full SHA 6d882e4View commit details
Commits on Dec 31, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 500b7cc - Browse repository at this point
Copy the full SHA 500b7ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for afd603b - Browse repository at this point
Copy the full SHA afd603bView commit details -
A proof of concept for handling Erase WiFi Setting after OTA
Issue: Sometimes when an ESP8266 is reflashed/upgraded the WiFi does not work. Then a serial flash with Erase Flash with WiFi setting is recommended. I have seen this more often when changing SDK by OTA. We don't have an erase WiFi for OTA. The PR tries to present a proof of concept solution. Actually it describes two different methods. There are 3 cases to consider when the firmware is updated by OTA. The new firmware: 1. has the same Flash Configuration as the old. 2. has a larger Flash Configuration than the old. 3. has a smaller Flash Configuration then the old. In theory after an OTA and before a restart, the flash could be erased for _case 1_. _Case 2_ is a problem because the size exceeds what the SPIEraseSector expects and fails. We have to wait for a restart, after which the SDK will have updated the values in `flashchip`. _Case 3_ is potentially unsafe because we could be erasing the code that is running. At app_entry() `flashchip` properties appear to be reset to a default 4MByte flash. Even an ESP8285 reported 4MByte. The value of `flashchip->chip_size` was changed at the 2nd SPIRead. The 1st read was to address 0, 4 bytes. To erase the flash WiFi area, I choose to wait until the SDK has finished its adjustments to the `flashchip` structure. Then to begin erasing WiFi sectors. I implemented two methods: 1. The first runs after the SDK calls `user_init()` and flash code execution is available (No IRAM needed), but restarts to be sure the SDK does not get confused about its sectors being erased. 2. The 2nd method runs as early as possible required IRAM. The sectors are erased before that 2nd read is processed. The SDK allowing the SDK to start off thinking the sectors were blank at boot. I also added an example/test sketch for exercising the feature. It is OTAEraseConfig.
Configuration menu - View commit details
-
Copy full SHA for bfb21b1 - Browse repository at this point
Copy the full SHA bfb21b1View commit details -
Configuration menu - View commit details
-
Copy full SHA for e51ab08 - Browse repository at this point
Copy the full SHA e51ab08View commit details -
Configuration menu - View commit details
-
Copy full SHA for a284b0a - Browse repository at this point
Copy the full SHA a284b0aView commit details
Commits on Jan 6, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 3258d63 - Browse repository at this point
Copy the full SHA 3258d63View commit details
Commits on Jan 8, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 9d6e059 - Browse repository at this point
Copy the full SHA 9d6e059View commit details
Commits on Jan 9, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 95eefed - Browse repository at this point
Copy the full SHA 95eefedView commit details -
Configuration menu - View commit details
-
Copy full SHA for 815f1dc - Browse repository at this point
Copy the full SHA 815f1dcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 660d19c - Browse repository at this point
Copy the full SHA 660d19cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4554a7c - Browse repository at this point
Copy the full SHA 4554a7cView commit details
Commits on Jan 16, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 1ce4c60 - Browse repository at this point
Copy the full SHA 1ce4c60View commit details
Commits on Jan 23, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 7130877 - Browse repository at this point
Copy the full SHA 7130877View commit details
Commits on Jan 28, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 73f16dc - Browse repository at this point
Copy the full SHA 73f16dcView commit details
Commits on Feb 6, 2020
-
Added print messages to show progress.
And code to ensure the UART speed stayed at 74880 for a more complete viewing of messages. Well at least, it stays at 74880 for a longer time than it was. Added pinMode filter to prevent UART TX pin from being disabled during user_init().
Configuration menu - View commit details
-
Copy full SHA for 9c4e44b - Browse repository at this point
Copy the full SHA 9c4e44bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 546f0cb - Browse repository at this point
Copy the full SHA 546f0cbView commit details
Commits on Feb 7, 2020
-
Set default Method to 2, to side step travis issue of using preinit().
This is just a PoC an alternate for preinit() can be created later.
Configuration menu - View commit details
-
Copy full SHA for 560ddc5 - Browse repository at this point
Copy the full SHA 560ddc5View commit details
Commits on Feb 18, 2020
-
This method runs before the NONOS SDK is started. Patches the flashchip structure that the ROM APIs reference for validating input before calling SPIEraseSector. Extracted logic from EspClass::magicFlashChipSize() to make a "C" callable function and made EspClass::magicFlashChipSize() a thin wrapper to avoid duplicating code. Use Cache_Read_Enable() to enable flash code execution to reduce IRAM usage by pre SDK starup code. Improved comments and made comment formating more consistant in erase_config.cpp. Improved issolation of debug printing.
Configuration menu - View commit details
-
Copy full SHA for 049d91b - Browse repository at this point
Copy the full SHA 049d91bView commit details
Commits on Feb 19, 2020
-
Changed method for reading image header, freeing 16 bytes of iRAM"
Configuration menu - View commit details
-
Copy full SHA for 4e2493a - Browse repository at this point
Copy the full SHA 4e2493aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 39160c8 - Browse repository at this point
Copy the full SHA 39160c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for c0394fb - Browse repository at this point
Copy the full SHA c0394fbView commit details
Commits on Feb 21, 2020
-
Access bin image header through ICACHE reduces IRAM usage by 16.
Latest merge broke my TZ logic. Updated to the new configTime method. Updated WifiHealth to handle multiple/duplicate disconnects w/o connects. When a AP goes off line, a disconnect callback is done for each failed connect attempt. Before the total connect time was getting inflated. Now uses LED_BUILTIN for WiFi Up/Down state. Updated WifiHealth.ino to report total time connected and disconnected. "Connection Uptime" is the time since last connect. "Total Uptime" is the sum of all past uptimes. "Total Downtime" is the sum of all past downtimes. "min/max/avg" reportings are of past uptimes or past downtimes. Adjust comments for style?
Configuration menu - View commit details
-
Copy full SHA for f1acb40 - Browse repository at this point
Copy the full SHA f1acb40View commit details -
Configuration menu - View commit details
-
Copy full SHA for 604b40a - Browse repository at this point
Copy the full SHA 604b40aView commit details
Commits on Mar 11, 2020
-
Made function name longer to avoid possible name conflicts in the fut…
…ure. Using static caused the compiler to inline with functions with different IRAM attributes. Updated some comments. Maybe fixed CI host issue with Update.cpp.
Configuration menu - View commit details
-
Copy full SHA for 4553009 - Browse repository at this point
Copy the full SHA 4553009View commit details -
Configuration menu - View commit details
-
Copy full SHA for 372998c - Browse repository at this point
Copy the full SHA 372998cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 39b9508 - Browse repository at this point
Copy the full SHA 39b9508View commit details
Commits on Mar 17, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 4954dcd - Browse repository at this point
Copy the full SHA 4954dcdView commit details
Commits on Mar 27, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 828a47d - Browse repository at this point
Copy the full SHA 828a47dView commit details
Commits on Apr 9, 2020
-
Configuration menu - View commit details
-
Copy full SHA for b2d35ea - Browse repository at this point
Copy the full SHA b2d35eaView commit details
Commits on Apr 16, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 74129c5 - Browse repository at this point
Copy the full SHA 74129c5View commit details
Commits on Apr 28, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 14fede0 - Browse repository at this point
Copy the full SHA 14fede0View commit details
Commits on May 5, 2020
-
Configuration menu - View commit details
-
Copy full SHA for be5fe6d - Browse repository at this point
Copy the full SHA be5fe6dView commit details
Commits on May 16, 2020
-
Configuration menu - View commit details
-
Copy full SHA for cfd54df - Browse repository at this point
Copy the full SHA cfd54dfView commit details
Commits on May 31, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 6f91be0 - Browse repository at this point
Copy the full SHA 6f91be0View commit details
Commits on Jun 4, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 6b1cdb8 - Browse repository at this point
Copy the full SHA 6b1cdb8View commit details
Commits on Jun 19, 2020
-
Configuration menu - View commit details
-
Copy full SHA for fcb8b21 - Browse repository at this point
Copy the full SHA fcb8b21View commit details
Commits on Jul 7, 2020
-
Configuration menu - View commit details
-
Copy full SHA for c40a873 - Browse repository at this point
Copy the full SHA c40a873View commit details
Commits on Jul 10, 2020
-
Corrected new errors after upgrade to GCC 10.1 toolchain.
Method 3 was failing with an unaligned access due to 32-bit word access being optomized to an 8-bit when accessing ICACHE memory. Added noinline with IRAM_CACHE attribute in module erase_config.cpp. Also, revised print macros to be more globally unique.
Configuration menu - View commit details
-
Copy full SHA for 2b2def2 - Browse repository at this point
Copy the full SHA 2b2def2View commit details
Commits on Jul 22, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 48ed5e9 - Browse repository at this point
Copy the full SHA 48ed5e9View commit details
Commits on Sep 2, 2020
-
Configuration menu - View commit details
-
Copy full SHA for b211727 - Browse repository at this point
Copy the full SHA b211727View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab9b6b2 - Browse repository at this point
Copy the full SHA ab9b6b2View commit details
Commits on Sep 17, 2020
-
Configuration menu - View commit details
-
Copy full SHA for e5539fe - Browse repository at this point
Copy the full SHA e5539feView commit details
Commits on Oct 2, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 502d8bc - Browse repository at this point
Copy the full SHA 502d8bcView commit details
Commits on Nov 11, 2020
-
Configuration menu - View commit details
-
Copy full SHA for f50b3a6 - Browse repository at this point
Copy the full SHA f50b3a6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 94365e1 - Browse repository at this point
Copy the full SHA 94365e1View commit details -
Updated wifi_health_t and WiFiDisconnectLog_t to take
advange of C++ element initialization options.
Configuration menu - View commit details
-
Copy full SHA for 5234f3f - Browse repository at this point
Copy the full SHA 5234f3fView commit details
Commits on Dec 8, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 025bb2f - Browse repository at this point
Copy the full SHA 025bb2fView commit details
Commits on Dec 29, 2020
-
Configuration menu - View commit details
-
Copy full SHA for edade1c - Browse repository at this point
Copy the full SHA edade1cView commit details
Commits on Feb 19, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 24a117c - Browse repository at this point
Copy the full SHA 24a117cView commit details
Commits on Mar 14, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 4e31c91 - Browse repository at this point
Copy the full SHA 4e31c91View commit details -
Replaced ROM_uart_div_modify and associated logic, with the current
method of handling direct ROM calls.
Configuration menu - View commit details
-
Copy full SHA for 0b01518 - Browse repository at this point
Copy the full SHA 0b01518View commit details
Commits on Apr 3, 2021
-
Configuration menu - View commit details
-
Copy full SHA for f9a3f95 - Browse repository at this point
Copy the full SHA f9a3f95View commit details -
Cleanup merge conflict. Now use IRAM_ATTR and _NOINLINE_STATIC w/o ch…
…anges. Fixed missed edit (rom_uart_div_modify) for debug build.
Configuration menu - View commit details
-
Copy full SHA for 217b2d2 - Browse repository at this point
Copy the full SHA 217b2d2View commit details
Commits on Jul 28, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 0b7fced - Browse repository at this point
Copy the full SHA 0b7fcedView commit details
Commits on Aug 8, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 9f0e220 - Browse repository at this point
Copy the full SHA 9f0e220View commit details
Commits on Aug 21, 2021
-
Configuration menu - View commit details
-
Copy full SHA for e44e752 - Browse repository at this point
Copy the full SHA e44e752View commit details
Commits on Aug 22, 2021
-
Changed to comply with strict-aliasing rules. Changes based on discus…
…sions in esp8266#8261 (comment)
Configuration menu - View commit details
-
Copy full SHA for c44a3f9 - Browse repository at this point
Copy the full SHA c44a3f9View commit details -
Merge branch 'pr-erase-config' of github.com:mhightower83/Arduino int…
…o pr-erase-config
Configuration menu - View commit details
-
Copy full SHA for 63a2048 - Browse repository at this point
Copy the full SHA 63a2048View commit details
Commits on Dec 21, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 21b0154 - Browse repository at this point
Copy the full SHA 21b0154View commit details
Commits on May 2, 2022
-
Configuration menu - View commit details
-
Copy full SHA for fb05f15 - Browse repository at this point
Copy the full SHA fb05f15View commit details