Accelerating NAND Flash Communication using PIO (Programmable IO).
- High-speed NAND flash communication using PIO and payload builder
- Simulation environment for verification
- async/await friendly API for MicroPython
- Supports Raspberry Pi Pico and JISC-SSD (Jisaku In-Storage Computation SSD) board
https://wipeseals.github.io/nandio.pio/
JISC-SSD board with RP2040 and NAND Flash (TC58NVG0S3HTA00) performance comparison.
MPY: soft reboot
CPU frequency: 125.0 MHz
# `Fw` commander results:
- Read ID time : 3391 us
- Erase block time : 4785 us
- Program page time : 8560594 us
- Read page time : 3692423 us
# `Pio` commander results:
- Read ID time : 3527 us
- Erase block time : 6357 us
- Program page time : 21405 us
- Read page time : 5491 us
MicroPython v1.25.0 on 2025-04-15; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>>MPY: soft reboot
CPU frequency: 250.0 MHz
# `Fw` commander results:
- Read ID time : 1771 us
- Erase block time : 2353 us
- Program page time : 5421321 us
- Read page time : 1845875 us
# `Pio` commander results:
- Read ID time : 1735 us
- Erase block time : 3733 us
- Program page time : 11197 us
- Read page time : 3293 us
MicroPython v1.25.0 on 2025-04-15; Raspberry Pi Pico with RP2040
Type "help()" for more information.To install the project, you can use the uv tool, which is a Python package manager that simplifies the installation of Python projects with multiple dependencies.
You can install uv and the project dependencies using the following commands:
pip install uv
uv sync --all-extras --dev
# run unit tests
uv run pytestTo simulate the NAND Flash communication, you can use the provided simulation script. This will run the simulation using the uv command.
# All scenarios
uv run sim/cli.py sim --all
Simulating scenario... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
Simulation completed for scenarios: reset, read_id, read, program, erase, status_read
All simulations completed successfully. output saved to </path/to/output>
# Specific scenario
uv run sim/cli.py sim --scenario resetYou can view the simulation results on GitHub Pages:
https://wipeseals.github.io/nandio.pio/
To assemble the PIO program, you can use the uv command with the asm option. This will compile the PIO assembly code into a binary format that can be used by the Raspberry Pi Pico.
uv run sim/cli.py asm
PIO program assembled successfully!
Output binary saved to: </path/to/output/nandio.pio.bin>- Download the MicroPython UF2 file for RP2040 from the official Raspberry Pi Pico website and flash it to the board.
- See MicroPython - Raspberry Pi for details.
- The confirmed working version of MicroPython is
v1.24.1(other versions may not work properly).
- Transfer the project to the Raspberry Pi Pico and run.
Using vscode MicroPico Extension
Run the MicroPico: Upload project to Pico (@command:micropico.upload) command to upload the project to the Raspberry Pi Pico.
uvx mpremote connect COM13 + fs --recursive --force cp main.py :/main.py + cp nandio.py :/nandio.py + cp sim/nandio_pio.py :/sim/nandio_pio.py + cp mpy/driver.py :/mpy/driver.py + fs ls + soft-reset + run main.py + repl
cp main.py :/main.py
cp sim/nandio_pio.py :/sim/nandio_pio.py
Up to date: /sim/nandio_pio.py
cp mpy/driver.py :/mpy/driver.py
ls :
607 main.py
0 mpy/
0 sim/
(snip)- [VOL-28]JISC-SSD(Jisaku In-Storage Computation SSD 学習ボード)
- TC58NVG0S3HTA00 Datasheet
- RP2040 Datasheet
- GitHub - crane-elec/rawnand_test
- ゼロから学ぶ SSD:構造、動作、耐久性のポイント - キオクシア株式会社
This project is licensed under the MIT License - see the LICENSE file for details.
