You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/api/storage/FATFileSystem.md
+32-2Lines changed: 32 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,42 @@
2
2
3
3
<spanclass="images"><span>FATFileSystem class hierarchy</span></span>
4
4
5
-
[Add description here.]
5
+
The FAT file system is a well-known and established disk oriented file system that you can find on Mbed OS and some lesser known operating systems such as Windows, Linux, and OSX. Due to its age and popularity, the FAT file system has become the de facto standard for forms of portable storage, such as flash drivers and SD cards.
6
+
7
+
-**Portable** - Due to its nearly universal support across OSs, the FAT file system provides and easy way to access storage from both the embedded system and a user's PC.
8
+
9
+
-**Embedded** - Built on the well-known ChanFS project, the FAT file system has been heavily optimized for embedded systems.
10
+
11
+
For additional information, please see the [storage overview page](/docs/development/reference/storage.html#declaring-a-file-system).
12
+
13
+
### Use cases
14
+
15
+
The main reason to use the FAT file system is for its usefulness on portable storage. Because of this, most applications using FAT will likely use it in conjunction with an SD card.
16
+
17
+
The first step to using the FAT file system will be formatting storage with FAT. This can be performed on a PC with the native format command, or it can be performed on Mbed OS with the `format` function.
18
+
19
+
**Note:** The FAT file system requires at minimum 256 erase blocks. You can find the number of blocks on a block device by dividing the block device's size by its erase size.
20
+
21
+
The FAT file system does support external flash, however it must allocate a full erase block for internal operations, which can get quite large for some forms of flash. If RAM consumption becomes a problem, we suggest switching to LittleFS. Fortunately, the Mbed OS file system APIs make switching file systems an easy task. One common strategy is to use the FAT file system for debugging, and switch to LittleFS when the application becomes stable.
22
+
23
+
### Usage
24
+
25
+
Instantiate the `FATFileSystem` class with a block device and file path.
26
+
27
+
The API that this presents is the standard Mbed OS file system API. Once declared, Mbed OS provides the retargeting layer for the standard C library.
28
+
29
+
The FAT file system can be easily swapped in place with other Mbed OS file systems and is a great method for prototyping applications.
Copy file name to clipboardExpand all lines: docs/reference/api/storage/storage.md
+16-2Lines changed: 16 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -27,9 +27,11 @@ The `fopen` function is similar to the open function above but associates a stre
27
27
28
28
-**Wear leveling** - Because the most common form of embedded storage is erodible flash memories, this file system provides a form of dynamic wear leveling for systems that cannot fit a full flash translation layer.
29
29
30
-
-**FATFileSystem** - The FAT file system is a well-known file system that you can find on almost every system, including PCs. The Mbed OS implementation of the FAT file system is based on ChanFS and is optimized for small embedded systems.
30
+
-**FATFileSystem** - The FAT file system is a well-known and established disk oriented file system that you can find on most OSs, including Windows, Linux, OSX, and Mbed OS.
31
31
32
-
-**Portable** - Almost every operating system supports the FAT file system, which is the most common file system found on portable storage, such as SD cards and flash drives. The FAT file system is the easiest way to support access from a PC.
32
+
-**Portable** - Due to its nearly universal support across OSs, the FAT file system provides and easy way to access storage from both the embedded system and a user's PC.
33
+
34
+
-**Embedded** - Built on the well-known ChanFS project, the FAT file system has been heavily optimized for embedded systems.
33
35
34
36
The [BlockDevice](https://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/class_block_device.html) class provides the underlying API for representing block-based storage that you can use to back a file system. Mbed OS provides standard interfaces for the more common storage media, and you can extend the BlockDevice class to provide support for unsupported storage.
35
37
@@ -63,6 +65,18 @@ We optimized this file system to work with a limited amount of RAM and ROM. It a
63
65
64
66
The "little" in the little file system comes from the focus on both keeping resource usage low and keeping the scope self-contained. Aside from the three targeted issues above, there is a heavy restriction against bloat in this software module. Instead, we push additional features to separate layers in the BlockDevice API that drives the Mbed OS storage stack. This gives Mbed OS a tool for remaining flexible as technology used by IoT devices develops.
65
67
68
+
#### The FATFileSystem
69
+
70
+
The FAT file system is a well-known and established disk oriented file system that you can find on Mbed OS and some lesser known operating systems such as Windows, Linux, and OSX. Due to its age and popularity, the FAT file system has become the de facto standard for forms of portable storage, such as flash drives and SD cards. Even for an embedded system, being able to interact with portable storage can be a valuable feature.
71
+
72
+
##### Portable
73
+
74
+
The primary feature of the FAT file system is the portability. With universal support across PC OSs, the FAT file system lets you to access storage from both the embedded system and a user's PC. This gives users an easy way to get information onto and off of the device.
75
+
76
+
##### Embedded
77
+
78
+
The Mbed OS FAT file system is built on the well-known ChanFS project. It has been optimized heavily for embedded systems and is one of the smallest FAT file system implementations out there.
79
+
66
80
### Partitioning
67
81
68
82
Partitioning allows you to split a block device among multiple storage users such that the split is portable across multiple systems. Partitioning also allows you to have multiple file systems that you can mount on one disk from both Mbed OS devices and host computers. The primary partitioning scheme that Mbed OS supports is the Master Boot Record (MBR).
0 commit comments