Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
paulftw opened this issue Jun 18, 2022 · 1 comment
Open

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

paulftw opened this issue Jun 18, 2022 · 1 comment

Comments

@paulftw
Copy link

paulftw commented Jun 18, 2022

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.

@paulftw paulftw changed the title SDCard.cpp fails to compile for esp32-c3 MMCSDCard.cpp fails to compile for esp32-c3 Jun 18, 2022
@PerMalmberg
Copy link
Owner

Hello @paulftw

I'm no longer actively using Smooth (my project is completed) so I'm not actively keeping up with the development of the ESP32/IDF at this point. I do however accept pull requests to address issues. As such, feel free to propose a proper solution to the issue at hand and we'll discuss it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants