MarsRoverFirmware icon indicating copy to clipboard operation
MarsRoverFirmware copied to clipboard

SD Card Driver

Open jetkov opened this issue 5 years ago • 6 comments

  • We should have a general SD card driver (do we need FS)

jetkov avatar May 29 '20 01:05 jetkov

@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.

jetkov avatar May 29 '20 04:05 jetkov

I've assigned myself to this now

a-gratton avatar Jun 01 '20 03:06 a-gratton

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.

a-gratton avatar Jun 07 '20 04:06 a-gratton

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.

wmmc88 avatar Jun 07 '20 17:06 wmmc88

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.

a-gratton avatar Jun 08 '20 04:06 a-gratton

What's the status on this?

a-ebrahim avatar Feb 17 '21 21:02 a-ebrahim