Go Down

Topic: Is Deviceprint immpossible to make work? (Read 4786 times) previous topic - next topic


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:
Code: [Select]
 if (!microfat2::initialize(sectorBuffer, &mmc::readSectors))
   error_P(PSTR("Couldn't initialise microfat"));

dptest code:
Code: [Select]
int ufres = microfat2::initialize(sectorBuffer, &mmc::readSectors);
 if (ufres != 0)
   print_P(PSTR("Couldn't initialise microfat: error code "));
   Serial.print(ufres, DEC);

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.



I've been looking all over the internet for the best way to use SD Cards with an Arduino board and Sir Moris' uFat is the only method that has a clear approach on how to use it.

I had the device print method working on my arduino board but i tried to use it again but i keep getting the 'couldn't initialise microfat' error as above. I tried using the dptest and get the error code 3Error.

Would someone be able to help me solve this problem as i'm new to the Arduino platform and have already scoured the internet for solutions but to no avail. I would really appreciate any advice, suggestions or solution as i've spent several days trying to sort it out.

Thanks in advance!


Have you looked at this Fat16 library?


I moved over to it and have been successful so far.


Go Up