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

Comments

@mouridis
Copy link
Contributor

commented Sep 22, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Sep 22, 2019

Yup. I'll take a look.

lbernstone added a commit to lbernstone/arduino-esp32 that referenced this issue Sep 22, 2019
@me-no-dev me-no-dev closed this in ca88fdc Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.