Best Method for Utilizing On-Board Flash?

Hi @lmateev. I'll provide instructions for using the arduino-littlefs-upload extension with the Nano ESP32 board:

A. Put Board in "Hardware CDC" Mode

By default, the Nano ESP32 is configured to use a mode where sketches are uploaded to the board via a special DFU (device firmware upgrade) interface. This interface can't be used by the arduino-littlefs-upload extension to upload filesystems, so it is necessary to put the board into the alternative "hardware CDC" mode that is supported by the arduino-littlefs-upload extension.

  1. Select File > New Sketch from the Arduino IDE menus.
  2. Select Tools > Board > Arduino ESP32 Boards > Arduino Nano ESP32 from the Arduino IDE menus.
  3. Select Tools > USB Mode > Debug mode (Hardware CDC) from the Arduino IDE menus.
  4. Select Sketch > Upload from the Arduino IDE menus (or click the upload button if you prefer).
    This upload will put the board into the "hardware CDC" mode.
  5. Wait for the upload to finish successfully.
  6. Press the "RST" button on the Nano ESP32 board.

B. Configure Arduino IDE for Use with Filesystem Uploader Extension

Various parameters are configured in Arduino IDE according to which board you have selected from the Tools > Board menu. Unfortunately the configuration you get when you select "Arduino Nano ESP32" from the menu is not compatible with the arduino-littlefs-upload extension. For this reason, we must use an alternative board selection that is compatible.

The "Arduino ESP32 Boards" platform that adds the "Arduino Nano ESP32" board definition to Arduino IDE is a fork of the 3rd party "esp32" boards platform. That platform provides a flexible general purpose "ESP32S3 Dev Module board definition for use with all boards based on the ESP32-S3 microcontroller, including the Nano ESP32 board. The "ESP32S3 Dev Module" board definition is compatible with the arduino-littlefs-upload extension so we can work around the incompatibility of the "Arduino Nano ESP32" board definition by instead selecting this board from the Tools > Board menu.

  1. If you haven't already, use the Arduino IDE Boards Manager to install the "esp32" boards platform by following these instructions:
    https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#installing-using-arduino-ide
  2. Select Tools > Board > esp32 > ESP32S3 Dev Module from the Arduino IDE menus.
  3. Select Tools > CPU Frequency > 240MHz (WiFi) from the Arduino IDE menus.
  4. Select Tools > USB DFU On Boot > Disabled from the Arduino IDE menus.
  5. Select Tools > Events Run On > Core 1 from the Arduino IDE menus.
  6. Select Tools > Flash Mode > QIO 80MHz from the Arduino IDE menus.
  7. Select Tools > Flash Size > 16MB (128Mb) from the Arduino IDE menus.
  8. Select Tools > Arduino Runs On > Core 1 from the Arduino IDE menus.
  9. Select Tools > USB Firmware MSC On Boot > Disabled from the Arduino IDE menus.
  10. Select Tools > Partition Scheme > Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) from the Arduino IDE menus.
    You can use any of the SPIFFS partitions schemes from the menu, as appropriate for your application.
  11. Select Tools > PSRAM > OPI PSRAM from the Arduino IDE menus.
  12. Select Tools > Upload Mode > UART0 / Hardware CDC from the Arduino IDE menus.
  13. Select Tools > USB Mode > Hardware CDC and JTAG from the Arduino IDE menus.
  14. Select the port of the Nano ESP32 board from Arduino IDE's Tools > Port menu.
    :red_exclamation_mark: It is necessary to select the port again because the port may have changed after you performed the "Put Board in "Hardware CDC" Mode" procedure.
    The port will be labeled in the menu as "(ESP32 Family Device)" instead of "(Arduino Nano ESP32)" as usual. This is normal and expected.
  15. Select Sketch > Upload from the Arduino IDE menus (or click the upload button if you prefer).
  16. Wait for the upload to finish successfully.

C. Upload Filesystem

Use the arduino-littlefs-upload extension to upload the filesystem to the board as usual, per the instructions provided by the extension author:

https://github.com/earlephilhower/arduino-littlefs-upload#usage

Restoring Board to Normal Mode

When you aren't working with uploaded filesystems, you might prefer to go back to using the Nano ESP32 board normally. I'll provide instructions you can follow to switch the board back to the mode where you can use it with the "Arduino Nano ESP32" board definition once more.

  1. Select File > New Sketch from the Arduino IDE menus.
  2. Select Tools > Board > Arduino ESP32 Boards > Arduino Nano ESP32 from the Arduino IDE menus.
  3. Select Tools > USB Mode > Normal mode (TinyUSB) from the Arduino IDE menus.
  4. Select Tools > Programmer > esptool from the Arduino IDE menus.
  5. Select the port of the Nano ESP32 board from Arduino IDE's Tools > Port menu.
  6. Select Sketch > Upload Using Programmer from the Arduino IDE menus (or click the upload button if you prefer).
  7. Wait for the upload to finish successfully.

Please let me know if you have any questions or problems while following those instructions.