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)
- 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 11
- 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
- Unable to share the same SPI bus with TFT_eSPI on ESP32 HOT 3
- Problems with multiple SD card HOT 3
- Long timeout calling begin() on Teensy 4.1 when no card present HOT 5
- SdFat 2.22 with USER_SPI1 pin + another USER_SPI2 in SPI_Mode3 HOT 2
- Arduino-Pico: huge slowdown with v2.2.2 (vs.2.1.1) HOT 5
- Problem with SdFat and TwoWire instance. HOT 3
- sd.begin(SPI_CONFIG) breaks my DMA ADC datalogger on the SAMD51 HOT 5
- Issue after latest update. HOT 17
- exFat sd cards not working with Sdinfo.ino example, only FAT32 card HOT 7
- Allocating bin file with 0s HOT 2
- CS_Pin has to be driven high on ESP32 (to be low at the SDCARD) because of some logic inbetween HOT 3
- Initialization fails with ESP32 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.