ESP32 4MB and 8MB Binary Compatibility

elec_gd
Posts: 9
Joined: Mon Aug 31, 2020 10:57 am

ESP32 4MB and 8MB Binary Compatibility

Postby elec_gd » Wed Jun 16, 2021 3:49 pm

Hi All,

I would like to enquire if there are any software changes required when upgrading the flash size of an ESP32 module. In my case, when upgrading from an ESP32-WROOM-32E 4MB to the 8MB type of the same module.

I am aware of the SDK config option to set the flash size "CONFIG_ESPTOOLPY_FLASHSIZE" as shown here:
https://docs.espressif.com/projects/esp ... -flashsize

This option is currently set in my software to 4MB. However, if I want to avoid rebuilding the binary when upgrading to 8MB, is there any effect I should be aware of if the SDK config option is left at 4MB and that binary is flashed on the 8MB version?
And, if I did rebuild the software for the 8MB option would this affect the bootloader?

Also, considering this SDK config option "CONFIG_ESPTOOLPY_FLASHSIZE_DETECT":
https://docs.espressif.com/projects/esp ... ize-detect
Does setting this option to yes allow the software to be compatible across modules of ESP32 varying flash sizes?

Appreciate any thoughts or advice on this. Thanks.

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32 4MB and 8MB Binary Compatibility

Postby chegewara » Wed Jun 16, 2021 7:52 pm

You can build and flash 4MB app onto 8MB flash without any changes needed. Just 4MB of flash will be unused.
To use 8MB flash you dont have to re-build whole app, but you have to adjust and rebuild partition table and bootloader probably too, as there is flash size option in bootloader (not 100 % sure here).
So you will have:
- one binary app,
- two partition tables
- one or two bootloaders (most likely two).

elec_gd
Posts: 9
Joined: Mon Aug 31, 2020 10:57 am

Re: ESP32 4MB and 8MB Binary Compatibility

Postby elec_gd » Thu Jun 17, 2021 2:26 pm

Hi,

Thanks for your feedback.
So my understanding is if necessary the same binary can be used for 4MB and 8MB but I'll loose the extra space.
I'll look further into if a bootloader update is needed when increasing the flash, thanks.
Are there are guidelines on adjusting the partition table for the increased flash size?

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32 4MB and 8MB Binary Compatibility

Postby chegewara » Thu Jun 17, 2021 2:35 pm

elec_gd wrote: Are there are guidelines on adjusting the partition table for the increased flash size?
I dont know about any, but easy way to get some insight is to compare default partition table for different flash size in arduino:
https://github.com/espressif/arduino-es ... partitions

Who is online

Users browsing this forum: Vilius and 102 guests