electro-smith / DaisyExamples

Examples for the Daisy Platform
https://github.com/electro-smith/DaisyWiki/wiki
MIT License
376 stars 194 forks source link

Daisy Seed SDMMC.cpp example do not compile #277

Closed KoSv closed 1 year ago

KoSv commented 2 years ago

I get errors trying to compile the simple sd card example. DaisyExamples/libDaisy//Middlewares/Third_Party/FatFs/src/ff.c:2698: undefined reference to ff_convert DaisyExamples/libDaisy//Middlewares/Third_Party/FatFs/src/ff.c:1693: undefined reference toff_wtoupper'`

and so on...

.... annoying

musicdevghost commented 1 year ago

I'm experiencing the same issues and getting same error: "FatFs/src/ff.c:2698: undefined reference to `ff_convert'"

just with the simple test:

SdmmcHandler::Config sd_config; SdmmcHandler sdcard; sd_config.Defaults(); sdcard.Init(sd_config);

fsi.Init(FatFSInterface::Config::MEDIA_SD);

/** Write/Read text file */
const char *test_string = "Testing Daisy Patch SM";
const char *test_fname  = "DaisyPatchSM-Test.txt";
FRESULT     fres = FR_DENIED; /**< Unlikely to actually experience this */
if(f_mount(&fsi.GetSDFileSystem(), "/", 0) == FR_OK)
{
    /** Write Test */
    if(f_open(&file, test_fname, (FA_CREATE_ALWAYS | FA_WRITE)) == FR_OK)
    {
        UINT   bw  = 0;
        size_t len = strlen(test_string);
        fres       = f_write(&file, test_string, len, &bw);
    }
    f_close(&file);
    if(fres == FR_OK)
    {
        /** Read Test only if Write passed */
        if(f_open(&file, test_fname, (FA_OPEN_EXISTING | FA_READ)) == FR_OK)
        {
            UINT   br = 0;
            char   readbuff[32];
            size_t len = strlen(test_string);
            fres       = f_read(&file, readbuff, len, &br);
        }
        f_close(&file);
    }
}
KoSv commented 1 year ago

I'm experiencing the same issues and getting same error: "FatFs/src/ff.c:2698: undefined reference to `ff_convert'"

just with the simple test:

SdmmcHandler::Config sd_config;

SdmmcHandler         sdcard;

sd_config.Defaults();

sdcard.Init(sd_config);

fsi.Init(FatFSInterface::Config::MEDIA_SD);

/** Write/Read text file */

const char *test_string = "Testing Daisy Patch SM";

const char *test_fname  = "DaisyPatchSM-Test.txt";

FRESULT     fres = FR_DENIED; /**< Unlikely to actually experience this */

if(f_mount(&fsi.GetSDFileSystem(), "/", 0) == FR_OK)

{

    /** Write Test */

    if(f_open(&file, test_fname, (FA_CREATE_ALWAYS | FA_WRITE)) == FR_OK)

    {

        UINT   bw  = 0;

        size_t len = strlen(test_string);

        fres       = f_write(&file, test_string, len, &bw);

    }

    f_close(&file);

    if(fres == FR_OK)

    {

        /** Read Test only if Write passed */

        if(f_open(&file, test_fname, (FA_OPEN_EXISTING | FA_READ)) == FR_OK)

        {

            UINT   br = 0;

            char   readbuff[32];

            size_t len = strlen(test_string);

            fres       = f_read(&file, readbuff, len, &br);

        }

        f_close(&file);

    }

}

Try setting the Fs fat flag in the makefile.

USE_FATFS = 1

stephenhensley commented 1 year ago

Hi @KoSv , @musicdevghost

sorry to hear you ran into an issue compiling this example.

If you're still running into this issue, can you make sure that your DaisyExamples repo is up to date (using git pull origin master ), and that your libDaisy submodule is on either the latest release version, or the current master branch, and rebuilt.

The current version of that example's makefile should does already contain the USE_FATFS=1 mentioned above.

I tested locally, and verified that the CI properly compiled this example.

Feel free to reopen if you're still experiencing issues.