Skip to content

Partition Table/Option for 16MB flash (and 32MB flash) #6495

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

Closed
1 task done
hamza765 opened this issue Mar 28, 2022 · 13 comments · Fixed by #6758
Closed
1 task done

Partition Table/Option for 16MB flash (and 32MB flash) #6495

hamza765 opened this issue Mar 28, 2022 · 13 comments · Fixed by #6758
Labels
Status: Solved Type: Documentation Issue pertains to Documentation of Arduino ESP32 Type: For reference Common questions & problems Type: Question Only question

Comments

@hamza765
Copy link

Related area

Board Support

Hardware specification

ESP32-WROVER-B

Is your feature request related to a problem?

I'm trying to flash my wrover-b with a 16MB flash partition, but i can't find any support at all for that. There is a option for (2mb app/12.5mb fat) but i'm using LittleFS, so that won't work. I'm currently stuck using No OTA (1mb app/ 3mb spiffs) which works, but only allows for 25% of my total capacity. Additionally, we have a order of chips coming in soon that will have 32MB total capacity (256Mb) of NOR flash mem. so it'll be even smaller of a ratio

Describe the solution you'd like

A custom board template, partition table, or just a start point for someone completely new to the world of embedded systems. I've googled so much for an answer before coming here as this is a last resort of sorts. I'd make the custom table, but don't really understand the mem address or size on the custom tables i've seen.

Thanks in advance!

Describe alternatives you've considered

No response

Additional context

No response

I have checked existing list of Feature requests and the Contribution Guide

  • I confirm I have checked existing list of Feature requests and Contribution Guide.
@hamza765 hamza765 added the Type: Feature request Feature request for Arduino ESP32 label Mar 28, 2022
@Jason2866
Copy link
Collaborator

For 16MB a partition example. You can change like you want the OTA partitions and
SPIFFS (used for LittleFS)
Just do the hex math
esp32_partition_app2944k_spiffs10M.csv

# Name,   Type, SubType, Offset,  Size, Flags
nvs,      data, nvs,     0x9000,  0x5000,
otadata,  data, ota,     0xe000,  0x2000,
app0,     app,  ota_0,   0x10000, 0x2F0000,
app1,     app,  ota_1,   0x300000, 0x2F0000,
spiffs,   data, spiffs,  0x5F0000,0xA10000,

@VojtechBartoska VojtechBartoska added the Resolution: Awaiting response Waiting for response of author label Apr 11, 2022
@VojtechBartoska
Copy link
Contributor

@hamza765 Was the comment above helpful?

@hamza765
Copy link
Author

@VojtechBartoska sort of. I'm confused on the 'hex math' part. I read in another issue that I can just leave the offsets column empty and the device will figure it out for me. So would i just set the spiffs partition to a size of 0xF42400 for a 16M flash? (and 0x1E84800 for 32M?)

@lbernstone
Copy link
Contributor

You must have the first partition offset to 0x9000. You can just use size past there if you prefer. The total space on a 16M device is 0x1000000. So, 0x1000000 - 0x9000 = 0xFF7000 left. Subtract 0x5000 for the nvs partition leaves 0xFF2000. If you continue for the partitions in Jason2866's example above, you will see that it uses all the space. https://www.calculator.net/hex-calculator.html, but I'm sure you have one on your computer.

@hamza765
Copy link
Author

@lbernstone That explains a lot! Do I need two app partitions? (app0/app1) or can i combine them both into one?

@lbernstone
Copy link
Contributor

If you want OTA to work, you need two.

@hamza765
Copy link
Author

Okay, good to know. Makes sense that they'd be equal in size. For future proofing, since i have so much space to play with, would giving each app partition like 3MB each be overkill?

@lbernstone
Copy link
Contributor

No. I'd give the app even more, since you will likely realize that the filesystem is less useful than you think.

@VojtechBartoska VojtechBartoska added Type: Documentation Issue pertains to Documentation of Arduino ESP32 Type: Question Only question and removed Resolution: Awaiting response Waiting for response of author Type: Feature request Feature request for Arduino ESP32 labels Apr 27, 2022
@VojtechBartoska
Copy link
Contributor

I'm adding this to our Documentation Roadmap as this is something which needs to be explained.

@hamza765
Copy link
Author

hamza765 commented Apr 27, 2022

Does this look right for the 32M?

# Name,   Type, SubType, Offset,    Size, Flags
nvs,      data, nvs,     0x9000,    0x5000,
otadata,  data, ota,     0xE000,    0x2000,
app0,     app,  ota_0,   0x10000,   0x500000,
app1,     app,  ota_1,   0x510000,  0x500000,
spiffs,   data, spiffs,  0xA10000,  0x15F0000,

@hamza765
Copy link
Author

hamza765 commented Apr 27, 2022

I spent an hour and made a simple partition generator:
https://docs.google.com/spreadsheets/u/0/d/16Hgrb1dloG2keiTx_JBniaQgJ_Ou8zg6xa3p3GGYM2k/copy

Assumes that you want OTA and bases the app partitions off of how much is left over once you enter in your preferred SPIFFS size

The link will ask you if you want to make a copy of the sheets as i don't want anyone messing up the original
(If there's any problems, please let me know!)

@trullock
Copy link

@hamza765 is the hero we need but don't deserve!

@PepeTux
Copy link

PepeTux commented Apr 23, 2024

@hamza765 great job and thanks for the Partition Generator !

Also you can use the tool:

The ESP32 Partition Tool is a utility designed to facilitate creating custom partition schemes in Arduino IDE 1.8.x & PlatformIO.
Install this tool on the old IDE and use it to generate the partition file.

314698896-bdb4562d-91ac-4348-9de7-be7a20935240

Remember to generate the partition file with the name "partitions.csv" and paste on your sketch folder to override the default/selected in the menu: Tools >> Partition Schema>> default/other.

regards
Jose Luis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Solved Type: Documentation Issue pertains to Documentation of Arduino ESP32 Type: For reference Common questions & problems Type: Question Only question
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants