Unable to read source directory

Try to upload a file.

  • On selecting ‘Build Filesystem Image’ I receive an error.

I use ini file:
[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
board_build.filesystem = littlefs
board_build.partitions = partition_table.csv

The error message is:
Building FS image from ‘data’ directory to .pio/build/esp32doit-devkit-v1/littlefs.bin
warning: can’t read source directory
*** [.pio/build/esp32doit-devkit-v1/littlefs.bin] Error 1

Well, I don’t understand: my source directory is:
~ % /esp/projects/pio/ESP32-LittleFS-File_Upload/src/data

Directory ~/src/data exists

  • and it contains a file: sample_text.txt;
  • and I made sure there’s no Terminal open.

What did I do wrong or forget?

Do you have multiple projects in your VS Code Workspace and have you selected the correct project in the Project Environment Switcher?


Thanks for the reply.
This is what I have in my PROJECT TASKS.
There’s no Project Environment Switcher, do I need it?
If so: how do I get it?

The Project Environment Switcher is at the bottom of the screen, not on the left side. See the picture in my reply.

Thank you.
I think I’ve found it, but no luck.

Sorry, I only noticed that on the second glance.

The data folder must be at the same level as src, not below src !

.
├── data
│   └── index.html
├── include
├── lib
├── src
│   └── main.cpp
├── test
└── platformio.ini

Sorry, to be late.
In the end I succeeded.