Skip to content

Hardware Setup

bobberdolle1 edited this page Jan 7, 2026 · 5 revisions

Hardware Setup

🇷🇺 Русская версия


OpenFlash supports multiple microcontroller platforms and flash interfaces:

Supported Platforms

Platform USB WiFi Speed Cost Notes
RP2040 (Pico) Medium ~$4 Best for beginners
RP2350 (Pico 2) High ~$5 Enhanced PIO, NV-DDR
STM32F1 (Blue Pill) Low ~$2 Ultra-budget
STM32F4 (Black Pill) High ~$5 Best MCU performance
STM32H747 (Arduino GIGA) Very High ~$60 Enterprise features
ESP32 UART/USB Medium ~$4 Wireless operation
Teensy 4.0 ✅ HS Fastest ~$20 USB 480Mbps! ⚡
Teensy 4.1 ✅ HS Fastest ~$27 + SD card slot ⚡
Raspberry Pi (SBC) N/A Very High ~$35-75 Linux GPIO, headless
Orange Pi (SBC) N/A High ~$15-50 Budget SBC option
Banana Pi (SBC) N/A High ~$15-35 RPi alternative 🍌

Flash Interfaces

OpenFlash supports three NAND flash interfaces:

  • Parallel NAND - Traditional 8-bit parallel interface
  • SPI NAND - Serial Peripheral Interface (4-wire SPI)
  • eMMC - Embedded MultiMediaCard via SPI mode

Parallel NAND Flash

TSOP-48 Pinout

Standard TSOP-48 NAND flash pinout:

        ┌──────────────────────┐
    NC ─┤ 1                 48 ├─ NC
    NC ─┤ 2                 47 ├─ NC
   GND ─┤ 3                 46 ├─ NC
   VCC ─┤ 4                 45 ├─ NC
    NC ─┤ 5                 44 ├─ NC
    NC ─┤ 6                 43 ├─ NC
   GND ─┤ 7                 42 ├─ NC
    NC ─┤ 8                 41 ├─ NC
    NC ─┤ 9                 40 ├─ NC
    NC ─┤ 10                39 ├─ NC
    NC ─┤ 11                38 ├─ NC
   GND ─┤ 12                37 ├─ VCC
   VCC ─┤ 13                36 ├─ GND
    NC ─┤ 14                35 ├─ NC
   WP# ─┤ 15                34 ├─ NC
    NC ─┤ 16                33 ├─ NC
   CE# ─┤ 17                32 ├─ NC
   GND ─┤ 18                31 ├─ GND
    NC ─┤ 19                30 ├─ NC
   CLE ─┤ 20                29 ├─ I/O7
   ALE ─┤ 21                28 ├─ I/O6
   WE# ─┤ 22                27 ├─ I/O5
   RE# ─┤ 23                26 ├─ I/O4
  R/B# ─┤ 24                25 ├─ VCC
        └──────────────────────┘

Note: Pinout varies by manufacturer. Always check your chip's datasheet!

Raspberry Pi Pico (RP2040)

Parallel NAND Pinout

NAND Signal Pico Pin GPIO
CLE Pin 1 GP0
ALE Pin 2 GP1
WE# Pin 4 GP2
RE# Pin 5 GP3
CE# Pin 6 GP4
R/B# Pin 7 GP5
D0 Pin 9 GP6
D1 Pin 10 GP7
D2 Pin 11 GP8
D3 Pin 12 GP9
D4 Pin 14 GP10
D5 Pin 15 GP11
D6 Pin 16 GP12
D7 Pin 17 GP13
GND Pin 3,8 GND
VCC (3.3V) Pin 36 3V3

SPI NAND Pinout (v1.1+)

SPI Signal Pico Pin GPIO Description
MISO (DO) Pin 21 GP16 Data Out
CS# Pin 22 GP17 Chip Select
SCK Pin 24 GP18 Clock
MOSI (DI) Pin 25 GP19 Data In
GND Pin 23 GND Ground
VCC (3.3V) Pin 36 3V3 Power

Wiring Diagram (Parallel NAND)

Raspberry Pi Pico              NAND Flash
┌─────────────────┐           ┌──────────┐
│ GP0  (Pin 1)  ──┼───────────┼── CLE    │
│ GP1  (Pin 2)  ──┼───────────┼── ALE    │
│ GP2  (Pin 4)  ──┼───────────┼── WE#    │
│ GP3  (Pin 5)  ──┼───────────┼── RE#    │
│ GP4  (Pin 6)  ──┼───────────┼── CE#    │
│ GP5  (Pin 7)  ──┼───────────┼── R/B#   │
│ GP6  (Pin 9)  ──┼───────────┼── D0     │
│ GP7  (Pin 10) ──┼───────────┼── D1     │
│ GP8  (Pin 11) ──┼───────────┼── D2     │
│ GP9  (Pin 12) ──┼───────────┼── D3     │
│ GP10 (Pin 14) ──┼───────────┼── D4     │
│ GP11 (Pin 15) ──┼───────────┼── D5     │
│ GP12 (Pin 16) ──┼───────────┼── D6     │
│ GP13 (Pin 17) ──┼───────────┼── D7     │
│ 3V3  (Pin 36) ──┼───────────┼── VCC    │
│ GND  (Pin 3)  ──┼───────────┼── GND    │
└─────────────────┘           └──────────┘

Wiring Diagram (SPI NAND)

Raspberry Pi Pico              SPI NAND Flash
┌─────────────────┐           ┌──────────────┐
│ GP16 (Pin 21) ──┼───────────┼── DO (MISO)  │
│ GP17 (Pin 22) ──┼───────────┼── CS#        │
│ GP18 (Pin 24) ──┼───────────┼── CLK        │
│ GP19 (Pin 25) ──┼───────────┼── DI (MOSI)  │
│ 3V3  (Pin 36) ──┼───────────┼── VCC        │
│ GND  (Pin 23) ──┼───────────┼── GND        │
│                 │           │              │
│ (Optional QSPI) │           │              │
│ GP20 (Pin 26) ──┼───────────┼── IO2/WP#    │
│ GP21 (Pin 27) ──┼───────────┼── IO3/HOLD#  │
└─────────────────┘           └──────────────┘

Note: For Quad SPI (QSPI) mode, connect IO2 and IO3 pins. Standard SPI mode only requires 4 wires.

STM32F103 (Blue Pill)

Pinout

NAND Signal Blue Pill GPIO
CLE PA0 PA0
ALE PA1 PA1
WE# PA2 PA2
RE# PA3 PA3
CE# PA4 PA4
R/B# PA5 PA5
D0-D7 PB0-PB7 PB0-7
GND GND GND
VCC (3.3V) 3.3V 3V3

Important Notes

⚠️ Voltage Warning

  • NAND flash operates at 3.3V
  • Never connect 5V to NAND pins
  • Both Pico and Blue Pill are 3.3V, so direct connection is safe

Pull-up Resistors

  • R/B# (Ready/Busy) needs a 10kΩ pull-up to VCC
  • Some chips have internal pull-ups, but external is recommended

Decoupling Capacitors

  • Add 100nF capacitor between VCC and GND near the NAND chip
  • Helps with signal integrity

Signal Integrity

  • Keep wires short (< 10cm)
  • Use twisted pairs for data lines if possible
  • Ground plane helps reduce noise
  • For SPI NAND: keep clock line short and away from data lines

SPI NAND Specific Notes

SPI NAND Package Types

  • WSON-8 (8-pin, 8x6mm) - Most common
  • USON-8 (8-pin, 4x4mm) - Smaller variant
  • TFBGA (24-ball) - For multi-die packages

SPI NAND Pinout (WSON-8)

        ┌─────────────┐
   CS# ─┤ 1       8 ├─ VCC
    DO ─┤ 2       7 ├─ HOLD#
   WP# ─┤ 3       6 ├─ CLK
   GND ─┤ 4       5 ├─ DI
        └─────────────┘

SPI Mode

  • SPI NAND uses Mode 0 (CPOL=0, CPHA=0)
  • Clock idle low, data sampled on rising edge
  • Maximum clock typically 80-133 MHz

TSOP-48 Adapter

For easier connections, use a TSOP-48 breakout board:

  • Search "TSOP48 adapter" on AliExpress/eBay
  • Provides easy access to all pins
  • Some include ZIF socket for chip removal

Next Steps


ESP32 (v1.5+)

The ESP32 series provides WiFi/BLE connectivity for wireless flash operations.

ESP32 SPI NAND Pinout

SPI Signal ESP32 Pin GPIO Description
SCK VSPI CLK GPIO18 Clock
MISO (DO) VSPI MISO GPIO19 Data Out
MOSI (DI) VSPI MOSI GPIO23 Data In
CS# - GPIO5 Chip Select
GND GND GND Ground
VCC (3.3V) 3.3V 3V3 Power

ESP32 Wiring Diagram (SPI NAND)

ESP32                      SPI NAND Flash
┌─────────────────┐       ┌──────────────┐
│ GPIO18 (CLK)  ──┼───────┼── CLK        │
│ GPIO19 (MISO) ──┼───────┼── DO         │
│ GPIO23 (MOSI) ──┼───────┼── DI         │
│ GPIO5  (CS)   ──┼───────┼── CS#        │
│ 3.3V          ──┼───────┼── VCC        │
│ GND           ──┼───────┼── GND        │
└─────────────────┘       └──────────────┘

ESP32 WiFi Mode

  1. Flash the ESP32 firmware
  2. Connect to "OpenFlash-XXXX" WiFi AP
  3. Open http://192.168.4.1 in browser
  4. Or configure to connect to your WiFi network

STM32F4 (Black Pill) (v1.5+)

The STM32F4 series offers higher performance with native USB OTG.

STM32F4 SPI NAND Pinout

SPI Signal Black Pill GPIO Description
SCK PA5 PA5 Clock
MISO (DO) PA6 PA6 Data Out
MOSI (DI) PA7 PA7 Data In
CS# PA4 PA4 Chip Select
GND GND GND Ground
VCC (3.3V) 3.3V 3V3 Power

STM32F4 Wiring Diagram (SPI NAND)

STM32F4 (Black Pill)       SPI NAND Flash
┌─────────────────┐       ┌──────────────┐
│ PA5  (SCK)    ──┼───────┼── CLK        │
│ PA6  (MISO)   ──┼───────┼── DO         │
│ PA7  (MOSI)   ──┼───────┼── DI         │
│ PA4  (CS)     ──┼───────┼── CS#        │
│ 3.3V          ──┼───────┼── VCC        │
│ GND           ──┼───────┼── GND        │
└─────────────────┘       └──────────────┘

STM32F4 Advantages

  • Faster: Up to 180MHz vs 72MHz (STM32F1)
  • Native USB OTG: Better USB performance
  • FSMC: Hardware parallel NAND controller (F446)
  • More RAM: 128KB vs 20KB

Raspberry Pi Pico 2 (RP2350) (v2.3+)

The RP2350 is the successor to RP2040 with improved performance.

RP2350 Advantages

  • Faster cores: Dual Cortex-M33 @ 150MHz (vs M0+ @ 133MHz)
  • More RAM: 520KB SRAM (vs 264KB)
  • Enhanced PIO: Better timing for NV-DDR NAND
  • Security: ARM TrustZone, secure boot
  • RISC-V option: Can run Hazard3 RISC-V cores

RP2350 SPI NAND Pinout

Same as RP2040 - direct pin compatibility:

SPI Signal Pico 2 Pin GPIO Description
MISO (DO) Pin 21 GP16 Data Out
CS# Pin 22 GP17 Chip Select
SCK Pin 24 GP18 Clock
MOSI (DI) Pin 25 GP19 Data In
GND Pin 23 GND Ground
VCC (3.3V) Pin 36 3V3 Power

RP2350 Parallel NAND with NV-DDR

For high-speed NV-DDR NAND (up to 400MT/s):

Signal Pico 2 Pin GPIO Description
DQS Pin 26 GP20 Data Strobe
RE_N Pin 27 GP21 Read Enable
DQ0-7 Pin 9-17 GP6-13 Data Bus

Raspberry Pi SBC (v2.3+)

Use a full Raspberry Pi as a flash programmer via GPIO.

Supported Models

Model SoC GPIO Speed Notes
Pi 3B+ BCM2837B0 Medium Good balance
Pi 4 BCM2711 High Recommended
Pi 5 BCM2712 Very High Best performance
Zero 2W BCM2710A1 Medium Compact

Raspberry Pi GPIO Pinout (SPI NAND)

Uses hardware SPI (SPI0):

SPI Signal Pi Pin BCM GPIO Description
MISO (DO) Pin 21 GPIO9 Data Out
MOSI (DI) Pin 19 GPIO10 Data In
SCK Pin 23 GPIO11 Clock
CS# Pin 24 GPIO8 Chip Select
GND Pin 6 GND Ground
VCC (3.3V) Pin 1 3V3 Power

Raspberry Pi Wiring Diagram (SPI)

Raspberry Pi                SPI NAND Flash
┌─────────────────┐        ┌──────────────┐
│ GPIO9  (Pin 21) ──┼──────┼── DO (MISO)  │
│ GPIO10 (Pin 19) ──┼──────┼── DI (MOSI)  │
│ GPIO11 (Pin 23) ──┼──────┼── CLK        │
│ GPIO8  (Pin 24) ──┼──────┼── CS#        │
│ 3.3V   (Pin 1)  ──┼──────┼── VCC        │
│ GND    (Pin 6)  ──┼──────┼── GND        │
└─────────────────┘        └──────────────┘

Raspberry Pi Parallel NAND Pinout

NAND Signal Pi Pin BCM GPIO
D0-D7 Various GPIO2-9
CLE Pin 11 GPIO17
ALE Pin 13 GPIO27
WE# Pin 15 GPIO22
RE# Pin 16 GPIO23
CE# Pin 18 GPIO24
R/B# Pin 22 GPIO25

Running on Raspberry Pi

# Install driver
cargo install openflash-firmware-raspberry-pi

# Run as daemon (requires root for GPIO)
sudo openflash-gpio

# Connect from desktop app via network
# Or use local Unix socket

Arduino GIGA R1 WiFi (v2.3+)

The most powerful Arduino platform for enterprise flash operations.

Arduino GIGA Specifications

  • MCU: STM32H747 dual-core
    • Cortex-M7 @ 480MHz (main)
    • Cortex-M4 @ 240MHz (WiFi/BLE)
  • RAM: 1MB
  • Flash: 2MB
  • USB: OTG HS (480Mbps)
  • Connectivity: WiFi + BLE (Murata)

Arduino GIGA SPI Pinout

SPI Signal GIGA Pin STM32 Pin Description
SCK D13 PA5 Clock
MISO D12 PA6 Data Out
MOSI D11 PA7 Data In
CS# D10 PA4 Chip Select
GND GND GND Ground
VCC (3.3V) 3.3V 3V3 Power

Arduino GIGA FMC Parallel NAND

The STM32H747 has a Flexible Memory Controller (FMC) for hardware-accelerated parallel NAND:

NAND Signal GIGA Pin FMC Signal
D0-D15 D22-D37 FMC_D0-15
ALE D38 FMC_A17
CLE D39 FMC_A16
CE# D40 FMC_NCE
WE# D41 FMC_NWE
RE# D42 FMC_NOE
R/B# D43 FMC_NWAIT

Arduino GIGA Advantages

  • Hardware ECC: FMC has built-in ECC calculation
  • 16-bit bus: Native x16 NAND support
  • HS200 eMMC: High-speed eMMC via SDMMC
  • WiFi control: Remote operation via WiFi

Orange Pi (v2.3+)

Budget SBC option for flash programming.

Supported Models

Model SoC GPIO Cost Notes
Zero 3 Allwinner H618 26-pin ~$20 Best value
Zero 2W Allwinner H616 26-pin ~$18 Pi Zero form factor
5 Rockchip RK3588 26-pin ~$50 High performance

Orange Pi SPI Pinout

SPI Signal OPi Pin GPIO Description
MISO Pin 21 PC0 Data Out
MOSI Pin 19 PC2 Data In
SCK Pin 23 PC1 Clock
CS# Pin 24 PC3 Chip Select
GND Pin 6 GND Ground
VCC (3.3V) Pin 1 3V3 Power

Running on Orange Pi

# Install driver
cargo install openflash-firmware-orange-pi

# Run as daemon (requires root for /dev/mem)
sudo openflash-gpio

# Connect from desktop app via network

Orange Pi Notes

  • GPIO libraries vary by SoC (Allwinner vs Rockchip)
  • Memory-mapped GPIO requires root access
  • SPI via /dev/spidev is more portable

Teensy 4.0/4.1 (v2.3.5+) ⚡

The Teensy 4.x series offers USB High Speed (480 Mbit/s) for dramatically faster transfers.

Teensy 4.x Specifications

Feature Teensy 4.0 Teensy 4.1
MCU NXP i.MX RT1062 NXP i.MX RT1062
Speed 600 MHz Cortex-M7 600 MHz Cortex-M7
RAM 1MB 1MB
Flash 2MB 8MB
USB High Speed 480Mbps High Speed 480Mbps
SD Card ✅ Built-in slot
Ethernet ✅ (with adapter)
Price ~$20 ~$27

Why Teensy 4.x?

  • 10-20x faster transfers: USB HS vs USB FS (480 vs 12 Mbit/s)
  • 1GB dump in 3-5 minutes instead of 45 minutes!
  • 600 MHz CPU: Soft ECC (BCH-16/24) on-the-fly without speed loss
  • FlexIO: Programmable I/O for precise NV-DDR timing
  • Logic analyzer mode: Debug unknown chips at 24 MHz sample rate
  • Teensy 4.1 SD card: Autonomous operation without PC

Teensy 4.x SPI NAND Pinout

SPI Signal Teensy Pin Description
SCK Pin 13 Clock
MISO (DO) Pin 12 Data Out
MOSI (DI) Pin 11 Data In
CS# Pin 10 Chip Select
GND GND Ground
VCC (3.3V) 3.3V Power

Teensy 4.x Parallel NAND Pinout

NAND Signal Teensy Pin Description
D0-D7 Pin 2-9 Data Bus
CLE Pin 10 Command Latch
ALE Pin 11 Address Latch
WE# Pin 12 Write Enable
RE# Pin 24 Read Enable
CE# Pin 25 Chip Enable
R/B# Pin 26 Ready/Busy (input)

Teensy 4.x Wiring Diagram (SPI)

Teensy 4.0/4.1              SPI NAND Flash
┌─────────────────┐        ┌──────────────┐
│ Pin 13 (SCK)  ──┼────────┼── CLK        │
│ Pin 12 (MISO) ──┼────────┼── DO         │
│ Pin 11 (MOSI) ──┼────────┼── DI         │
│ Pin 10 (CS)   ──┼────────┼── CS#        │
│ 3.3V          ──┼────────┼── VCC        │
│ GND           ──┼────────┼── GND        │
└─────────────────┘        └──────────────┘

Teensy 4.1 SD Card Mode

Teensy 4.1 can operate autonomously:

  1. Insert SD card
  2. Press button to start dump
  3. Dump saved directly to SD card
  4. No PC required!

Flashing Teensy Firmware

# Build firmware
cd openflash/firmware/teensy4
cargo build --release --target thumbv7em-none-eabihf --features teensy41

# Flash via Teensy Loader
teensy_loader_cli --mcu=TEENSY41 -w target/thumbv7em-none-eabihf/release/openflash-firmware-teensy4.hex

# Or use Teensy Loader GUI (press button on Teensy)

Banana Pi (v2.3.5+) 🍌

Budget SBC alternative to Raspberry Pi and Orange Pi.

Supported Models

Model SoC Architecture GPIO Cost Notes
M2 Zero Allwinner H3 ARM Cortex-A7 40-pin ~$15 RPi Zero form factor
M4 Berry Allwinner H618 ARM Cortex-A53 40-pin ~$25 RPi 4 alternative
BPI-F3 SpacemiT K1 RISC-V 40-pin ~$35 RISC-V enthusiast!

Banana Pi Advantages

  • Lower cost than Raspberry Pi
  • Better availability in some regions
  • RISC-V option (BPI-F3) for enthusiasts
  • Hardware SPI for fast SPI NAND/NOR operations

Banana Pi Limitations

  • Parallel NAND not recommended: Linux timing constraints
  • Best for SPI interfaces: SPI NAND, SPI NOR, eMMC
  • Requires root for GPIO access

Banana Pi SPI Pinout

SPI Signal BPi Pin GPIO Description
MISO Pin 21 PA16 Data Out
MOSI Pin 19 PA15 Data In
SCK Pin 23 PA14 Clock
CS# Pin 24 PA13 Chip Select
GND Pin 6 GND Ground
VCC (3.3V) Pin 1 3V3 Power

Banana Pi Wiring Diagram (SPI)

Banana Pi                   SPI NAND Flash
┌─────────────────┐        ┌──────────────┐
│ PA16 (Pin 21) ──┼────────┼── DO (MISO)  │
│ PA15 (Pin 19) ──┼────────┼── DI (MOSI)  │
│ PA14 (Pin 23) ──┼────────┼── CLK        │
│ PA13 (Pin 24) ──┼────────┼── CS#        │
│ 3.3V (Pin 1)  ──┼────────┼── VCC        │
│ GND  (Pin 6)  ──┼────────┼── GND        │
└─────────────────┘        └──────────────┘

Running on Banana Pi

# Build driver
cd openflash/firmware/banana_pi
cargo build --release

# Run as daemon (requires root)
sudo ./target/release/openflash-gpio

# For remote access
sudo ./target/release/openflash-gpio --tcp 0.0.0.0:5000

# Connect from desktop app via network

Banana Pi BPI-F3 (RISC-V)

The BPI-F3 uses SpacemiT K1 RISC-V SoC:

  • First RISC-V board supported by OpenFlash!
  • GPIO access via /dev/mem or libgpiod
  • SPI via /dev/spidev0.0
  • Great for RISC-V enthusiasts

Next Steps

Clone this wiki locally