PaulStoffregen
Well-known member
If you're completely stuck, here are a couple alternate ideas.
First the easy one that's unlikely to yield results, but it's so simple you might as well give it a try. Instead of calling SD.open(), you can call SD.sdfs.open() to directly access the SdFat open function. This gives you the ability to configure the filesystem driver. Click File > Examples > SD > SDFat_Usage for examples of the syntax you can use. Who knows, maybe you'll get lucky and find one of the alternate ways "solves" the problem, or makes it behave differently enough to give you more info. It's a long shot, but so easy to try you might as well.
If that doesn't work out, my other suggestion which involves a lot more work, but is almost certain to eventually lead to a solution, is to whittle your program down and keep retesting whether the problem happens. Maybe you'll find removing something magically makes the problem vanish, and then of course you can focus on that thing.
But if you do end up with a fairly small program that still has the problem, then the final step is to share it here. If there really is something wrong inside SD / SdFat, sharing the exact code and files needed on the SD card so anyone can reproduce the issue is the first step to involve me and anyone else to actually dig into the issue. We do have a pretty good history of truely getting to the bottom of difficult problems on this forum, when full code and details allow anyone to reproduce the issue. And sometimes we even figure things out by blind guesswork, but that's not a solidly reliable path to success.
First the easy one that's unlikely to yield results, but it's so simple you might as well give it a try. Instead of calling SD.open(), you can call SD.sdfs.open() to directly access the SdFat open function. This gives you the ability to configure the filesystem driver. Click File > Examples > SD > SDFat_Usage for examples of the syntax you can use. Who knows, maybe you'll get lucky and find one of the alternate ways "solves" the problem, or makes it behave differently enough to give you more info. It's a long shot, but so easy to try you might as well.
If that doesn't work out, my other suggestion which involves a lot more work, but is almost certain to eventually lead to a solution, is to whittle your program down and keep retesting whether the problem happens. Maybe you'll find removing something magically makes the problem vanish, and then of course you can focus on that thing.
But if you do end up with a fairly small program that still has the problem, then the final step is to share it here. If there really is something wrong inside SD / SdFat, sharing the exact code and files needed on the SD card so anyone can reproduce the issue is the first step to involve me and anyone else to actually dig into the issue. We do have a pretty good history of truely getting to the bottom of difficult problems on this forum, when full code and details allow anyone to reproduce the issue. And sometimes we even figure things out by blind guesswork, but that's not a solidly reliable path to success.