I think I am having similar issues writing to my SD card. DevicePrintDemo returns the following error:
"Error Couldn't initialise microfat"
I then tried the dptest.pde posted elsewhere (closing the IDE, removing the uFAT libraries from the library directory) and it worked.
I then moved the libraries from the dptest directory into the libraries directory and tried dptest again - it works.
I then retried DevicePrintDemo (with the dptest libraries) and it fails as above.
Then I modifed the section of DevicePrintDemo that throws this error to match the dptest code, as follows:
Original DevicePrintDemo code:
if (!microfat2::initialize(sectorBuffer, &mmc::readSectors))
error_P(PSTR("Couldn't initialise microfat"));
int ufres = microfat2::initialize(sectorBuffer, &mmc::readSectors);
if (ufres != 0)
print_P(PSTR("Couldn't initialise microfat: error code "));
and the modified DevicePrintDemo works (still with the dptest libraries in the Hw/library directory).
Finally - I put the original uFAT libraries back into the HW/libraries directory... (drumroll) and now the modified DevicePrintDemo as well as dptest result in this error:
"Couldn't initialise microfat: error code 1Error "
If I change DevicePrintDemo back to the original code for checking this error - it now magically works. argh.Question 1 - Are DpTest and DevicePrintDemo based on the same library code? Should they both work with the uFAT libraries in the library ZIP?
Question 2 - What is the difference between the two methods for initializing microfat? Why does only one work with the dptest library?
Question 3 - I have no idea why the DevicePrintDemo with the uFAT libraries started working after all of that. Let me know if you can explain.
I'm a beginner - any advice on uFAT debug or dealing with library issues is appreciated.