RuView icon indicating copy to clipboard operation
RuView copied to clipboard

4MB flash support?

Open stijn-DL opened this issue 8 months ago • 6 comments

I've got some esp32s3 supermini's with only 4MB flash and was wondering if there is a minimal build that only uses 4MB? I've tried to look trough the docs and sometimes you do mention it's possible but cant seem to figure it out by myself.

https://www.nologo.tech/en/product/esp32/esp32s3supermini/esp32S3SuperMini.html

Image

stijn-DL avatar Mar 14 '26 19:03 stijn-DL

Hi, I just went through the process and rebuild the esp32s3 files with 4MB partition table.

# Name,      Type, SubType, Offset,   Size,      Flags
nvs,         data, nvs,     0x9000,   0x6000,
otadata,     data, ota,     0xF000,   0x2000,
phy_init,    data, phy,     0x11000,  0x1000,
ota_0,       app,  ota_0,   0x20000,  0x1D0000,
ota_1,       app,  ota_1,   0x1F0000, 0x1D0000,
esptool.py --chip esp32s3 --port /dev/xxx --baud 460800 -before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 4MB --flash_freq 80m \
  0x0 bootloader.bin \
  0x8000 partition-table.bin \
  0x20000 esp32-csi-node.bin

esp32s3-4mb.zip

sebbu avatar Mar 14 '26 19:03 sebbu

Thanks @sebbu ! *the zip contains ota_data_initial.bin instead of esp32-csi-node.bin: mistake or do I replace the node with that?

Would you mind sharing what changes you made to get it to fit in 4 MB? I'd like to be able to reproduce the build locally for future releases.

Right now I'm just using the default build process:

# From the repository root:
MSYS_NO_PATHCONV=1 docker run --rm \
  -v "$(pwd)/firmware/esp32-csi-node:/project" -w /project \
  espressif/idf:v5.2 bash -c \
  "rm -rf build sdkconfig && idf.py set-target esp32s3 && idf.py build"

stijn-DL avatar Mar 15 '26 08:03 stijn-DL

it was a mistake in the zip.

I basically also followed ADR-012 (but used a local idf install) and asked an ai to rewrite the partition table (just change it in firmware/esp32-csi-node/partitions_display.csv) as it seemed that there is no need for 8mb (read somewhere about AMOLED support (maybe ADR-045) and that with CONFIG_DISPLAY_ENABLE it could be turned off and use 300kb less memory (but it seems that the feature was not ready). so I just gave it a shot and it worked

when you are done check the logs of an esp and you want to read #263

in the end you need your own model ! read issue #220

esp32-csi-node.bin.zip

sebbu avatar Mar 15 '26 11:03 sebbu

Thanks man

stijn-DL avatar Mar 15 '26 11:03 stijn-DL

Official 4MB flash support added in PR #267.

Two new files in firmware/esp32-csi-node/:

  • partitions_4mb.csv — 4MB partition table with dual OTA slots (1.856MB each)
  • sdkconfig.defaults.4mb — SDK config for 4MB flash with display support disabled

Build instructions:

# Option 1: Docker (simplest)
docker run --rm -v "$(pwd)/firmware/esp32-csi-node:/project" -w /project \
  espressif/idf:v5.2 bash -c \
  "rm -rf build sdkconfig && \
   cp sdkconfig.defaults.4mb sdkconfig.defaults && \
   idf.py set-target esp32s3 && idf.py build"

# Option 2: Local ESP-IDF
cd firmware/esp32-csi-node
cp sdkconfig.defaults.4mb sdkconfig.defaults
idf.py set-target esp32s3 && idf.py build

Flash command:

esptool.py --chip esp32s3 --port /dev/xxx --baud 460800 \
  write_flash --flash_mode dio --flash_size 4MB --flash_freq 80m \
  0x0 build/bootloader/bootloader.bin \
  0x8000 build/partition_table/partition-table.bin \
  0xF000 build/ota_data_initial.bin \
  0x20000 build/esp32-csi-node.bin

The firmware binary is ~978KB and each OTA slot is 1,856KB, so there's plenty of room. Note: AMOLED display support (ADR-045) is disabled in the 4MB config since it requires the larger SPIFFS partition only available on 8MB boards.

Thanks @sebbu for the community workaround that confirmed this was feasible!

ruvnet avatar Mar 15 '26 13:03 ruvnet

Official 4MB flash support is now available in v0.4.3-esp32 (PR #267).

What's included in the release:

  • esp32-csi-node-4mb.bin — firmware binary (755 KB, fits comfortably in the 1.856 MB OTA slot)
  • partition-table-4mb.bin — 4MB partition table with dual OTA slots
  • bootloader.bin and ota_data_initial.bin — same for both 4MB and 8MB

Flash command:

python -m esptool --chip esp32s3 --port /dev/xxx --baud 460800 \
  write_flash --flash_mode dio --flash_size 4MB --flash_freq 80m \
  0x0 bootloader.bin 0x8000 partition-table-4mb.bin \
  0xF000 ota_data_initial.bin 0x20000 esp32-csi-node-4mb.bin

Building from source (if you want to customize):

cd firmware/esp32-csi-node
cp sdkconfig.defaults.4mb sdkconfig.defaults
idf.py set-target esp32s3 && idf.py build

Or with Docker:

docker run --rm -v "$(pwd)/firmware/esp32-csi-node:/project" -w /project \
  espressif/idf:v5.4 bash -c \
  "rm -rf build sdkconfig && \
   cp sdkconfig.defaults.4mb sdkconfig.defaults && \
   idf.py set-target esp32s3 && idf.py build"

Note: AMOLED display support (ADR-045) is disabled in the 4MB build since the display assets require the SPIFFS partition only available on 8MB boards. All CSI sensing features work identically.

Thanks to @sebbu for the community 4MB partition table and testing that proved this was feasible — it helped us prioritize this and get it into the official release! And thanks to @Jaap2740 for raising the request.

ruvnet avatar Mar 15 '26 15:03 ruvnet