• Does a soft reset with reset() fix it? It seems like it should.

    As there's no disconnect pin on the Espruino board, it doesn't know if the card has been pulled out, so it doesn't unmount/remount it. Does the error happen if you pull the card out and re-insert it, without doing any file operations when it is removed? I thought that it worked in that case.

    I think right now your only solution is to call reset() when you start having issues... Or as you have it compiling, you could fix the underlying problem - probably by forcing an unmount/remount if there was an error when opening a file.

    If the error only happens if you read when the card is removed, I'd just explicitly check the value of the card detect pin, and not do anything when it's disconnected.

About

Avatar for Gordon @Gordon started