I migrated to an Arduino Due several months ago to get a lot bigger program space because SD card writing was failing and hours of fiddling seemed to indicate very vaguely the same “memory problem”.
Right now I am assembling an CO2 mapper that is basically a DUE breadboard with an Adafruit SD card and real time clock, a Adafruit barometer, an Adafruit GPS and a CO2meter.com CO2 meter sending out serial data.
Each of the breakout boards are already working with separate programs. I have done the classic task of getting each subsystem running and observed to work correctly. Now I am assembling the system by copying the key parts of each subsystem to make the desired assembly.
The idea of the mapper is to write strings of time, date and data out to the SD card.
The last component program I merged was the code for the Adafruit SD card and real time clock. After adding in the SD card code, I immediately get a failure “Error opening the dataFile”.
The working subsystem program has a compiler program size of 47,020 bytes (8% of program storage space).
The mapper program that is failing has a compiler program size of 42,008 bytes.
What is catching my attention is the process of opening a filehandle seems to be failing.
The first part of making a filehandle for writing is this invocation in setup()
Later the program gets a file handle as follows:
dataFile = SD.open(“test”, FILE_WRITE);
So far, this thing called dataFile always seems to come back as a zero 0.
As in "Serial.print(dataFile); # Always is a 0
What drives me nuts is I fought with this elusive SD card failure problem months ago when working with a Mega 1280.
Is there a bug that is avoided by changing the order of loading of libraries? Which two libraries and which must load last?
Is the use of a near generic term “File” the basis for a search process failing?
Both of my programs have 2^^15 byte size. Is there a problem with an int pointer that is actually only 15 usable bits long?
I ask in advance: Don’t post obscure code fragments to these questions. Also, Paul S. please do not post regarding this comment.