Skip to content

MMCSDCard.cpp fails to compile for esp32-c3 #171

@paulftw

Description

@paulftw

I have a ESP32-C3 module.
After setting this chip as a target:

idf.py set-target esp32c3

I'm running into a compilation error:

/Users/paul/smoothoperator/externals/smooth/lib/smooth/core/filesystem/MMCSDCard.cpp: In member function 'virtual bool smooth::core::filesystem::MMCSDCard::init(const smooth::core::filesystem::SDCardMount&, bool, int)':
/Users/paul/smoothoperator/externals/smooth/lib/smooth/core/filesystem/MMCSDCard.cpp:44:36: error: 'SDMMC_HOST_DEFAULT' was not declared in this scope
         sdmmc_host = (sdmmc_host_t)SDMMC_HOST_DEFAULT();
                                    ^~~~~~~~~~~~~~~~~~
/Users/paul/smoothoperator/externals/smooth/lib/smooth/core/filesystem/MMCSDCard.cpp:44:36: note: suggested alternative: 'SDSPI_HOST_DEFAULT'
         sdmmc_host = (sdmmc_host_t)SDMMC_HOST_DEFAULT();
                                    ^~~~~~~~~~~~~~~~~~
                                    SDSPI_HOST_DEFAULT

The culprit appears to be SOC_SDMMC_HOST_SUPPORTED - this symbol is not defined in the C3 soc_caps.h.
As a result sdmmc_host.h does nothing and breaks MMCSDCard.cpp.

Workaround

Adding

#define SOC_SDMMC_HOST_SUPPORTED 1

to the top of the smooth/lib/smooth/include/smooth/core/filesystem/MMCSDCard.h fixes the error. But that's a dirty hack.

Expected behavior

Build system should be aware of chip specific Smooth configurations and either provide documentation on how to disable unsupported libraries or use error-throwing mocks when underlying hardware/firmware aren't available.

Similar problems may probably arise with other compile target / library combinations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions