ESP32 boot loop when changing partition table using default_8M.csv

Thanks :-). There are no partitions greater than 3MB in the 8MB partition table quoted however?

I found some other threads which mentioned setting
board_upload.flash_size = 8MB
in platformio.ini, so I will try that when I have the relevant hardware available (currently only have 4MB with me).

1 Like


Was any solution ever found here?

I am having exactly the same issue with setting the partition table size explicitly for any partition size including the default that’s already on it.


I too am very interested in the solution to this problem. I have a custom board using the 16MB FLASH/ 8MB PSRAM variant of the ESP32 WROVER E module. I made a custom partitions file like this:

# Name,	    Type,	SubType,	Offset,	Size,	Flags
nvs,  	     data,	nvs,       0x9000,	 0x5000,	
otadata,     data,	ota,   	   0xe000,   0x2000,	
app0,	      app,	ota_0,	  0x10000, 0x600000,	
app1,	       app,	ota_1,	 0x610000, 0x600000,	
spiffs,	      data,	spiffs,	 0xc10000, 0x3e0000,
coredump,     data,	coredump,0xff0000,	0x10000

This worked and let me download some large builds for a long time. Then, the project started crashing and I built some debug code and uploaded it only to the get SW_RESET boot loop. After days of work, I found the sensitivity to the partition table and I now have a situation, like others on this thread, where a “Hello World” program gets in the SW_RESET boot loop if the OTA partitions are over 0x140000.

I can’t understand how this used to work and then stopped unless there was some change in PlatformIO recently that causes this for me.

What’s the content of the corresponding platformio.ini ?

You can specify the platform version to be used in platformio.ini to use an older version. If it worked with an earlier version, check this.

Example how to specify version 6.5.0:

  platform = espressif32 @ 6.5.0

You’ll find all available versions here PlatformIO Registry

A hardware defect could also be considered.
Double check it with an identical board.

Here it is:

platform = espressif32
board = esp-wrover-kit
framework = arduino
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
upload_protocol = esptool
upload_speed = 115200
upload_resetmethod = nodemcu
; upload_protocol = espota
; upload_port =
; upload_flags = --auth=admin
lib_extra_dirs =
lib_deps =
build_flags =
   ; -Wall
board_build.partitions = WROOM-E-n16r8.csv
;board_build.partitions = default.csv
board_build.flash_mode = qio
;board_build.f_flash = 40000000L
build_type = debug

The partition file I posted earlier is what is in WROOM-E-n16r8.csv.

I have tried 40 and 80 MHz flash frequency as well as qio and dio flash access modes with no change in behavior.

I just tried a different WROOM module with the same problem.

Ill try rolling back the platformio next.

But the used esp-wrover-kit.json is limited to 4 MB:

So you have to change this to 16 MB in your platformio.ini

board_upload.flash_size = "16MB"
board_upload.maximum_size = 16777216

By the way: Your platformio.ini is quite complex!

For testing purpose I highly recommend to create a seperate test project with just basic settings!
(Much easier to check what’s going on and why)

OK, so we’re getting somewhere here now.
When I ran out of flash space on my 4MB WROOM module, I moved up to the 16M WROVER module. I had no experience with board files and I tried to put a custom file in the boards folder under the espressif32 platform in my .platformio folder. The PlatformIO system didn’t find it there. So, I decided to modify an existing board file to get the WROVER module going. I eventually got that working and, of course, never got back to figuring out how to get my custom board file recognized by PlatformIO. Just today I came across your answer to mitchdetailed on the forum so I know where to put it now.

What must have happened was my custom board got overwritten on an update and that caused all of the trouble. I knew better than to modify that board file and expect it to be permanent, but when you’re desperate to get new hardware going, you sometimes cut corners. As good as the PlatformIO documentation is, I did not find what I needed there regarding custom board files.

After building a custom board file in a new boards folder in c:\Users\marc\Documents\PlatformIO, I am past the SW_RESET boot loop. This is with my original 16MB partition file. However, I have not rediscovered the magic to getting the external SPI PSRAM working. My call to psramInit() returns false.

My board file looks like this:

  "build": {
      "ldscript": "esp32_out.ld"
    "core": "esp32",
    "extra_flags": [
    "f_cpu": "240000000L",
    "f_flash": "80000000L",
    "flash_mode": "qio",
    "hwids": [
    "mcu": "esp32",
    "variant": "esp32"
  "connectivity": [
  "debug": {
    "default_tool": "ftdi",
    "onboard_tools": [
    "openocd_board": "esp32-wrover.cfg"
  "frameworks": [
  "name": "Espressif ESP32-WROVER-E 16MB",
  "upload": {
    "flash_size": "16MB",
    "maximum_ram_size": 327680,
    "maximum_size": 16777216,
    "protocols": [
    "require_upload_port": true,
    "speed": 460800
  "url": "",
  "vendor": "Espressif"

Do I need to modify the “upload” section’s maximum_ram_size attribute to something more than 327680?

I think it would be nice if PlatformIO had a tool in the build process that would sanity-check the board file against the partition file and catch mistakes like the one I made.

There are 3 possible locations :

  1. <homedir>/.platformio/platforms/espressif32/boards
  2. <homedir>/.platformio/boards
  3. <projectdir>/boards


  • homedir on windows is C:/users/<username> (should be similar on other systems)
  • 1: will be overridden / deleted on platform updates or might not be used when the project specifies a specific platform version
  • 2: will be global available to all your projects
  • 3: will be available only to the current project

See Custom Embedded Boards — PlatformIO latest documentation

No, leave this value. This is the integrated in package memory and must not be modified!

Your boards.json missing the information about how the PSRAM is connected.
I don’t know which exact board / module you’re using, so i assume it is an “ESP32-WROVER-E” or “ESP32-WROVER-IE”.
Regarding to the table on page 7 of the datasheet the flash and the PSRAM are using QUAD SPI.

Two changes in your boards.json are necessary:

  1. “memory_type” must be changed:
  "build": {
      "ldscript": "esp32_out.ld",
      "memory_type" : "qio_qspi"
  1. “psram_type” must be added:
    "flash_mode": "qio",
    "psram_type": "qio",

Thank you for the detailed help. I made those changes but I still don’t have an operational SPI RAM. Both WROVER modules I have been testing behave the same way so I’m assuming I still need to get the configuration right. Can you think of anything else I need to check?

Some of the discussions I’ve read from the forums include running

pio run -t menuconfig

to make changes to the partition table. If I try that, I just get an error

scons: *** Do not know how to make File target `menuconfig'

One other observation is that despite specifying the flash and psram modes as qio, the boot info seems to suggest dio:

ets Jul 29 2019 12:21:46

configsip: 0, SPIWP:0xee
mode:DIO, clock div:1
entry 0x400805f0

Is that unexpected?

“menuconfig” is not available for pure Arduino projects because Arduino is using a pre-compiled core. (Wrong track)

That’s the output of the first-stage bootloader and is absoloutely okay.
The issue must be somewhere else.

Since your project has a complex configuration, I’ll repeat myself and suggest using a simple and basic test project.

  • minimal platformio.ini using the default esp-wrover-kit
platform = espressif32
board = esp-wrover-kit
framework = arduino
monitor_speed = 115200
build_flags = 
  • minimal sketch
#include <Arduino.h>

void setup() {
    Serial.printf("PSRAM size: %d\r\n", ESP.getPsramSize());
    Serial.printf("PSRAM free: %d\r\n", ESP.getFreePsram());

void loop() {}

I’m working on your recommendation. Is there a global place to put partition files like we’ve done with board files?

Are there any other project configuration files to consider?

Per Espressif 32 — PlatformIO latest documentation user-defined partiton layouts must be placed in the root folder of the project.

I got the PSRAM recognized in the simple and complex sketches. The magic was to include the lines


in the build_flags section of the platformio.ini file. It appears that including them in the board file like this:

    "extra_flags" : [

is not effective.

That’s strange, because other built-in boards manifest and my own custom board manifest works without issues.