8000 PoC for handling Erase WiFi Setting after OTA by mhightower83 · Pull Request #6965 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

PoC for handling Erase WiFi Setting after OTA #6965

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

Draft
wants to merge 64 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
6fde10f
Proof of concept for post OTA 1st boot erase config.
mhightower83 Dec 28, 2019
93fb3d3
Added a 2nd method
mhightower83 Dec 30, 2019
c66ae2e
Merge branch 'master' into pr-erase-config
mhightower83 Dec 30, 2019
6d882e4
Added two_shots init to noextra4k
mhightower83 Dec 30, 2019
500b7cc
Removed cleaned up debug crud and added test example.
mhightower83 Dec 31, 2019
afd603b
Merge branch 'master' into pr-erase-config
mhightower83 Dec 31, 2019
bfb21b1
A proof of concept for handling Erase WiFi Setting after OTA
mhightower83 Dec 31, 2019
e51ab08
Addressed Tavis CI style issues.
mhightower83 Dec 31, 2019
a284b0a
Take two
mhightower83 Dec 31, 2019
3258d63
Merge branch 'master' into pr-erase-config
mhightower83 Jan 6, 2020
9d6e059
Merge branch 'master' into pr-erase-config
mhightower83 Jan 8, 2020
95eefed
Update example. Removed some debug crud. Added a Flash Info hotkey op…
mhightower83 Jan 8, 2020
815f1dc
Merge branch 'master' into pr-erase-config
mhightower83 Jan 9, 2020
660d19c
Merge branch 'master' into pr-erase-config
mhightower83 Jan 9, 2020
4554a7c
style fix
mhightower83 Jan 9, 2020
1ce4c60
Merge branch 'master' into pr-erase-config
mhightower83 Jan 16, 2020
7130877
Merge branch 'master' into pr-erase-config
mhightower83 Jan 23, 2020
73f16dc
Merge branch 'master' into pr-erase-config
mhightower83 Jan 28, 2020
9c4e44b
Added print messages to show progress.
mhightower83 Feb 6, 2020
546f0cb
Merge branch 'master' into pr-erase-config
mhightower83 Feb 6, 2020
560ddc5
Set default Method to 2, to side step travis issue of using preinit().
mhightower83 Feb 7, 2020
049d91b
Added a Third method.
mhightower83 Feb 18, 2020
4e2493a
Resolve merge conflict.
mhightower83 Feb 19, 2020
39160c8
one more :(
mhightower83 Feb 19, 2020
c0394fb
Merge branch 'master' into pr-erase-config
mhightower83 Feb 19, 2020
f1acb40
Access bin image header through ICACHE reduces IRAM usage by 16.
mhightower83 Feb 19, 2020
604b40a
Merge branch 'master' into pr-erase-config
mhightower83 Feb 21, 2020
4553009
Made function name longer to avoid possible name conflicts in the fut…
mhightower83 Feb 22, 2020
372998c
Merge branch 'master' into pr-erase-config
mhightower83 Mar 11, 2020
39b9508
CI issues
mhightower83 Mar 11, 2020
4954dcd
Merge branch 'master' into pr-erase-config
mhightower83 Mar 17, 2020
828a47d
Merge branch 'master' into pr-erase-config
mhightower83 Mar 27, 2020
b2d35ea
Merge branch 'master' into pr-erase-config
mhightower83 Apr 9, 2020
74129c5
Merge branch 'master' into pr-erase-config
mhightower83 Apr 16, 2020
14fede0
Merge branch 'master' into pr-erase-config
mhightower83 Apr 28, 2020
be5fe6d
Merge branch 'master' into pr-erase-config
mhightower83 May 5, 2020
cfd54df
Merge branch 'master' into pr-erase-config
mhightower83 May 16, 2020
6f91be0
Merge branch 'master' into pr-erase-config
mhightower83 May 31, 2020
6b1cdb8
Merge branch 'master' into pr-erase-config
mhightower83 Jun 4, 2020
fcb8b21
Merge branch 'master' into pr-erase-config
mhightower83 Jun 19, 2020
c40a873
Merge branch 'master' into pr-erase-config
mhightower83 Jul 7, 2020
2b2def2
Corrected new errors after upgrade to GCC 10.1 toolchain.
mhightower83 Jul 10, 2020
48ed5e9
Merge branch 'master' into pr-erase-config
devyte Jul 22, 2020
b211727
Merge branch 'master' into pr-erase-config
mhightower83 Sep 2, 2020
ab9b6b2
Corrected manual merge error, with init order of class.
mhightower83 Sep 2, 2020
e5539fe
Merge branch 'master' into pr-erase-config
mhightower83 Sep 17, 2020
502d8bc
Merge branch 'master' into pr-erase-config
mhightower83 Oct 2, 2020
f50b3a6
Merge branch 'master' into pr-erase-config
mhightower83 Nov 11, 2020
94365e1
Fixed merge errors and code rot.
mhightower83 Nov 11, 2020
5234f3f
Updated wifi_health_t and WiFiDisconnectLog_t to take
mhightower83 Nov 11, 2020
025bb2f
Merge branch 'master' into pr-erase-config
mhightower83 Dec 8, 2020
edade1c
Merge branch 'master' into pr-erase-config
mhightower83 Dec 29, 2020
24a117c
Merge branch 'master' into pr-erase-config
d-a-v Feb 19, 2021
4e31c91
Merge branch 'master' into pr-erase-config
mhightower83 Mar 14, 2021
0b01518
Replaced ROM_uart_div_modify and associated logic, with the current
mhightower83 Mar 14, 2021
f9a3f95
Merge branch 'master' into pr-erase-config
devyte Apr 3, 2021
217b2d2
Cleanup merge conflict. Now use IRAM_ATTR and _NOINLINE_STATIC w/o ch…
mhightower83 Apr 3, 2021
0b7fced
Merge branch 'master' into pr-erase-config
mhightower83 Jul 28, 2021
9f0e220
Merge branch 'master' into pr-erase-config
mhightower83 Aug 8, 2021
e44e752
Merge branch 'master' into pr-erase-config
mhightower83 Aug 21, 2021
c44a3f9
Changed to comply with strict-aliasing rules. Changes based on discus…
mhightower83 Aug 22, 2021
63a2048
Merge branch 'pr-erase-config' of github.com:mhightower83/Arduino int…
mhightower83 Aug 22, 2021
21b0154
Merge branch 'master' into pr-erase-config
mhightower83 Dec 21, 2021
fb05f15
Merge branch 'master' into pr-erase-config
mhightower83 May 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
mhightower83 committed Mar 11, 2020
commit 4553009e6d0ebc6c255dfcfb56ed31ed88a64cd4
2 changes: 1 addition & 1 deletion cores/esp8266/Updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void UpdaterClass::_reset() {
}

bool UpdaterClass::begin(size_t size, int command, int ledPin, uint8_t ledOn) {
#ifdef ERASE_CONFIG_H
#if defined(ERASE_CONFIG_H) && !defined(HOST_MOCK)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERASE_CONFIG_H always defined, drop the condition (leaving host_mock)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

// Empty call so erase_config.cpp module to ensure it is built and linked in.
enable_erase_config_at_link_time();
#endif
Expand Down
16 changes: 10 additions & 6 deletions cores/esp8266/erase_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ size element in `flashchip` structure in ROM data, dRAM. This allows the flash
erase to succeed.

The original flash size is restored before starting the SDK. With the assumption
that the SDK will handle the size change properly. It should be noted that
only changing the size value in the flashchip table, is equivalent to what the
esptool.py is doing.
that the SDK will handle the size change properly. Note that only changing the
size value in the `flashchip` structure, is equivalent to what the esptool.py is
doing.

I also added an example/test sketch for exercising the feature. It is
OTAEraseConfig.
OTAEraseConfig. It also gathers some WiFi signal/connection statistics.

*/

Expand Down Expand Up @@ -110,7 +110,9 @@ void enable_erase_config_at_link_time(void) {
extern "C" void Cache_Read_Enable_2(void);
extern "C" void Cache_Read_Disable_2(void);

int ICACHE_RAM_ATTR erase_sector(const uint32_t sector) {
/* Cannot be made static. The compiler will inline into erase_config and lose
ICACHE_RAM_ATTR. Make name longer to be more unique */
int ICACHE_RAM_ATTR erase_config__erase_sector(const uint32_t sector) {
/*
Toggle Flash execution off and on, around ROM flash function calls.
The SDK APIs would have normally handled this operation; however,
Expand All @@ -137,7 +139,7 @@ bool IRAM_MAYBE erase_config(const uint32_t flash_erase_mask) {
#elif (ERASE_CONFIG_METHOD == 2)
if (0 != SPIEraseSector(sector)) {
#elif (ERASE_CONFIG_METHOD == 3)
if (0 != erase_sector(sector)) {
if (0 != erase_config__erase_sector(sector)) {
#endif
ETS_PRINTF("Erase sector 0x%04X failed!\n", sector);
return false;
Expand Down Expand Up @@ -403,6 +405,8 @@ void print_flashchip() {
#define PRINT_FLASHCHIP() do{}while(false)
#endif

/* Cannot be made static, compiler will inline into erase_config_method3 and use
more IRAM. */
void set_flashchip_and_check_erase_config(void) {
/*
We patch and restore chip_size here. It should be noted that the ROM APIs
Expand Down
0