Comments (5)
Sorry I didn't get back sooner. I am in am in an area of California that had a three day power outage.
For a long term applications like this I would use a design that does not create or extend files. I would avoid using timestamps in directories. This would avoid any corruption of directories or the file allocation table
I would prepare an SD with an empty file for each day of logging.
I would open a file at the start of each day and rewrite the file using 512 byte writes. Writing 512 byte blocks on 512 byte boundaries will prevent read/update/write operations.
Is there a specific MCU/family with best reliability?
I can't comment on a specific MCU. Reliability depends on how the MCU is integrated into the system and the board support package's system software.
Specific MicroSD/family with best reliability?
I would use one of the popular mid-range cards. I like Samsung and SanDisk. High end cards buy performance, not reliability.
Is dedicated SPI mode recommended vs shared SPI with another device?
If data rates allow, use shared mode. Shared mode forces the card to program flash from the cards internal RAM buffers each time chip select is raised.
Reduction in SPI data rate?
I don't understand this question.
Pullups on SPI data lines?
I use sockets with 10k pullups.
Any specific SdFat usage recommendations, such as pre-allocation etc?
See above.
Any specific FAT32 or exFAT usage recommendations?
Either is OK. FAT32 is limited in file size but you should not write huge files.
Any other recommendations for high reliability which come to mind?
Testing is key to reliability. If possible build several systems and test with faster rates.
Edit: For SD cards on SPI, all modern cards have sufficient performance. Don't pay for high end cards that are for 4K video.
from sdfat.
Very interesting things discussed here. I was also curious about the similar thing.
@greiman you mentioned about
For a long term applications like this I would use a design that does not create or extend files. I would avoid using timestamps in directories. This would avoid any corruption of directories or the file allocation table
So what I want to do is everytime my system reboots I want to create a new directory and inside that one I have multiple log files say with fixed number of lines of the data. Like each log file has 10K number of lines. So this approach is what you think may result in corruption of directories in file allocation table?
from sdfat.
The main way a FAT file system is corrupted is when a crash happen during directory update or cluster allocation.
FAT and exFAT were not designed to be crash safe. Some Linux systems are better but the best way is a journaling file system.
https://en.wikipedia.org/wiki/Journaling_file_system
https://pages.cs.wisc.edu/~remzi/OSTEP/file-journaling.pdf
So avoiding crashes is the best approach.
from sdfat.
This two file system is very first time for me. And I think not stright to implement that's why do not heard about that or have any library supporting the same in arduino.
from sdfat.
Journaling file systems are complex to implement. FAT/exFAT is not good base for such a file system.
Arduino is a not suitable for building a reliable system if crashes are possible. Arduino could never be certified for safety critical use.
Here is the kind of system that can be safe. I was involved with its early development in the late 1980s.
from sdfat.
Related Issues (20)
- 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
- 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
- Unable to share the same SPI bus with TFT_eSPI on ESP32 HOT 1
- Problems with multiple SD card HOT 3
- Long timeout calling begin() on Teensy 4.1 when no card present HOT 5
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.