ESP32 Bit Pirate home
  • SPI
  • Beginner
  • 5 min
  • Serial CLI

Recipe · Beginner · SPI

How to open the SPI SD card shell

SPI mode includes an SD card shell for quick file inspection and basic file operations.

SD card connected to an SPI bus.
Check files from the bench without moving the card or adding a temporary sketch.

Wiring View

SD card BP CSSPI CSCLKSPI CLKMISOSPI MISOMOSISPI MOSIGNDBP GND
Generated from the wiring summary: SD card to BP.
Step 1

Commands

Run the typed commands first. If the command opens an interactive shell, select the named action from the shell menu instead of treating it as another CLI command.

Result

What success looks like

A clean directory listing confirms that SPI wiring, card formatting and shell access are working.

Troubleshooting

  • Using an unsupported or corrupted filesystem.
  • Forgetting card power and shared ground.
  • Swapping MISO and MOSI.
  • Running large operations and assuming the board froze.

Next steps

  • Use cat for small text files.
  • Use mkdir, touch or rm carefully.
  • Use USB mass storage if you want host-side file copy.

SPI SD card shell FAQ

What does a clean ls result prove?

It confirms that SPI wiring, chip select, card power and the FAT/FAT32 filesystem are good enough for basic file access.

Why do large SD card operations feel slow?

The SD card shell runs over SPI and serial output, so large directory listings or file reads can take several seconds. Start with small files while validating the setup.

Can this replace a normal USB card reader?

No. It is a bench shell for quick inspection and simple file operations. Use USB mass storage mode or a real card reader when you need fast bulk transfers.

Go deeper