"FS.h: No such file or directory" with ldf_mode deep+

Hello,

I’m not able to build my project when using the deep+ ldf_mode and #include <SD_MMC.h>
I get the following error :

In file included from C:/Users/mgarnier/.platformio/packages/framework-arduinoespressif32/libraries/SD_MMC/src/SD_MMC.cpp:16:
C:/Users/mgarnier/.platformio/packages/framework-arduinoespressif32/libraries/SD_MMC/src/SD_MMC.h:21:10: fatal error: FS.h: No such file or directory

I’m using the last up to date version of platformio, arduino framework and board esp32dev
You can reproduce the error by creating a new project, setting the ldf mode to deep+, and including SD_MMC.h.

main.cpp

#include <Arduino.h>
#include <SD_MMC.h>

void setup()
{
  // put your setup code here, to run once:
}

void loop()
{
  // put your main code here, to run repeatedly:
}

platformio.ini

[env:featheresp32]
platform = espressif32
board = featheresp32
lib_ldf_mode = chain+
framework = arduino

It works normally when using chain or deep modes, but not with chain+ or deep+

I’m a bit lost with this error and I really need the deep+ mode

Any help is appreciated
Thanks !

You’re right indeed. With lib_ldf_mode = chain+ or deep+, the dependency of SD_MMC to the FS library is not detected and the build fails.

Dependency Graph
|-- SD_MMC @ 2.0.0

However, with no lib_ldf_mode set, or set to deep or chain, it succeeds.

Dependency Graph
|-- SD_MMC @ 2.0.0
|   |-- FS @ 2.0.0
Building in release mode
[...]
RAM:   [          ]   4.9% (used 16144 bytes from 327680 bytes)
Flash: [==        ]  16.2% (used 212977 bytes from 1310720 bytes)

So, although deep+ and chain+ should evaluate the #ifdef macros, in the SD_MMC.h file does

PlatformIO doesn’t seem to think that SOC_SDMMC_HOST_SUPPORTED is enabled, although it is set so in the soc/soc_caps.h file included previously.

I will open a bug report about this.

A workaround is adding

build_flags = -DSOC_SDMMC_HOST_SUPPORTED

to the platformio.ini, then deep+ mode can be used.

This is now tracked in LDF doesn't evaluate macro properly · Issue #4414 · platformio/platformio-core · GitHub.

Nice !
Your workaround is working fine, thank you for your help !

I am reurrecting an old topic, because I am having the exact same issue when trying to work with TFT_eSPI (which, under the covers, includes FS.H). The difference: Adding the define for SOC_SDMMC_HIST_SUPPORTED does not circumvent the issue. Using the following PLATFORMIO,INI

[platformio]
description = Test SUNTON 3.5 TFT mit eSPI

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
build_flags = -DSOC_SDMMC_HOST_SUPPORTED
    -DUSER_SETUP_LOADED=1
    -include $PROJECTDIR/Include/User_Setup.h
upload_speed = 460800 
monitor_speed = 115200
lib_ldf_mode = deep+
lib_deps = bodmer/TFT_eSPI @ ^2.5.23

will fail the compile with

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Removing unused dependencies...
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.1.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, 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.20007.0 (2.0.7) 
 - tool-esptoolpy @ 1.40500.0 (4.5.0) 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ deep+, Compatibility ~ soft
Found 47 compatible libraries
Scanning dependencies...
Dependency Graph
|-- TFT_eSPI @ 2.5.23
|   |-- SPI @ 2.0.0
|-- SPI @ 2.0.0
Building in release mode
Compiling .pio\build\esp32dev\src\main.cpp.o
Building .pio\build\esp32dev\bootloader.bin
Generating partitions .pio\build\esp32dev\partitions.bin
esptool.py v4.5
Creating esp32 image...
Merged 1 ELF section
Successfully created esp32 image.
Compiling .pio\build\esp32dev\lib9e3\SPI\SPI.cpp.o
In file included from .pio/libdeps/esp32dev/TFT_eSPI/TFT_eSPI.h:100,
                 from src/main.cpp:2:
.pio/libdeps/esp32dev/TFT_eSPI/Processors/TFT_eSPI_ESP32.h:137:12: fatal error: FS.h: No such file or directory

************************************************************
* Looking for FS.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:FS.h"
* Web  > https://registry.platformio.org/search?q=header:FS.h
*
************************************************************

   #include <FS.h>
            ^~~~~~
compilation terminated.
Compiling .pio\build\esp32dev\lib4b2\TFT_eSPI\TFT_eSPI.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\Esp.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\FirmwareMSC.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\FunctionalInterrupt.cpp.o
*** [.pio\build\esp32dev\src\main.cpp.o] Error 1
In file included from .pio/libdeps/esp32dev/TFT_eSPI/TFT_eSPI.h:100,
                 from .pio/libdeps/esp32dev/TFT_eSPI/TFT_eSPI.cpp:16:
.pio/libdeps/esp32dev/TFT_eSPI/Processors/TFT_eSPI_ESP32.h:137:12: fatal error: FS.h: No such file or directory

************************************************************
* Looking for FS.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:FS.h"
* Web  > https://registry.platformio.org/search?q=header:FS.h
*
************************************************************

   #include <FS.h>
            ^~~~~~
compilation terminated.
*** [.pio\build\esp32dev\lib4b2\TFT_eSPI\TFT_eSPI.cpp.o] Error 1
========================================================================================== [FAILED] Took 24.66 seconds ==========================================================================================


when I change to lib_ldf_mode = deep, compile succeeds.

Probaby error 25 (The error is 25 inches in front of the screen), but I dont’t know and what to fix

With best regards

Volker