MarsRoverFirmware
MarsRoverFirmware copied to clipboard
SD Card Driver
- We should have a general SD card driver (do we need FS)
@a-gratton if you are going to be working on this as part of the GPS driver please assign yourself, otherwise this task is open for someone else, but you will need to sync with @a-gratton.
I've assigned myself to this now
File system options: We could use either FATFileSystem or LittleFileSystem. LittleFS uses less resources and is less likely to corrupt data on the card during an unexpected shutdown. However, it is very difficult to work with outside of the mbed environment. FAT is heaver in terms of resource use and is not as resilient as LittleFS. However, it is a well known standard and easy to work with on all operating systems.
Considering one of the use cases for the SD driver will be pre-loading satellite data for the GPS (and that our micro controllers are overspecialized for our needs), I think that FAT is the better choice. However it is pretty easy to switch between these APIs if we decide to go with LittleFS.
Other APIs The SDBlockDevice API is used by the filesystem API to access the SD card, but we don't really need to do anything with it besides pass it to the filesystem API.
resiliency is probably better, especially because we always randomly shut off power, and the user space program they linked in that thread looks straight forward to use.
Also for interacting with the files we could go for C file IO (stdio) or C++ (fstream). C++ is easier to work with, but there seem to be major performance issues with it (although there is some debate about that).
The other option would be to not actually write a file handling wrapper and just leave the filesystem exposed for people to do their own file IO, but then there isn't much of a point to the SD card library.
What's the status on this?