Comments (6)
Running the standard SdInfo sketch will also take some time till "freeClusters: " display the result:
uint32_t volFree = sd.vol()->freeClusterCount();
from sdfat.
beginTransaction() should set only the SPI speed , bit order, and data mode. begin() will set the default speed/mode but may be slower since the SPI controller will be initialized.
freeClusterCount() must read the entire FAT to find the free cluster count. This will take a long time for a 64G card.
You can limit reading the FAT to the first call by setting this symbol at about line 80 of SdFatConfig.h.
//------------------------------------------------------------------------------
/**
* Set MAINTAIN_FREE_CLUSTER_COUNT nonzero to keep the count of free clusters
* updated. This will increase the speed of the freeClusterCount() call
* after the first call. Extra flash will be required.
*/
#define MAINTAIN_FREE_CLUSTER_COUNT 0
from sdfat.
I tried to set MAINTAIN_FREE_CLUSTER_COUNT to "1"
but it did not help, the SdInfo sketch still take the same amount of time to return freeClusterCount(). So I guess this is inevitable for the first time this function is called.
from sdfat.
Thanks all! I tried a smaller card (32Gb) and with the new method it's down to 3 sec.
I just need to monitor and check that data collection to SD card is working fine. Are there any other alternative statistics that could be performed much faster? I'm looking for the range of 10ms.
from sdfat.
The first call to freeClusterCount() after SD.begin() will take a long time.
If MAINTAIN_FREE_CLUSTER_COUNT is nonzero, the time should be much less than a ms after the first call.
Here is the code:
int32_t FatVolume::freeClusterCount() {
#if MAINTAIN_FREE_CLUSTER_COUNT
if (m_freeClusterCount >= 0) {
return m_freeClusterCount;
}
#endif // MAINTAIN_FREE_CLUSTER_COUNT
from sdfat.
closed
from sdfat.
Related Issues (20)
- Questions about file opening mode a+ HOT 2
- Sdfat on stm32 if sd card removed stm32 crash HOT 22
- SDFAT compatibility with Arduino Giga HOT 1
- ExFatLogger vs LowLatencyLogger different behaviour HOT 7
- Running two SdCards are not working HOT 2
- addApbChangeCallback(): duplicate func when using with TFT_eSPI HOT 5
- Problems with Teensy 4.0 and Adafruit XTSD with SdFat. HOT 2
- [question]How to speed up sd writes on Arduino Uno r4? HOT 7
- Examples of SDFat HOT 4
- sdfat does one write to sd and then nothing HOT 1
- SdFat recommended usage for long term data logging HOT 5
- Pin selection for esp8266 HOT 1
- Did not work at ESP32-CAM HOT 6
- MMC_ERASE HOT 2
- Wrapper to fs::FS to use SDfat in ESPAsyncWebserver HOT 6
- pico-sdk only rp2040 implementation HOT 7
- ESP32 S3 always fails to mount card HOT 10
- Unable to format flat Spiflash module with ESP8266 HOT 4
- Mount issues for a Windows-formatted card HOT 35
- SD NAND XTSD01G (surface mounted chip) not formating HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdfat.