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

After FFat.end(), subsequent calls to FFat.begin() fail #3244

Closed
mouridis opened this issue Sep 22, 2019 · 1 comment
Closed

After FFat.end(), subsequent calls to FFat.begin() fail #3244

mouridis opened this issue Sep 22, 2019 · 1 comment

Comments

@mouridis
Copy link
Contributor

Hardware:

Board: Wemos Lolin32
Core Installation version: 1.0.3
IDE name: VSCode / Arduino IDE
Flash Frequency: 80MHz
PSRAM enabled: n/a
Upload Speed: 921600
Computer OS: Windows 10

Description:

After calling FFat.begin(), doing some file work and then FFat.end(), subsequent calls to FFat.begin() always fail.

Way to reproduce:

Open the included FFat_Test example. Confirm it works (don't forget to use a partition scheme with a FAT partition). Then, on setup() around line 163, replace the following block:

    if(!FFat.begin()){
        Serial.println("FFat Mount Failed");
        return;
    }
    Serial.printf("Total space: %10lu\n", FFat.totalBytes());
    Serial.printf("Free space: %10lu\n", FFat.freeBytes());
    listDir(FFat, "/", 0);
    writeFile(FFat, "/hello.txt", "Hello ");

with this one:

    if(!FFat.begin()){
        Serial.println("FFat Mount Failed");
        return;
    }
    Serial.printf("Total space: %10lu\n", FFat.totalBytes());
    Serial.printf("Free space: %10lu\n", FFat.freeBytes());
    listDir(FFat, "/", 0);
    FFat.end();
    delay(5000);
    if(!FFat.begin()){
        Serial.println("FFat Mount Failed");
        return;
    }
    writeFile(FFat, "/hello.txt", "Hello ");

The second FFat.begin() returns false. and "FFAT Mount Failed" prints on serial. If debug is enabled, the following message appears.

Debug Messages:

[E][FFat.cpp:56] begin(): Mounting FFat partition failed! Error: -1
@lbernstone
Copy link
Contributor

Yup. I'll take a look.

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