Overview

The W25Q32 (W25Q32JV / W25Q32FV) is a 32-Mbit (4 Megabyte) non-volatile SPI NOR serial flash memory IC manufactured by Winbond Electronics. Available in an 8-pin SOIC package or a 5-pin DIP breakout module, it provides external data storage for embedded microcontrollers without SD card slot overhead.

Supporting Standard SPI, Dual-SPI, and Quad-SPI at clock frequencies up to 104 MHz (transfer rates up to 416 Mbits/sec416\text{ Mbits/sec} in Quad-SPI mode), the W25Q32 is widely used for storing web server HTML files, UI graphic assets, firmware binaries (OTA updates), audio samples, and file systems (LittleFS, SPIFFS, FATFS) on ESP32, STM32, RP2040, and Arduino boards.

Quick reference

Operating voltage (VCC)2.7 V to 3.6 V DC (3.3 V nominal)
Capacity32 Mbits (4,194,304 Bytes/4 MB4,194,304\text{ Bytes} / 4\text{ MB})
InterfaceStandard SPI, Dual-SPI, Quad-SPI (Mode 0,0 & Mode 3,3)
Max SPI Clock104 MHz (Dual SPI equivalent 208 MHz, Quad SPI equivalent 416 MHz)
Sector erase size4 KB uniform sectors (1,024 sectors1,024\text{ sectors} total)
Block erase size32 KB & 64 KB blocks (64 blocks64\text{ blocks} of 64KB)
Page program size256 bytes per page (16,384 pages16,384\text{ pages} total)
Endurance & Retention100,000 erase/program cycles / 20-year data retention
Operating current4.0 mA4.0\text{ mA} active read / 1.0 μA1.0\ \mu\text{A} power-down

Pinout (8-Pin SOIC Package & Module Header)

text
             ┌───┴───┐
         /CS ─┤ 1   8├─ VCC
      DO(IO1)─┤ 2   7├─ /HOLD(IO3)
     /WP(IO2)─┤ 3   6├─ CLK
         GND ─┤ 4   5├─ DI(IO0)
             └───────┘
Pin LabelNameTypeDescription
1/CSDigital InputActive-Low SPI Chip Select
2DO (IO1)Digital OutputSPI Serial Data Output / Dual & Quad I/O Pin 1
3/WP (IO2)Digital InputActive-Low Write Protect / Quad I/O Pin 2
4GNDPowerGround reference (0 V)
5DI (IO0)Digital InputSPI Serial Data Input / Dual & Quad I/O Pin 0
6CLKDigital InputSPI Serial Clock
7/HOLD (IO3)Digital InputActive-Low Pause/Hold / Quad I/O Pin 3
8VCCPowerSupply power input (+2.7 V to +3.6 V DC)

Specifications

ParameterSymbolMinTypMaxUnitConditions
Supply VoltageVCCV_{CC}2.73.33.6VDC
Active Read CurrentICC1I_{CC1}4.010.0mAfCLK=50 MHzf_{CLK} = 50\text{ MHz}
Program/Erase CurrentICC3I_{CC3}15.025.0mAPage program or sector erase
Power-Down CurrentIpdI_{pd}1.05.0µADeep power-down command (0xB9)
Page Program TimetPPt_{PP}0.73.0ms256 bytes page program
Sector Erase Time (4KB)tSEt_{SE}45400ms4 KB sector erase
Block Erase Time (64KB)tBEt_{BE}1501000ms64 KB block erase

Common SPI Command Instructions

Instruction NameOpcode (Hex)Description
Write Enable0x06Sets the Write Enable Latch (WEL) bit prior to write/erase
Read Status Register-10x05Reads BUSY flag (Bit 0) and WEL flag (Bit 1)
Read Data0x03Reads continuous data bytes starting at 24-bit address
Page Program0x02Writes up to 256 bytes into a single page
Sector Erase (4KB)0x20Erases a 4 KB sector (resets all bits to 0xFF)
Read JEDEC ID0x9FReturns Manufacturer ID (0xEF) and Memory Type (0x4016)
Important

Flash Memory Erase Rule:

  • In NOR flash memory, programming can only change bits from 1 to 0. Changing bits from 0 back to 1 requires performing a Sector Erase (0x20) or Block Erase, which resets all bytes in that 4 KB sector to 0xFF.

Wiring

W25Q32 PinArduino (via Level Shifter)ESP32Notes
VCC3.3V Rail3.3VDo not connect to 5V
GNDGNDGNDSystem ground
/CSDigital D10GPIO 5SPI Chip Select
CLKDigital D13GPIO 18SPI Clock
DI (MOSI)Digital D11GPIO 23SPI MOSI
DO (MISO)Digital D12GPIO 19SPI MISO
/WP & /HOLD3.3V3.3VPull High to disable write protect & hold

Example (Arduino Adafruit_SPIFlash Library)

cpp
#include <SPI.h>
#include "Adafruit_SPIFlash.h"

// Hardware SPI with CS on pin 5
Adafruit_FlashTransport_SPI flashTransport(5, SPI);
Adafruit_SPIFlash flash(&flashTransport);

void setup() {
  Serial.begin(115200);
  while (!Serial) delay(10);

  Serial.println("W25Q32 SPI Flash Memory Test");

  if (!flash.begin()) {
    Serial.println("Could not find W25Q32 flash chip! Check SPI wiring.");
    while (1);
  }

  Serial.print("Flash chip JEDEC ID: 0x");
  Serial.println(flash.getJEDECID(), HEX);
  Serial.print("Flash size: ");
  Serial.print(flash.size() / 1024 / 1024);
  Serial.println(" MB");
}

void loop() {
  // Read first 16 bytes of sector 0
  uint8_t buffer[16];
  flash.readBuffer(0, buffer, sizeof(buffer));

  Serial.print("First 16 Bytes: ");
  for (int i = 0; i < 16; i++) {
    Serial.print(buffer[i], HEX); Serial.print(" ");
  }
  Serial.println();

  delay(5000);
}

Common mistakes

  • Connecting 5V logic directly to SPI pins: The W25Q32 operates strictly at 3.3V logic. Connecting 5V SPI lines directly damages the IC. Use level shifters for 5V microcontrollers.
  • Writing without erasing first: Attempting to write new data over non-erased flash memory results in corrupted data, as 0 bits cannot be flipped back to 1 without a 4KB Sector Erase.

Notes

  • Winbond W25Q Series Capacity: W25Q16 (16 Mbit / 2 MB), W25Q32 (32 Mbit / 4 MB), W25Q64 (64 Mbit / 8 MB), W25Q128 (128 Mbit / 16 MB).

Assets & downloads