How to use 16MB esp32 and use all of its available flash

Hi there.
I am working with the 16MB esp32 modules and would like to utilise all the space available on the flash chip.
either extend the APP partitions and or extend FS0 and FS1 or even add another partition.

the issue i sit with is if i change those then my compilation fails due to me exceeding the 4mB hard level set. how can i modify this in order to achieve my result.

1 Like

In mos.yml

build_vars:
  MGOS_ROOT_FS_SIZE: 524288 #  512kB = 0x80000
  APP_SLOT_SIZE: 2097152    # 2048kB = 0x200000
  # enable 16MB flash size
  ESP_IDF_SDKCONFIG_OPTS: >
    ${build_vars.ESP_IDF_SDKCONFIG_OPTS} 
      CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
      CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
      CONFIG_ESPTOOLPY_FLASHSIZE=16MB
2 Likes

Thank you for the response.
i have been trying that and didn’t work…
after i did a local build i saw that the config wasn’t propagating through to the sdkconfig file so
what i did was do a local build and then i manually updated the sdkconfig file.

I’m not sure I understand what you did, but here is the partition table with the settings above:

[Mar 23 07:54:17.929] I (60) boot: Partition Table:
[Mar 23 07:54:17.932] I (64) boot: ## Label            Usage          Type ST Offset   Length   Flags
[Mar 23 07:54:17.940] I (72) boot:  0 nvs              WiFi data        01 02 00009000 00004000 00000000
[Mar 23 07:54:17.948] I (80) boot:  1 otadata          OTA data         01 00 0000d000 00002000 00000000
[Mar 23 07:54:17.957] I (88) boot:  2 app_0            OTA app          00 10 00010000 00200000 00000000
[Mar 23 07:54:17.965] I (97) boot:  3 fs_0             FS               01 82 00210000 00080000 00000000
[Mar 23 07:54:17.973] I (105) boot:  4 app_1            OTA app          00 11 00290000 00200000 00000000
[Mar 23 07:54:17.982] I (113) boot:  5 fs_1             FS               01 82 00490000 00080000 00000000
[Mar 23 07:54:17.990] I (122) boot:  6 fs_ext           FS               01 82 00510000 00020000 00000000
[Mar 23 07:54:17.998] I (130) boot: End of partition table

Notice the app_* and fs_* partitions’ sizes. I also have an 128kB extra partition.

2 Likes

Thanks for this thread, this same thing is on my list of TODOs.