Go Down

Topic: Small SD-Library (Read 1 time) previous topic - next topic

sgt_johnny

Aug 12, 2017, 01:28 pm Last Edit: Aug 12, 2017, 01:32 pm by sgt_johnny
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! :)

groundFungus

#1
Aug 12, 2017, 02:01 pm Last Edit: Aug 12, 2017, 02:02 pm by groundFungus
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?
You will save everyone's time if you read and follow the forum guidelines.  https://forum.arduino.cc/index.php/topic,148850.0.html

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...

Robin2

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
Two or three hours spent thinking and reading documentation solves most programming problems.

AWOL

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 . . .

Robin2

You've got to put it all somewhere . . .
Indeed. But if the spare bedroom is full and the kitchen is not ?

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Nick_Pyner

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.

Smajdalf

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?
How to insert images: https://forum.arduino.cc/index.php?topic=519037.0

sgt_johnny

Mega is not a option, since my board with all the stuff is already soldered :) 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..

Robin2

#9
Aug 13, 2017, 08:06 pm Last Edit: Aug 13, 2017, 08:06 pm by Robin2
Mega is not a option, since my board with all the stuff is already soldered :)
Maybe it's time to buy a de-soldering pump :)

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Smajdalf

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?
How to insert images: https://forum.arduino.cc/index.php?topic=519037.0

srnet

#11
Aug 13, 2017, 09:58 pm Last Edit: Aug 13, 2017, 10:00 pm by srnet
Mega is not a option, since my board with all the stuff is already soldered :) 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.

 

Nick_Pyner

Mega is not a option, since my board with all the stuff is already soldered :) 
I note the smiley, and I guess you will see how funny this really is - eventually.

sgt_johnny

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

...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.


Go Up