nander-rs
๐ฆ A modern SPI NAND/NOR Flash programmer written in Rust
A complete rewrite of SNANDer in Rust, designed for maximum portability and reliability.
โจ Features
- Pure Rust USB - Uses
nusbfor native USB communication, nolibusbDLL required - Cross-platform - Works on Windows, Linux, and macOS
- Single binary - No runtime dependencies, just one executable
- Memory safe - Rust's ownership system prevents buffer overflows and memory corruption
- Rich CLI - Modern command-line interface with progress bars and clear error messages
- Cross-platform GUI - Intuitive graphical interface for interactive flash operations
- Extensible - Trait-based architecture makes it easy to add new programmers or chips
๐ Supported Hardware
Programmers
- CH341A - The ubiquitous USB-SPI programmer (fully supported)
- More programmers can be added by implementing the
Programmertrait
Flash Types
- SPI NAND - Full support including OOB/spare area and bad block management
- SPI NOR - Standard JEDEC SPI NOR flash
Chips
See src/database/chips.rs for the full list. Common chips include:
- GigaDevice: GD5F1GQ5UEYIG, GD25Q128C, etc.
- Winbond: W25N01GV, W25Q128JV, etc.
- Macronix: MX35LF1GE4AB, MX25L12833F, etc.
- Micron: MT29F1G01, etc.
- XTX, FORESEE, and more...
๐ฆ Installation
From Source
Pre-built Binaries
Download from the Releases page.
๐ Usage
Launch Graphical User Interface
Detect Flash Chip (CLI)
Output includes JEDEC ID, chip details, and for NAND chips, ECC status.
List Supported Chips
Read Flash to File
Write File to Flash
Erase Flash
Verify Flash
ECC Control (NAND only)
The -d / --no-ecc flag disables internal ECC for raw operations:
- Reads full page data including ECC bytes
- Useful for complete flash dumps including OOB area
- Required for external ECC software processing
๐ง Development
Building
Running Tests
Linting
๐ Architecture
ๆฌ้กน็ฎ้็จๅๅฑๆถๆ๏ผๆญฃๅจไป้็ๅไฝ็ปๆ่ฟ็งปๅฐๆฐๆถๆ๏ผ
nander-rs/
โโโ src/
โ โโโ main.rs # CLI ๅ
ฅๅฃ็น
โ โโโ lib.rs # ๅบๅฏผๅบ
โ โโโ error.rs # ๅ
จๅฑ้่ฏฏ็ฑปๅ
โ โ
โ โโโ domain/ # ๐ ้ขๅๅฑ - ๆ ธๅฟไธๅก้ป่พ
โ โ โโโ types.rs # ๆ ธๅฟ็ฑปๅ (Capacity, Address, JedecId ็ญ)
โ โ โโโ chip.rs # ่ฏ็่งๆ ผๆจกๅ
โ โ โโโ flash_operation.rs # Flash ๆไฝๆฝ่ฑกๆฅๅฃ
โ โ โโโ bad_block.rs # ๅๅ็ฎก็็ญ็ฅ
โ โ โโโ ecc.rs # ECC ๆงๅถ็ญ็ฅ
โ โ
โ โโโ application/ # ๐ฆ ๅบ็จๅฑ - ็จไพ็ผๆ
โ โ โโโ use_cases/ # ๅ
ทไฝไธๅก็จไพ (ๅพ
่ฟ็งป)
โ โ โโโ services/ # ๅบ็จๆๅก (ๅพ
่ฟ็งป)
โ โ
โ โโโ infrastructure/ # ๐ง ๅบ็ก่ฎพๆฝๅฑ - ๆๆฏๅฎ็ฐ
โ โ โโโ programmer/ # ็กฌไปถ็ผ็จๅจ้ฉฑๅจ
โ โ โ โโโ ch341a/ # CH341A USB ้ฉฑๅจ
โ โ โ โโโ traits.rs # Programmer trait ๅฎไน
โ โ โโโ flash_protocol/ # Flash ๅ่ฎฎๅฎ็ฐ
โ โ โ โโโ nand/ # SPI NAND ๅ่ฎฎ
โ โ โ โโโ nor/ # SPI NOR ๅ่ฎฎ
โ โ โ โโโ commands.rs # SPI ๅฝไปคๅธธ้
โ โ โโโ chip_database/ # ่ฏ็ๆฐๆฎๅบ
โ โ โโโ nand/ # NAND ่ฏ็ๅฎไน (ๆๅถ้ ๅ)
โ โ โโโ nor/ # NOR ่ฏ็ๅฎไน (ๆๅถ้ ๅ)
โ โ
โ โโโ presentation/ # ๐ฅ๏ธ ่กจ็ฐๅฑ - ็จๆทไบคไบ
โ โ โโโ cli/ # CLI ๅฎ็ฐ (ๅพ
่ฟ็งป)
โ โ โโโ handlers/ # ๅฝไปคๅค็ๅจ
โ โ
โ โโโ [Legacy Modules] # ้็ๆจกๅ (้ๆญฅๆทๆฑฐ)
โ โโโ cli/ # ๅฝๅ CLI ๅฎ็ฐ
โ โโโ database/ # ๅฝๅ่ฏ็ๆฐๆฎๅบ
โ โโโ flash/ # ๅฝๅ Flash ๅ่ฎฎ
โ โโโ hardware/ # ๅฝๅ็กฌไปถ้ฉฑๅจ
่ฏฆ่ง ARCHITECTURE.md ไบ่งฃๅฎๆดๆถๆ่ฎพ่ฎกใ
๐ Adding New Chips
Edit src/database/chips.rs and add your chip:
nand,
Run nander info to see the JEDEC ID of your chip.
๐ Related Projects
- SNANDer - Original C implementation
- flashrom - Universal flash programmer
- probe-rs - Rust embedded debugging
๐ License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Note: This is a clean-room implementation. While inspired by SNANDer's functionality and interface design, nander-rs contains no GPL-licensed code. All code was written from scratch in Rust.
๐ Acknowledgments
- SNANDer by McMCC - The original C implementation that inspired this project's feature set and CLI design. SNANDer is GPL-licensed;
nander-rsis an independent reimplementation. - The OpenIPC community for testing and feedback
- The Rust embedded community for excellent libraries (
nusb,clap,indicatif, etc.) - JEDEC and flash chip manufacturers for public documentation