Nano ESp32 S3 [ESP32] Problem with LittleFS data upload (uploaddfs) after struggling with firmware upload

I’m already responding: each new board is assigned a different COM7-9-10-11 port. I see this in both applications on the Arduino IDE, Device Manager, and PlatformIO. 2. Nothing else is connected to the computer except the mouse. 3. The USB cable is new; there doesn’t seem to be a problem with it. I don’t know if it’s strictly a data transfer cable, but they’ve been broken many times, so it seems okay. Other ports report the same errors. In my opinion, I simply can’t get this board to work properly. I reset the UI and start uploading. This sample doesn’t appear on the Arduino IDE with the same hardware.

I I really don’t know what it depends on because sometimes the code wins beautifully and sometimes not, but definitely more times no than yes..

It compiles the code correctly every time, as evidenced by the success messages. Now I can send a message of the full upload process. I’ll paste it in, maybe you’ll notice something there, because I’m already doing it on my own.

The smartphone screenshot you posted indicates that PlatformIO is attempting to connect via COM11 because it was manually specified.
However, you stated that “each new board is assigned a different COM7-9-10-11 port.”
If that is the case, why did you manually specify COM11 (i.e., in platformio.ini)?
For instance, if the connection is actually on COM7, you should either specify COM7 in platformio.ini or—as I suggested—not specify a port in platformio.ini at all.
I believe there is a contradiction in your post.

I specified port com11 because that was automatically assigned to the new board. In the Arduino IDE, the previous board was assigned port com9, the one we discussed yesterday. I managed to upload the code and website files, but I hadn’t yet configured the buttons. When I returned to the topic, the files wouldn’t upload, displaying errors 1 and 2. In the Platformini file, I changed the code from auto to the specific port assigned to the board, e.g., com9 or com11, but neither the file nor the code would upload. There’s a small, specific problem here, but I can’t pinpoint it.

If I had to define it precisely, I’d say it will upload if it wants to, and if not, it won’t. Previously, it would upload several times each time, and then something would go wrong. I’m learning this too.

I see—that is certainly a rather unusual situation. I apologize; I haven’t encountered that myself, so I hadn’t imagined such a scenario.

By the way, have you tried using “Auto”?
You simply need to comment out the upload_port=XXXX line in your platformio.ini file, so please give that a try.

yes, I tried auto, I even tried not to add any, let it choose by default, that I got confused about what I tried and what I didn’t try..

It’s definitely not like you just insert the disc, click it and it loads, but when it works out, it’s nice..

You’re right—it really makes no sense…
Have you tried restarting Windows?
Given the current situation, there isn’t a specific technical reason to think that would fix it, but the behavior is so strange that it might be worth a try if you are able to restart the OS.
Please restart the OS with the ESP32 disconnected and try using the “Auto” setting first.

Processing arduino_nano_esp32 (platform: espressif32; board: arduino_nano_esp32; framework: arduino)

----------------------------------------------------

Verbose mode can be enabled via `-v, --verbose` option

CONFIGURATION: Redirecting...

PLATFORM: Espressif 32 (7.0.1) > Arduino Nano ESP32

HARDWARE: ESP32S3 240MHz, 320KB RAM, 16MB Flash

DEBUG: Current (cmsis-dap) External (cmsis-dap, dfu, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)

PACKAGES:

  • framework-arduinoespressif32 @ 3.20017.241212+sha.dcc1105b

  • tool-dfuutil-arduino @ 1.11.0

  • tool-esptoolpy @ 2.41100.0 (4.11.0)

  • tool-mkfatfs @ 2.0.1

  • tool-mklittlefs @ 1.203.210628 (2.3)

  • tool-mkspiffs @ 2.230.0 (2.30)

  • tool-openocd-esp32 @ 2.1100.20220706 (11.0)

  • toolchain-riscv32-esp @ 8.4.0+2021r2-patch5

  • toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5

LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation

LDF Modes: Finder ~ chain, Compatibility ~ soft

Found 36 compatible libraries

Scanning dependencies…

Dependency Graph

|-- Adafruit GFX Library @ 1.12.6

|-- Adafruit SSD1306 @ 2.5.17

|-- EEPROM @ 2.0.0

|-- LittleFS @ 2.0.0

|-- WebServer @ 2.0.0

|-- WiFi @ 2.0.0

|-- Wire @ 2.0.0

Building in release mode

Retrieving maximum program size .pio\build\arduino_nano_esp32\firmware.elf

Checking size .pio\build\arduino_nano_esp32\firmware.elf

Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”

RAM: [== ] 17.7% (used 57928 bytes from 327680 bytes)

Flash: [=== ] 26.6% (used 835885 bytes from 3145728 bytes)

Configuring upload protocol…

AVAILABLE: cmsis-dap, dfu, esp-bridge, esp-builtin, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa

CURRENT: upload_protocol = esptool

Looking for upload port…

Using manually specified: COM11

Uploading .pio\build\arduino_nano_esp32\firmware.bin

esptool.py v4.11.0

Serial port COM11

Connecting…

A serial exception error occurred: Cannot configure port, something went wrong. Original message: OSError(22, ‘Określono nieistniejące urządzenie.’, None, 433)

Note: This error originates from pySerial. It is likely not a problem with esptool, but with the hardware connection or drivers.

For troubleshooting steps visit: Troubleshooting - ESP32 - — esptool latest documentation

*** [upload] Error 1

=========== [FAILED] Took 12.11 seconds ===========

* The terminal process “C:\Users\Dell\.platformio\penv\Scripts\platformio.exe ‘run’, ‘–target’, ‘upload’, ‘–upload-port’, ‘COM11’” terminated with exit code: 1.

* Terminal will be reused by tasks, press any key to close it.

Processing arduino_nano_esp32 (platform: espressif32; board: arduino_nano_esp32; framework: arduino)

----------------------------------------------------

Verbose mode can be enabled via `-v, --verbose` option

CONFIGURATION: Redirecting...

PLATFORM: Espressif 32 (7.0.1) > Arduino Nano ESP32

HARDWARE: ESP32S3 240MHz, 320KB RAM, 16MB Flash

DEBUG: Current (cmsis-dap) External (cmsis-dap, dfu, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)

PACKAGES:

  • framework-arduinoespressif32 @ 3.20017.241212+sha.dcc1105b

  • tool-dfuutil-arduino @ 1.11.0

  • tool-esptoolpy @ 2.41100.0 (4.11.0)

  • tool-mkfatfs @ 2.0.1

  • tool-mklittlefs @ 1.203.210628 (2.3)

  • tool-mkspiffs @ 2.230.0 (2.30)

  • tool-openocd-esp32 @ 2.1100.20220706 (11.0)

  • toolchain-riscv32-esp @ 8.4.0+2021r2-patch5

  • toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5

LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation

LDF Modes: Finder ~ chain, Compatibility ~ soft

Found 36 compatible libraries

Scanning dependencies…

Dependency Graph

|-- Adafruit GFX Library @ 1.12.6

|-- Adafruit SSD1306 @ 2.5.17

|-- EEPROM @ 2.0.0

|-- LittleFS @ 2.0.0

|-- WebServer @ 2.0.0

|-- WiFi @ 2.0.0

|-- Wire @ 2.0.0

Building in release mode

Building FS image from ‘data’ directory to .pio\build\arduino_nano_esp32\littlefs.bin

/assets/images/Tetris_ESP32.WEBP

/index.html

/style.css

Looking for upload port…

Using manually specified: auto

Uploading .pio\build\arduino_nano_esp32\littlefs.bin

esptool.py v4.11.0

Serial port auto

A fatal error occurred: Could not open auto, the port is busy or doesn’t exist.

(could not open port ‘auto’: FileNotFoundError(2, ‘Nie można odnaleźć określonego pliku.’, None, 2))

Hint: Check if the port is correct and ESP connected

*** [uploadfs] Error 2

============ [FAILED] Took 4.30 seconds ============

* The terminal process “C:\Users\Dell\.platformio\penv\Scripts\platformio.exe ‘run’, ‘–target’, ‘uploadfs’, ‘–environment’, ‘arduino_nano_esp32’” terminated with exit code: 1.

* Terminal wi

ll be reused by tasks, press any key to close it.

This is very very strange.

  1. The log from when you built and uploaded the program records the following:

AVAILABLE: cmsis-dap, dfu, esp-bridge, esp-builtin, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa

CURRENT: upload_protocol = esptool
Looking for upload port…
Using manually specified: COM11
Uploading .pio\build\arduino_nano_esp32\firmware.bin
esptool.py v4.11.0
Serial port COM11
Connecting…
A serial exception error occurred: Cannot configure port, something went wrong.

This indicates that upload_port = COM11 is written in platformio.ini.

  1. The log for the file system build and upload records the following:
Looking for upload port…
Using manually specified: auto
Uploading .pio\build\arduino_nano_esp32\littlefs.bin
esptool.py v4.11.0
Serial port auto
A fatal error occurred: Could not open auto, the port is busy or doesn’t exist.

This indicates that upload_port = auto is written in platformio.ini.

Could you show me the actual platformio.ini file you just ran?

If upload_port is not specified in platformio.ini, the log should record something like this for a program build/upload, for example:

Configuring upload protocol...
AVAILABLE: cmsis-dap, esp-bridge, esp-builtin, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM4
Uploading .pio\build\esp32-s3-devkitc1-n8r8\firmware.bin
esptool.py v5.0.0-dev1
Serial port COM4:
Connecting...
Connected to ESP32-S3 on COM4:

My platformio.ini in this example is as follows, and upload_port is not specified. (This is just one example from my environment, so other details may differ from yours.)


[env:esp32-s3-devkitc1-n8r8]
platform = espressif32
;board = esp32-s3-devkitc1-n8r8
board = ESP32-S3-DEVKITC1-N8R8
framework = arduino
;upload_port = COM19
;monitor_port = COM3
build_flags =
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1

If you make changes to the platformio.ini file on your GitHub,
for example, writing it simply like this should make it treat as Auto.

[env:arduino_nano_esp32]
platform = espressif32
board = arduino_nano_esp32
framework = arduino
lib_deps =
adafruit/Adafruit GFX Library
adafruit/Adafruit SSD1306
upload_protocol = esptool
; don't specify upload_port for auto detection
;upload_port = COM11 ; use COM11, this will allow you to use the original port.
board_build.filesystem = littlefs
board_build.partitions = partitions_custom.csv
monitor_speed = 115200

Request:
• Could you show me the platformio.ini that was actually referenced when you just performed these builds/uploads?

The specific location where that platformio.ini file is stored is the project folder, as indicated on GitHub, right?

When making copies of the last information I sent you, the platform.ini file was probably set to the COM11 port. I tried again and changed it to auto once, then back to COM11. Platform.ini is located in the project’s main directory, just like on GitHub. The last branch was added, and changes were added and committed, but not merged with main. On Man, there may be a slightly earlier version. The button_opperation-branch branch contains the most recent changes. This is where the buttons were configured compared to main and the main.cpp file.