Small SD-Library

Hello,

I'm having the problem that there is not much space left in my sketch,

currently:

"Sketch uses 23534 bytes (82%) of program storage space. Maximum is 28672 bytes."

using the built in Library (SD.h) i would end up with 107%. This is not possible.

Does someone here knows a library that would use around 15% or so? So i would end up with 97%, leaving me 3% form my code?

I tried fat-16, but that one is not working (i tried with SD.h, and it worked on a bare sketch, so the hardware is allright)

Create and Write to file are the only options i would need, also SPI is already included in the sketch!

Thanks for any suggestions! :slight_smile:

I have no suggestion as far as a smaller SD library, but would be interested if you find one. Have you used all the SRAM conserving tricks already. Like the F macro, using PROGMEM and making variables const when possible? Local instead of global variables?

Yes, the problem is the display library, SPI, and the GPS Library are using most of the space, the display library takes 11kb of the 28kb...

groundFungus:
Like the F macro, using PROGMEM and making variables const when possible? Local instead of global variables?

The problem seems to be a lack of program space rather than a shortage of SRAM, If program space is at a premium maybe it would be a good idea NOT to use the F macro or PROGMEM

...R

Robin2:
The problem seems to be a lack of program space rather than a shortage of SRAM, If program space is at a premium maybe it would be a good idea NOT to use the F macro or PROGMEM

...R

You've got to put it all somewhere . . .

AWOL:
You've got to put it all somewhere . . .

Indeed. But if the spare bedroom is full and the kitchen is not ?

...R

sgt_johnny:
Yes, the problem is the display library, SPI, and the GPS Library are using most of the space, the display library takes 11kb of the 28kb...

You can't blame the display library, the real problem is simply too many libraries. And even if you did squeeze them in, you might still be faced with the uncertainty of reliable running. It might be time to think about getting a Mega because the is one thing you can be pretty sure of - the problem you have now is likely to get worse. Reason: the chances of you thinking about some thing you want to add next week, that you didn't know about last week, are pretty good.

sgt_johnny:
Create and Write to file are the only options i would need, also SPI is already included in the sketch!!

Do you really NEED to create and write a file? What about simply using external SPI EEPROM or flash chip?

Mega is not a option, since my board with all the stuff is already soldered :slight_smile: And yes, i need a File, to write down gps and data and then read in on computer...

I now try to make way for 7% program space...

Yes too many libraries, but the display "steals" around 50%, the other libraries only take around 25% (SPI,NeoGPS), images and my code take around 7%

If someone is interested, i can upload to github..

sgt_johnny:
Mega is not a option, since my board with all the stuff is already soldered :slight_smile:

Maybe it's time to buy a de-soldering pump :slight_smile:

...R

sgt_johnny:
And yes, i need a File, to write down gps and data and then read in on computer...

And what about uploading by another Arduino reading the raw data from the storage? Or another Arduino reading data from the easy storage and rewritig them to a file on SD card?

sgt_johnny:
Mega is not a option, since my board with all the stuff is already soldered :slight_smile: And yes, i need a File, to write down gps and data and then read in on computer...

So as the Mega is 'not an option', do you think some other solution will appear as if by magic ?

If your project is using a display, GPS and SD card then runs out of program space big time, you need to accept reality, you need an Arduino such as the Mega (or 1284P) that is 'not an option'

I would also make a suggestion, dont decide on or commit to the hardware design until the software is actually working.

sgt_johnny:
Mega is not a option, since my board with all the stuff is already soldered :slight_smile:

I note the smiley, and I guess you will see how funny this really is - eventually.

Robin2:
Maybe it's time to buy a de-soldering pump :slight_smile:

...R

No need for that, since a mega will not fit the 32u4 footprint, i already need a new pcb......

I'm keep trying now to modify libraries, to shrink them, i already made 1k, free space.