Petoi Doc Center
🇺🇸English
🇺🇸English
  • Welcome to Petoi Doc Center
  • Getting Started Guide
  • 🙋‍♂️FAQ(Frequently Asked Questions)
  • Petoi robot joint index
    • Joint Pins on NyBoard
      • Nybble
      • Bittle
    • Joint Pins on BiBoard V0
      • Bittle X
      • Bittle X+Arm
    • Joint Pins on BiBoard V1
      • Bittle X
      • Bittle X+Arm
      • Nybble Q
  • Bluetooth Connection
    • BiBoard
    • NyBoard
  • Upload Firmware
    • NyBoard
    • BiBoard V0
    • BiBoard V1
  • Joint Calibration
  • Infrared Remote
    • Remote Controller
  • Mobile App
    • Introduction
    • Calibrator
      • Nybble
      • Bittle
    • Controller
  • Desktop APP
    • Introduction
    • Firmware Uploader
      • NyBoard
      • BiBoard V0
      • BiBoard V1
    • Joint Calibrator
      • NyBoard Preparation
      • BiBoard Preparation
      • Nybble
      • Bittle / Bittle X
        • Bittle (NyBoard)
        • Bittle X (BiBoard V0)
        • Bittle X (BiBoard V1)
      • Bittle X+Arm
        • BiBoard V1
        • BiBoard V0
    • Skill Composer
      • NyBoard Connection
      • BiBoard Connection
      • Interface
        • Nybble
        • Bittle / Bittle X
        • Bittle X+Arm
    • Tools
  • Block-based programming
    • Petoi Coding Blocks
      • NyBoard Preparation
      • BiBoard Preparation
    • Block-based Coding Curriculum - Learn Quadruped Robotics for Beginners
    • Python coding mode in Mind+
    • Generic Arduino Uno Blocks
    • Install Mind+ on Chromebook
  • Arduino IDE
    • Upload Sketch for NyBoard
    • Upload Sketch for BiBoard
    • Calibrate the joints with Arduino IDE
    • Serial Monitor
    • C++ Curriculum: Learn Quadruped Robotics for Beginners
    • Install Arduino IDE on Chromebook
  • Free Curriculum
    • 📚Download
  • APIs
    • 🖇️Serial Protocol
      • Feedback servos
      • Nested task queue and signal generator
    • 🐍Python API
    • 🐛8266 MicroPython controller
      • Run MicroPython on ESP8266
      • Setup WebREPL
      • Using the ESP-NOW protocol
    • 🦎8266 Arduino C Controller
    • ©️C++ API
    • 🍓Raspberry Pi serial port as an interface
      • For BiBoard V1
    • 💻Set up Development Environment on Chromebook
    • 🤖ROS
  • Nyboard
    • Overview
    • NyBoard V1_0
    • NyBoard V1_1 & NyBoard V1_2
  • BIBOARD
    • BiBoard V0 Guide
    • BiBoard Extension Hat
    • Demo Applications
      • 1.GPIO port
      • 2.Serial port
      • 3.Analog-digital converter
      • 4.Digital-Analog Converter
      • 5.EEPROM (Electrically Erasable Programmable read only memory)
      • 6.Gyro IMU(MPU6050)
      • 7.Infrared remote control
      • 8.PWM(Pulse Width Modulation)
      • 9.Servo(under construction)
      • 10.Classic Bluetooth serial port SPP
      • 11.Bluetooth low energy (BLE) serial port pass-through
      • 12.File system SPIFFS
      • 13.Add hardware partition configuration option in Arduino IDE
      • 14.Play MP3
      • 15.The usage of Wi-Fi OTA(Over-The-Air)
    • BiBoard V1 Guide
  • Communication Modules
    • Introduction (For NyBoard)
    • USB Uploader (CH340C or CH343G)
    • Dual Mode Bluetooth
    • WiFi module ESP8266
      • ESP8266 + Python Scripts Implement wireless crowd control
  • Extensible Modules
    • Introduction
    • MU Camera
    • Ultrasonic Sensor
    • Light Sensor
    • Touch Sensor
    • Gesture Sensor
    • PIR Motion Sensor
    • IR Distance Sensor
    • Voice Command Module
    • Petoi AI Vision Module
    • Advanced development and application of AI vision modules
      • Model Training
      • Model quantification
      • Model deployment
      • Training on the COCO DIY dataset
    • Robot Arm
      • Upgrade your older Bittle/Bittle X for the robotics arm gripper
    • 🎮Joystick with Micro:Bit
  • Applications
    • Melody Creation
    • Skill Creation
    • OpenCat Imitation Tutorial
    • Programmable Puppet Character
    • Tutorial for simulating Bittle In Isaac Sim
  • History
    • Upload Sketch For NyBoard (software 1.0)
  • Technical Support
    • 💾Supporting Application and Software
    • 🔧Burn Bootloader for NyBoard
    • 🛠️Useful Tools
    • 🔋Battery
  • Useful Links 🕸
    • 🔭Home of Petoi Robots
    • 🛒Shop Coding Robots
    • 💿GitHub of OpenCat
    • 🎪PetoiCamp (Forum)
    • 📽️Petoi Robot Videos
    • 📬Users' repositories
Powered by GitBook
On this page
  • 1. Why use a file system
  • 2. Install the Arduino ESP32 file system uploader
  • 3. Install ESP32 file upload plugin
  • 4. Upload files using the file system uploader
  • 5. Demo of how to use the file system

Was this helpful?

Export as PDF
  1. BIBOARD
  2. Demo Applications

12.File system SPIFFS

ESP32 File System SPIFFS Configuration Guide

Previous11.Bluetooth low energy (BLE) serial port pass-throughNext13.Add hardware partition configuration option in Arduino IDE

Last updated 2 years ago

Was this helpful?

1. Why use a file system

On BiBoard (ESP32), in addition to the regular program area and boot area, we use the file system in the Flash partition.

The role of a file system with independent partitions is as follows:

  • Save the data at the specified address and will not be deleted due to re-update (such as calibration data, gait data)

  • No external SD card needed, saving hardware resources

Common file systems include Windows NTFS, exFAT, and Linux log file systems Ext and XFS. But in the embedded field, these large file systems are too large. We use the lightweight SPIFFS (SPI Flash File System), an embedded file system for SPI NOR flash devices, and support functions such as wear leveling and file system consistency checking.

Because of its light weight, the biggest feature of SPIFFS is that it does not support tree directories, that is, all files are stored in the same layer. SPIFFS provided by ESP32 has the following features:

  • Currently, SPIFFS does not support directories, it produces a flat structure. If SPIFFS is mounted under /spiffs, then creating a file with the path /spiffs/tmp/myfile.txt will create a file called /tmp/myfile.txt in SPIFFS, instead of myfile.txt in the directory /spiffs/tmp.

  • It is not a real-time stack. One write operation might take much longer than another.

  • For now, it does not detect or handle bad blocks.

2. Install the Arduino ESP32 file system uploader

You can create/save and delete files with your own Arduino code, but the operation is cumbersome. You need to put data or even binary files into Arduino Sketch and create files by running the program.

However, there is a very useful tool that can directly upload files from the computer to the file system. Although it is slightly more troublesome than the "drag-and-drop" copy of the "removable storage", whether it is MP3 audio or HTML web files, all can be easily uploaded to flash memory. Let's learn how to use this plugin.

3. Install ESP32 file upload plugin

3.1 Preparing the Environment

3.2 Download the ESP32FS plugin

Download the compressed package of the ESP32FS plug-in at:

Go to the "Arduino" directory and open the "tools" folder

C:\Users\{YourUserName}\Documents\Arduino\tools

Unzip the downloaded .zip folder to the Tools folder. You should have a similar folder structure:

C:\Users\{YourUserName}\Documents\Arduino\tools\ESP32FS\tool\esp32fs.jar

Finally, restart the Arduino IDE.

To check whether the plug-in has been successfully installed, open the Arduino IDE. Select your ESP32 development board (ESP32 Dev Module), go to "Tools", and then check if there is an "ESP32 Sketch Data Upload" option.

4. Upload files using the file system uploader

To upload files to the ESP32 file system, follow the steps below:

  • Create an Arduino project (e.g.: Test.ino) and save

  • To open the project directory, you can use the "Sketch - Show Sketch Folder" option

  • Inside this folder, create a new folder named "data"

  • In the "data" folder, you should put the file which you want to save into the SPIFFS file system. e.g., create a .txt file that contains some text named "test_example". as following:

  • Please click "Tools - ESP32 Sketch Data Upload" in the Arduino IDE

When you see the "SPIFFS Image Uploaded" prompt message, the file has been successfully uploaded to the SPIFFS partition.

5. Demo of how to use the file system

The demo of the file system SPIFFS_Test.ino(C:\Users\{YourUserName}\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.*\libraries\SPIFFS\examples\SPIFFS_Test)comes from the official ESP32 without modification. The code implements the basic operation of "addition, deletion, modification, and check", and provides an SPI flash IO test program.

If necessary, it is recommended to directly use the code of the demo to operate ESP32 SPIFFS.

Please install Arduino IDE (Version: 1.8.* ) and the ESP32 support package of Arduino IDE (refer to of the BiBoard Quick Start Guide.).

Save HTML and CSS files to build a web server
Save images, audio and other files
Chapter 3.2.1
Download ESP32 SPIFFS file system upload plug-in for Arduino IDE
"data" folder in the project directory
Create test sample file with Notepad
The SPIFFS image has been uploaded to the ESP32 board
https://github.com/me-no-dev/arduino-esp32fs-plugin/releases