ESP32 - moved to 16MB version, added default 16MB partition in PIO.INI program crashes

I’ve cloned my project to start using a 16MB ESP32 WROOM instead of the 4MB.
If I compile and flash using the default partition table the 16MB module works fine ( as per 4MB module).
If I add the default 8MB or default 16MB table then the program crashes.

What should I be looking for?
This is the Error ( repeating continuously)

rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13232
load:0x40080400,len:3028
entry 0x400805e4
ets Jul 29 2019 12:21:46

This is the PIO.INI.
The ONLY difference between a working project is the board_build_partitions line being included or not included.
The new module DOES have 16MB as I’ve checked the memory using (ESP.getFlashChipSize());
as well as the module marking.

[env:esp-wrover-kit]
platform = espressif32
board = esp-wrover-kit
board_build.partitions = default_8MB.csv
framework = arduino
lib_deps = 
	contrem/arduino-timer@^2.2.0
	sparkfun/SparkFun AS3935 Lightning Detector Arduino Library@^1.4.3
	ayushsharma82/AsyncElegantOTA@^2.2.7
	hieromon/AutoConnect@^1.3.4
	adafruit/Adafruit SSD1306@^2.5.7
	r89m/r89m PushButton@^1.0.1
	adafruit/Adafruit GC9A01A@^1.1.0
monitor_speed = 115200
upload_port = COM13
monitor_port = COM13

I have the same issue while using custom board config for esp-wrover-e 16mb Flash
esp32_wrover_e.json

{
        "build": {
                "arduino": {
                        "ldscript": "esp32_out.ld"
                },
                "core": "esp32",
                "extra_flags": "-DARDUINO_ESP32_DEV",
                "f_cpu": "240000000L",
                "f_flash": "40000000L",
                "flash_mode": "dio",
                "mcu": "esp32",
                "variant": "esp32",
                "partitions": "partition.csv"
        },
        "connectivity": [
                "wifi",
                "bluetooth",
                "ethernet",
                "can"
        ],
        "debug": {
                "openocd_board": "esp-wroom-32.cfg"
        },
        "frameworks": [
                "arduino",
                "espidf"
        ],
        "name": "Espressif ESP32-WROVER-E Module",
        "upload": {
                "flash_size": "16MB",
                "maximum_size": 16777216,
                "maximum_ram_size": 327680,
                "require_upload_port": true,
                "speed": 460800
        },
        "url": "https://en.wikipedia.org/wiki/ESP32",
        "vendor": "Espressif"
}

platform.ini

[env:esp32_wrover_e]
platform = espressif32@3.4.0
board = esp32_wrover_e
framework = arduino
monitor_speed = 115200
board_upload.filesystem = spiffs
extra_scripts = 
	pre:pre_build.py
	post:after_build_tasks.py
debug_tool = esp-prog
monitor_port = /dev/cu.usbserial-54790243931
upload_protocol = esp-prog
debug_init_break = tbreak setup

and using this partition

# Name,   Type, SubType, Offset,  Size, Flags
nvs,      data, nvs,     0x9000,  0x5000,
otadata,  data, ota,     0xe000,  0x2000,
app0,     app,  ota_0,   0x10000, 0x640000,
app1,     app,  ota_1,   0x650000,0x640000,
spiffs,   data, spiffs,  0xc90000,0x360000,
coredump, data, coredump,0xFF0000,0x10000,

Please correct me if I’m wrong here, but I seem to recall that the ESP32 has a 4MB memory window limit.

Try reducing the app partitions from 6.25MB to 4MB and see if the error still occurs.

Hi rob,
I have the same issue while I using ESP-WROOM-32UE 16MB flash. Do you find the solution of this?

hi,i meet the same problem,did you solve it ? :grinning:

You probably have a similar problem, but completely different conditions.
Please post the contents of your platformio.ini!

My actual development board is ESP32S3N16R2 , which is different from adafruit_feather_esp32s3 . Could the board selection be the issue? Even though I’ve already specified flash_size = 16MB , I still get an error.

[env:adafruit_feather_esp32s3]
platform = espressif32
board = adafruit_feather_esp32s3
framework = arduino
board_build.partitions = partition.csv
board_build.flash_size = 16MB
monitor_speed = 115200
board_build.f_cpu = 240000000L
board_build.flash_mode = qio
build_flags =
  -DARDUINO_USB_CDC_ON_BOOT=1
  -DARDUINO_USB_MODE=1
  -DBOARD_HAS_PSRAM
  -mfix-esp32-psram-cache-issue
  -D CHAPPIE_CORE_LVGL_USE_PSRAM=1
  -D LV_LVGL_H_INCLUDE_SIMPLE=1
  -D LV_CONF_INCLUDE_SIMPLE=1
  -O2
  -I src
  -I src/ChappieCore/lv_porting
  -I .pio/libdeps/${PIOENV}/lvgl/src
  -I .pio/libdeps/${PIOENV}/lvgl/src/hal
  -I src/ChappieCore/gui/custom
  -I src/ChappieCore/gui/generated
  -DCORE_DEBUG_LEVEL=6
lib_deps =
  lovyan03/LovyanGFX@^1.2.7
  lvgl/lvgl@^8.3.1

and while change the official partition table will still report an error,

Processing adafruit_feather_esp32s3 (platform: espressif32; board: adafruit_feather_esp32s3; framework: arduino)
----------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/adafruit_feather_esp32s3.html
PLATFORM: Espressif 32 (6.12.0) > Adafruit Feather ESP32-S3 2MB PSRAM
HARDWARE: ESP32S3 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.20017.241212+sha.dcc1105b 
 - tool-esptoolpy @ 2.40900.250804 (4.9.0) 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 35 compatible libraries
Scanning dependencies...
Dependency Graph
|-- LovyanGFX @ 1.2.7
|-- lvgl @ 8.4.0
|-- FS @ 2.0.0

This is a complex configuration with many potential sources of error! To find the cause of the error, please use a simple “Hello World” sketch with the simplest possible configuration.

Which board do you have exactly?

The correct configuration for an ESP32-S3-N16R2 is

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino

board_build.arduino.memory_type = qio_qspi
board_build.flash_mode = qio
board_build.psram_type = qio
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
board_build.partitions = default_16MB.csv
board_build.extra_flags = 
  -DBOARD_HAS_PSRAM

Additionally you can set a different or custom partition table as well as other flags like

  -DARDUINO_USB_CDC_ON_BOOT=1
  -DARDUINO_USB_MODE=1

and so on.

The ESP32-S3 doesn’t need -mfix-esp32-psram-cache-issue!

No error is shown there.
But the log seems to be incomplete.

i have esp32s3n16r2, I used the configuration you provided and selected the esp32-s3-devkitc-1 development board environment configuration, and it worked successfully. Was this indeed an issue with the development board environment selection? Previously, I created a new project with the esp32s3box environment, created a new partition file, and flashed it onto the same ESP32S3N16R2 module, but the program would crash. Or, if I used a different development board environment configuration, such as esp32s3n16r8 , the program would run correctly after adding the partition, but it couldn’t find the specified PSRAM.

The esp32s3box is using a different PSRAM configuration (octal). That’s the reason why it crashes instantly when the PSRAM is enabled.