Skip to content

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

Merged
merged 15 commits into from
Aug 1, 2017

Conversation

pbecchi
Copy link
Contributor

@pbecchi pbecchi commented Jul 23, 2017

This is the outcome of issue 525.

@everslick
Copy link
Contributor

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.

@pbecchi
Copy link
Contributor Author

pbecchi commented Jul 24, 2017

I have deleted all unnecessary files and folders from example directory and I have somehow corrected the properties file!

@everslick
Copy link
Contributor

Tested. Works as advertised. :-D Thanks a lot!

if (!_data)
return false;

noInterrupts();
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Member

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

ret = true;
}
}
interrupts();
Copy link
Member

Choose a reason for hiding this comment

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

likewise

}
else
{
if (esp_partition_write(_mypart, 0, (void *)_data, _size) == ESP_ERR_INVALID_SIZE)
Copy link
Member

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()
{
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok


noInterrupts();

if (esp_partition_erase_range(_mypart, 0, 4096) != ESP_OK)
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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 ;)

Copy link
Member

Choose a reason for hiding this comment

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

Otherwise you are correct

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What shall I do?

Copy link
Contributor

@copercini copercini Jul 27, 2017

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

Copy link
Member

Choose a reason for hiding this comment

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

And?

Copy link
Member

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?

@pbecchi
Copy link
Contributor Author

pbecchi commented Jul 27, 2017

I have corrected the example eeprom_write.ino

@pbecchi
Copy link
Contributor Author

pbecchi commented Jul 27, 2017

Why not on upper 4k of nvs partition? So that everybody is happy.

@me-no-dev
Copy link
Member

Less NVS?

@pbecchi
Copy link
Contributor Author

pbecchi commented Jul 27, 2017

4k less!

@pbecchi
Copy link
Contributor Author

pbecchi commented Jul 27, 2017

Is this acceptable?

@copercini
Copy link
Contributor

copercini commented Jul 27, 2017

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 =)

@igrr
Copy link
Member

igrr commented Jul 28, 2017

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.

@pbecchi
Copy link
Contributor Author

pbecchi commented Jul 28, 2017

All modification requested has been done!
Regarding EEprom partition I didn't make any change , you can change it as you like.
It is now overlapping and shirking the SPIFFS partition.

@lonerzzz
Copy link
Contributor

@copercini, @igrr, what prevents this branch from being merged at this point and do we have a core group responsible for doing such merges?

@copercini
Copy link
Contributor

@lonerzzz I want to know too, because I also have some waiting PRs #504

@igrr
Copy link
Member

igrr commented Jul 31, 2017

@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.

@pbecchi
Copy link
Contributor Author

pbecchi commented Jul 31, 2017

Last correction done.


if (esp_partition_erase_range(_mypart, 0, SPI_FLASH_SEC_SIZE) != ESP_OK)
{
ESP_LOGE(TAG, "partition erase err.");
Copy link
Member

@me-no-dev me-no-dev Jul 31, 2017

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.");

@pbecchi
Copy link
Contributor Author

pbecchi commented Aug 1, 2017

corrected!

@me-no-dev me-no-dev merged commit 706bf48 into espressif:master Aug 1, 2017
@me-no-dev
Copy link
Member

Done! :)

@pbecchi
Copy link
Contributor Author

pbecchi commented Aug 1, 2017

Thanks!

Raienryu97 pushed a commit to Raienryu97/arduino-esp32 that referenced this pull request Aug 2, 2017
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants