How can we turn off/remove unused parts in Arduino SD library? Can we have some kind of
#define to do that?
I only need read/write/append/seek function.
I cannot use Arduino's standard SD library fully because of the lack of flash. I'm using PetitFS but it doesn't support appending to a file!
Thanks for any help!
P/S: In case you wonder what I am doing and why my sketch so big, I'm porting fake86 to Arduino UNO ( here and here).
March 21, 2021, 7:42pm
my sketch is 87456 bytes (for ATmega1284p).
you too can use a MCU with more flash and SRAM (the SD library uses a 512 bytes large buffer)
March 21, 2021, 8:19pm
How can we turn off/remove unused parts in Arduino SD library? Can we have some kind of #define to do that?
The compiler should not include code you dont use.
To turn the question around, how do you know the compiler is including unused code ?
Many, many times there are requests in these forums to significantly reduce the amount of flash and memory space that the SD library uses, if you find a way, do let on.
March 21, 2021, 11:19pm
In order to make all discussion on the subject accessible, I'll share
@raspiduinogit's post of same from the SD library repository on GitHub:
01:54PM - 21 Mar 21 UTC
You should add some `#define` to turn on and off the features in the library, so
… people can remove the features that they don't want so they can have a smaller size of the code.
OK, so I don't need any of these libraries anymore. I found there is a small library named Fat16 (
GitHub - greiman/Fat16: Smaller FAT16 only library for Arduino) and it supports appending. Thanks anyway!
July 27, 2021, 4:50am
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.