Comments (3)
There are two different implementations of file system drivers for the FAT file system in Circle. The historic first in lib/fs/fat/, which has limited function and the ported FatFs library in addon/fatfs/ with full function and higher performance.
The first one uses a buffer cache, which is flushed by calling CFATFileSystem::Synchronize()
or automatically, when a file is closed, which was open for write.
I suppose you are using circle-stdlib/-newlib, which is based on the second option (FatFs library). As I understand it, with FatFs you can power off your Raspberry Pi at any time, when no file is open for write. You do not need to explicitly un-mount the file system before. Furthermore, when a power off occurs, when a file is open for write, you can loose the contents of this file at maximum, not more. You can improve this situation even more, when you call fsync()
from time to time for this file. fsync()
is implemented in circle-newlib and calls the FatFs function f_sync() by itself. Please read this application note for info about possible data loss with FatFs.
Currently it seems impossible to me to modify one of these file system drivers for a fully synchronous operation, but perhaps the situation with FatFs is enough for you.
from circle.
Thank you for the prompt reply. I think the situation is perhaps worse with circle-stdlib than it is with Circle itself. If you're programming with Circle, then you know you're working outside an operating system. You know that you probably have to take actions in code that you would not take, if you were working on an operating system. In any case, you're most likely working with code specifically written for that environment.
Using circle-stdlib obscures the fact that there is no operating system, which is both its strength and its weakness. circle-stdlib makes it easy to port existing code and libraries that were originally intended for Unix-like systems, without having to make many changes. This is great, but can lead to problems.
On Linux, a background process flushes disk changes periodically. Also, modern Linux filesystems are journalling, so it's relatively easy to repair changes related to a bad shut-down. Without these protections, the developer has to take a lot more care. But if you're using code in existing libraries, it's not always easy to work out what changes need to be made.
In any event, if circle-stdlib uses ChaN's FATFS implementation directly, and not Circle's filesystem support, then this isn't a problem that can be solved in Circle itself. So please close this.
By the way -- is there a place to ask general questions about Circle, without having to raise an issue in GitHub? I have many questions ;)
from circle.
Understood. There is a Q&A category in the Discussions for asking questions without open an issue.
from circle.
Related Issues (20)
- I2C feature request: add support for repeated start HOT 6
- USB CDC/ACM gadget HOT 19
- GetClockTicks without wrap HOT 3
- GPU support on Raspi 4 HOT 4
- Circle linker failure with softfp HOT 2
- Make USB gadget vendor and device strings configurable HOT 2
- Support for touchscreens with additional reports in HID descriptor HOT 7
- Question about log when testing with Qemu HOT 2
- Help with setting PREFIX HOT 4
- Question: Waveshare 5'' DSI display support? HOT 2
- Waveshare 15.6inch Capacitive Touch Screen HOT 2
- Can I run OpenCV? HOT 2
- Sample "07-usbstorage" fails with Pi5 HOT 8
- Unsuportted USB touch screen driver - Big Tree Tech HDMI7 HOT 10
- How to do GPIOPin button Interrupt correctly HOT 23
- FIQ support on RPI Zero 2 HOT 3
- How to remove all text not from own CSerialDevice HOT 11
- Ability to set HDMI output refresh rate HOT 3
- About memory management on CM4 HOT 2
- Building circle-stdlib w/Circle: This header is not available in freestanding mode. HOT 6
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 circle.