ChipChop Support Forum
Log in
Log out
Join the forum
My Details
REPLIES: 4
VIEWS: 239
BACK
REPLY TO THIS POST
bscotty
25 Feb 2024
ESP32 showing only 1mb flash instead of 4mb?
Hello,

When I upload the sketch after it's finished PlatformIO is showing that I have almost filled the flash.
But the board is WROOM-32 and the spec says it has 4mb?

The settings are correct in platformio.ini, it's a generic esp32dev which has 4mb so why is it showing only around 1.3mb available flash?

Any ideas, is it just an info display bug and I can just ignore it and use what I need up to maybe a little bit less than 4mb?

Thanks
Aubrey44
25 Feb 2024

Hey there…. Im no expert with these little devices. And I use Arduino IDE BUT… I’ll throw in my 2cents.

I believe depending on the actual board you have, boards core you have installed and the partitions settings in the IDE, there a many different memory options. Sometimes the settings will allocate a bunch of memory for core 0 (protocol core i believ?) and only a little memory for core 1 (Application core, your sketch resides).

In any case, you can change these partition settings to sometimes access more of the internal memory or access the external memory (if any is installed) ….

Sorry its not more clear but a lot of researching will help you and maybe someone here can help but thsi is why probably why you aren’t seeing all of your 4mb
fig_jam
25 Feb 2024

It's partitions, for some reason the default one only gives around 1.3mb for your program on an ESP32 even if you have a lot more space but it can be easily changed. Somewhere. Somehow. :)
I don't think it's a dropdown option but something you specify in the platformio.ini and you allocate what you want.

If you figure it out let us know, here's my latest discovery with platformio.ini

monitor_filters = esp32_exception_decoder
build_type = debug

Stick that at the end of platformio.ini and if your code crashes it will spit out a reasonable debug report.

bscotty
26 Feb 2024

Guys, thanks for the info. I had a brief look today and it's definitely what I need but I will need to spend some time to get my head around it.
I will definitely post back.
Down Under
27 Feb 2024

This may save you some time

You have around 20 ready made partitions to chose from just by adding a build flag, the csv files are in: <user>/.platformio/packages/framework-arduinoespressif32/tools/partitions

It's all about leveraging the storage space and if you are going to use ota. OTA needs most of the space as it needs double of what the binary is so it can be downloaded, unpacked, test run and finally replace the starting partition binary.

You probably won't have enough space for ota anyway so may as well expand the app0 or spiffs partitions and ditch the app1 or factory partition , there's an example "no-ota.csv" you can use.

This is what you would add in the platformio.ini:

board_build.partitions = no-ota.csv

Other option is to use one of the csv files as a template, tweak what you need and then include it in the root of the project and reference it the same way in the platformio.ini

The default.csv is I guess for the 4mb but wastes 1.3-1.4 mb on the ota, modify that one and if you mess it up just use "erase flash" in platformio and no one will know 👀

good luck