PlatformIO Community

Esp32 flash size in menuconfig doesn't work

I want to set flash size of my project from 4MB in 8MB, but it doesn’t change!!

This is the Setup in menuconfig:

This is the error:

Can someone help me?

  • Whats your full platformio.ini? You should also a board = .. setting which has a 8MB flash chip then.
  • Have you updated your platforms? (E.g. via Update platforms & packages)

I’ve update platform and packages as you suggest, but it doesn’t change anything.

This is my platformio.ini:

platform = espressif32
board = esp32dev
framework = espidf
board_build.embed_txtfiles = src/certs/ca_cert.cer
board_build.partitions = partitions.csv

For what it’s worth… the esp32dev board by default has 4MB Flash… so that may not be a good start! :open_mouth: I’m not familiar with the ESPIDF, so I don’t know if that would cause that particular compile-time error message.


The Heltec WiFi LoRa 32 (V2) has 8MB of flash… maybe just try using heltec_wifi_lora_32_V2 as the board type as a test, and see if the error changes / goes away. If that doesn’t work, I’ll leave it to those who do know to help you further! :wink:

Hi @pfeerick thank you for your reply. Now it works!

I have another questions: what is the utility of menuconfig if the settings aren’t respected.
Maybe the platformio.ini is on top of menuconfig always and in anycase?

Thank you

Excellent! If you don’t mind, can you see if board_upload.flash_size=8MB with board = esp32dev works instead then? Yes, platformio.ini would be the base configuration, and then menuconfig on top of that. So if the underlying configuration is wrong, nothing you do in menuconfig would override that. Or that how I’m guessing it works! :slight_smile:

Thank you for your reply. So, I must set a different board in base of my module flash size in platformio.ini.

However, If I set board_upload.flash_size=8MB with board = esp32dev it doesn’t still work.

Actually I’m using a Wroom32D (8MB) on a custom board, it is possibile, in future, to add it on boards section in Platformio where the user can set the flash size. Would it be more correct?

1 Like

Maybe the other setting is missing as well:


but these are workarounds anyways.

PlatformIO already has the feature that you can add your board JSON file to the board/ folder of the project (docs), for custom private projects.

If it’s something big commercial of course, it can be added to the list of globally known boards.

1 Like

I faced exactly this puzzle. The solution suggested by @maxgerhardt resolved it for me. I needed both board_upload.flash_size = 8MB and board_upload.maximum_size = 8388608. (I wasn’t using menuconfig. I was fiddling directly with platformio.ini.)

1 Like