
Octal and flash modes
The letters on an ESP32 board menu, DIO, QIO and OPI, count the data lines between the chip and its flash or PSRAM, which are two, four and eight. More lines read faster, and the setting has to match what the module really contains.
Lines are all the letters count. In esptool's table of flash modes, QIO puts the address and the data on four lines and is the fastest. DIO puts them on two and is about 45 percent slower. OPI, octal, puts the command, the address and the data on eight lines.
The menu is not the header
In the Arduino IDE's ESP32-S3 menu, "QIO 80MHz" sets the image header to DIO. The second-stage bootloader is what switches the flash to four lines. A DIO header in a build you labelled QIO is expected.
Two halves
For the ESP32-S3, the core names a memory type as the flash mode, an underscore, and the PSRAM type. qio_qspi is quad flash with quad PSRAM. qio_opi is quad flash with octal PSRAM, which is what an ESP32-S3-WROOM-1-N16R8 has: 16 MB of quad flash and 8 MB of octal PSRAM. dio_opi exists too and works, but it puts the flash on two lines instead of four. There is no opi_qspi.
The first half must match the module's flash and the second half its PSRAM. A wrong PSRAM half hangs at boot or fails to start the PSRAM.
The pins
On an ESP32-S3 the flash and PSRAM signals sit on GPIO26 to 32. On a module they are usually not brought out at all. Octal PSRAM takes more: the chip's datasheet gives it GPIO33 to 37, and the WROOM-1 datasheet footnotes GPIO35 to 37 as used. Which pins are free depends on the module.
Common mistakes
- Choosing the mode that sounds fastest. OPI flash on a module with quad flash is a mismatch, not an upgrade. Read the module's name and datasheet first.
- Leaving PSRAM at the quad default on an octal board. The board then reports no PSRAM at all. Set it to OPI, as the Arduino IDE setup page does.
- Using GPIO26 to 32, or 35 to 37, on a board with a module. Those pins are wired to the memory. Check the module's datasheet before using one.
Edit this page — content/fundamentals/spi/octal-and-flash-modes.mdx
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.