-
Notifications
You must be signed in to change notification settings - Fork 7.6k
EEPROM_library_ported_Partition_table_updated #535
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
I'm about to test your implementation today. Thanks for providing a clean implementation for the EEPROM emulation. At first glance I noticed, that your PR contains build files like dependency and object files. Those should probably get removed. But maybe the maintainers can cherry pick files? I dunno. Also 'libraries/EEPROM/library.properties' seems to contain outdated information. |
I have deleted all unnecessary files and folders from example directory and I have somehow corrected the properties file! |
Tested. Works as advertised. :-D Thanks a lot! |
Readability change, Concern about the SubType being 0x99.
libraries/EEPROM/EEPROM.cpp
Outdated
if (!_data) | ||
return false; | ||
|
||
noInterrupts(); |
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.
Not needed on the ESP32
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.
You mean interrupts doesn't need to be stopped? I will take out the relevant lines.
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.
There's no need to stop the interrupts. Besides, noInterrupts
and interrupts
functions are no-op in the current version.
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.
This comment is still valid
libraries/EEPROM/EEPROM.cpp
Outdated
ret = true; | ||
} | ||
} | ||
interrupts(); |
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.
likewise
libraries/EEPROM/EEPROM.cpp
Outdated
} | ||
else | ||
{ | ||
if (esp_partition_write(_mypart, 0, (void *)_data, _size) == ESP_ERR_INVALID_SIZE) |
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.
Indentation does not match the rest of the file
int addr = 0; | ||
#define N512 64 | ||
void setup() | ||
{ |
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.
Please use "Format Sketch" feature in Arduino IDE when preparing example sketches.
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 am not using Arduino Ide I will check it anyhow.
// the current address in the EEPROM (i.e. which byte | ||
// we're going to write to next) | ||
int addr = 0; | ||
#define N512 64 |
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.
Giving this define some descriptive name would be nice (e.g. EEPROM_SIZE
?)
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.
Ok
libraries/EEPROM/EEPROM.cpp
Outdated
|
||
noInterrupts(); | ||
|
||
if (esp_partition_erase_range(_mypart, 0, 4096) != ESP_OK) |
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.
suggest using SPI_FLASH_SEC_SIZE
for the constant instead
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.
Ok will do
@@ -3,4 +3,5 @@ nvs, data, nvs, 0x9000, 0x5000, | |||
otadata, data, ota, 0xe000, 0x2000, | |||
app0, app, ota_0, 0x10000, 0x140000, | |||
app1, app, ota_1, 0x150000,0x140000, | |||
spiffs, data, spiffs, 0x290000,0x170000, | |||
eeprom, data, 0x99, 0x290000,0x1000, | |||
spiffs, data, spiffs, 0x291000,0x169000 |
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.
It may be a better idea to shrink app partition instead. Otherwise SPIFFS partition will need to be re-uploaded after this change.
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.
Initially I had the EEprom partition after the Nvs one shrinking Nvs partition 4kbytes.
Then I change it for me-no-dev comment on #525
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.
Since spiffs is not running yet and the app partitions are purposly enlarged to fit BT and WIFI it is better to do it like that ;)
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.
Otherwise you are correct
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.
also giving the 0x99 SubType value a name would be helpful
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.
What shall I do?
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.
As @igrr say, the address change will cause some problems in the Unofficial SPIFFS library
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.
And?
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.
Else we should cause problems with bigger sketches?
…sp32 into EEprom_library Correction to eeprom_write.ino
I have corrected the example eeprom_write.ino |
Why not on upper 4k of nvs partition? So that everybody is happy. |
Less NVS? |
4k less! |
Is this acceptable? |
As the @me-no-dev is irreducible, SPIFFS library is quite new and still have few downloads, so this will not be a bigggg problem too =) |
It is not advised to change the size of NVS partition, as part of its data will be lost, leaving WiFi configuration in a potentially semi-defined state. I would say that shrinking sketch space by 4k would be acceptable, but in the end it is @me-no-dev's call. If SPIFFS library is not widely deployed yet, shrinking SPIFFS is also an option. |
All modification requested has been done! |
@copercini, @igrr, what prevents this branch from being merged at this point and do we have a core group responsible for doing such merges? |
@lonerzzz There is one change which still needs to be done (remove noInterrupts/interrupts) and then it is up to @me-no-dev to approve and merge this. |
Last correction done. |
libraries/EEPROM/EEPROM.cpp
Outdated
|
||
if (esp_partition_erase_range(_mypart, 0, SPI_FLASH_SEC_SIZE) != ESP_OK) | ||
{ | ||
ESP_LOGE(TAG, "partition erase err."); |
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.
please use Arduino's log facility :) log_e("partition erase err.");
corrected! |
Done! :) |
Thanks! |
* EEPROM_library_ported_Partition_table_updated * Cleanup & formal corrections * Make formatting of file consistent. Readability change, Concern about the SubType being 0x99. * Code formatting cleanup * Code formatting cleanup * Code formatting cleanup * Remove commented out code * Restore dropped bracket * Update EEPROM.cpp * Format Corrections * deletedExample * Corrected example * Deleted interrupts/nointerrupts * Update EEPROM.cpp
This is the outcome of issue 525.