Adafruit Feather ESP32-S3 4MB flash, 2MB PSRAM Flash Reported Small

I’m just starting to play around with this board and got programs to compile and load with PlatformIO. But I keep noticing that the reported percentage of flash used seems large for a basic program. Then I noticed that the flash size in the compile results seems way short, but like a factor of 3. In looking at the board file for this it seems like it puts in the correct values for the flash size of 4MB but the result window always shows about 1.4MB as the maximum size. Im not sure why that is:

Flash: 22.3% (used 321365 bytes from 1441792 bytes)

[env:adafruit_feather_esp32s3]
platform = espressif32
board = adafruit_feather_esp32s3
framework = arduino
monitor_speed = 115200

Looking at this:

From the documentation shows the line:

"maximum_size": 4194304,

So I’m a little lost on why it thinks my flash is 1.44MB?

The flash of ESP32 is separated into different partitions.
Your board is using the tinyuf2-partitions-4MB layout as default.

The OTA1 partiton has a size of 0x170000 which is 1507328 bytes = 1,4375 MB. So everything is correct :slight_smile:

You’ll find more informations about partition tables on ESP32-S3
here: Espressif 32 — PlatformIO latest documentation
and here: Partition Tables - ESP32 - — ESP-IDF Programming Guide latest documentation

1 Like

Ahhhh, okay. I had a vague notion of the use of partitions but thought it was just really describing the total size of the flash maybe minus a bootloader. Probably because the boards I was working on used the ‘one big blob’. That makes sense now, one partition for the running firmware and one to pull in an update. I’ll have to look into how to change that since I’d rather have more program space. Over the air updates are not really something I care about for this project.

Looks like tinyuf2-partitions-4MB-noota.csv might be what I seek.

Thanks for the pointers!

The real problem is

which gives you an outdated Espressif Arduino 2.x where those files not exist.

Use the pioarduino community fork to get the latest available Espressif Arduino 3.x where those files exists:

platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.30/platform-espressif32.zip

But another solution would be to live with the 2.x Arduino core and create the file manually inside your project folder.

2 Likes

You replied too fast! :smiley:

I finally located the folder where the actual partition CSV was stored and created a file with the content of the noota version I mentioned just as you indicate and that worked fine. Puts me at about 3M for max program size which should be fine for anything I have planned.

I swear to God, every time I post in frustration I find the answer about 2 minutes after I post!

For others that hit this thread the files on Mac are in the .platformio folder in the home directory. This means searches for the filenames won’t get results. The issue was that current documentation that is on the web had filenames that my version of PlatformIO or it components didn’t know about so using the names provided on the website led to file not found errors.

/Users/[myusername]/.platformio/packages/framework-arduinoespressif32/variants/adafruit_feather_esp32s3/

Was the path where the file was stored. I created a new file there with the contents of the tinyuf2-partitions-4MB-noota.csv file from the online documentation and a name that matched the pattern in the variant folder “partitions-4MB-noota-tinyuf2.csv”:

[env:adafruit_feather_esp32s3]
platform = espressif32
board = adafruit_feather_esp32s3
framework = arduino
monitor_speed = 115200
board_build.partitions = partitions-4MB-noota-tinyuf2.csv

partitions-4MB-noota-tinyuf2.csv:

# ESP-IDF Partition Table
# Name,   Type, SubType, Offset,  Size, Flags
# bootloader.bin,,          0x1000, 32K
# partition table,          0x8000, 4K

nvs,      data, nvs,      0x9000,  20K,
otadata,  data, ota,      0xe000,  8K,
ota_0,    app,  ota_0,   0x10000,  2816K,
uf2,      app,  factory,0x2d0000,  256K,
ffat,     data, fat,    0x310000,  960K,