Skip to content
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

update scripter script size on esp32 #8174

Merged
merged 1 commit into from
Apr 14, 2020

Conversation

gemu2015
Copy link
Contributor

Description:

scripter uses SPIFFS on esp32 for scripts
#define ESP32_SCRIPT_SIZE xxx defaults to 8192 bytes

Checklist:

  • The pull request is done against the latest dev branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR.
  • The code change is tested and works on core Tasmota_core_stage
  • The code change pass travis tests. Your PR cannot be merged unless tests pass
  • I accept the CLA.

@arendst arendst merged commit e66b961 into arendst:development Apr 14, 2020
@Jason2866
Copy link
Collaborator

Jason2866 commented Apr 14, 2020

SPIFFS, really? Slow and it is deprecated. In ESP82XX it will be removed soon...
Theo avoided SPIFFS for good reasons
esp8266/Arduino#7095

arendst added a commit that referenced this pull request Apr 14, 2020
This reverts commit e66b961, reversing
changes made to 07ce431.
@gemu2015
Copy link
Contributor Author

@Jason2866
you are right SPIFFS is slow and deprecated, but was 15 minutes to implement and since script is loaded only once on startup and saved only when modified by user speed is not a problem.
if it is deprecated it is extremely easy to update to a better driver.
nvs partition has only 20kb and the nvs driver is also not very stable.
one could also think about to adapt a fat system instead of the sdcard interface (optionally)
however spiffs partition is only 1,47 mB, so not very useful.
and i think we should shrink it in favor of larger app sections.
i want to implement the camera interface with AI which takes a lot of flash, so app size should be much larger.

@arendst
Copy link
Owner

arendst commented Apr 14, 2020

I see espeasy is using a 4M divide like esp32_partition_app1810k_spiffs316k.

What are the possiblities with regards to these parameters?
Would that divide be enough (preferred for easy switch between tools) although a lot is wasted in 316k SPIFFS?

@gemu2015 gemu2015 deleted the scripter_update branch April 14, 2020 15:37
@gemu2015
Copy link
Contributor Author

camera interface with ai uses 2 mb, so together with tasmota we get about 3
so 2*1.8 should be enough. anyhow we need 2 step update via OTA
we actually do not need more SPIFFS then e.g. 32k
when using face recognition pictures should be stored on SDCARD anyhow.

@Jason2866
Copy link
Collaborator

Jason2866 commented Apr 14, 2020

If i do not missunderstand the way partitions are defined for ESP32 it should be easy
to change the size for the SPIFFS partition.
@arendst Do you want the structure similar ESPEasy?
eeprom size 0x1000 and for SPIFFS 0x8000
I would do a PR for the needed changes in PlatformIO

@arendst
Copy link
Owner

arendst commented Apr 14, 2020

I think there are no changes needed in PlatformIO.

It's just a matter of defining board_build.partitions = min_spiffs.csv in [common32] and board_build.partitions = ${common32.board_build.partitions} in every [env:tasmota32].

This results in the below layout:

# Name,   Type, SubType, Offset,  Size, Flags
nvs,      data, nvs,     0x9000,  0x5000,
otadata,  data, ota,     0xe000,  0x2000,
app0,     app,  ota_0,   0x10000, 0x1E0000,
app1,     app,  ota_1,   0x1F0000,0x1E0000,
spiffs,   data, spiffs,  0x3D0000,0x30000,

@Jason2866
Copy link
Collaborator

Jason2866 commented Apr 14, 2020

Yes, that are the needed changes :-) No eeprom area 32k SPIFFS?
image

@arendst
Copy link
Owner

arendst commented Apr 14, 2020

No. Tasmota does not use eeprom:

image

@gemu2015
Copy link
Contributor Author

perfect!

@Jason2866
Copy link
Collaborator

okay than 32 k SPIFFS?

@arendst
Copy link
Owner

arendst commented Apr 14, 2020

And from what I gather from the Arduino implementation they moved the eeprom partition within the nvs partition.

Yes only 32k SPIFFS. Who needs SPIFFS?

@Jason2866
Copy link
Collaborator

Gemu :-)

@arendst
Copy link
Owner

arendst commented Apr 14, 2020

I noticed you'll need a serial upload to change the partition layout so the sooner the better we implement this change.

@Jason2866 can you push a PR with these parameters? (I'm offline within a minute ;-)

@Jason2866
Copy link
Collaborator

I try to do in a minute

@gemu2015
Copy link
Contributor Author

@Jason2866
strange that your table did not work

this one works, gives 64k SPIFFS

Name, Type, SubType, Offset, Size, Flags

nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x1F0000,
app1, app, ota_1, 0x200000, 0x1F0000,
spiffs, data, spiffs, 0x3F0000,0x10000,

@Jason2866
Copy link
Collaborator

Thx @gemu2015 Not my day...
#8181

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.

3 participants