DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
On top of the SMART MTD layer is the Smart Filesystem code. The SmartFS code uses the logical sector services of the SMART MTD layer to provide file and directory level management, such as creating new files, chaining logical sectors together to create files, creating directories and file / directory search and management routines.
| Smart FS | fs / smartfs / * | ::UWCTOKENCOLSPANS:4::|||||||
|---|---|---|---|---|---|---|---|---|
| SMART MTD | drivers / mtd / smart.c | ::UWCTOKENCOLSPANS:4::|||||||
| MTD Driver | m25px | sst25 | filmtdfilemtd | etc. | ||||
| HW Driver | spi dev | spi dev | VFS | ...… | ||||
Example SmartFS Device Setup
...
An example 128K Byte Flash with 32K and 4K Erase Block sizes and 256 byte page read/write sizes:
| Bulk Erase | Entire Device | ::UWCTOKENCOLSPANS:18::|||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Sector Erase | 32K | ::UWCTOKENCOLSPANS:7::32K | ::UWCTOKENCOLSPANS:3::32K | ::UWCTOKENCOLSPANS:3::32K | ::UWCTOKENCOLSPANS:5::||||||||||||||||||||||||||||||||
| Sector Erase | 4K | … ::UWCTOKENCOLSPANS:5::... | 4K | 4K | ...… | 4K | 4K | ...… | 4K | 4K | ...… | 4K | ::UWCTOKENCOLSPANS:3::||||||||||||||||||||||||
| Page read/write | 256 | 256 | ...… | 256 | 256... ::UWCTOKENCOLSPANS:10:: | … | 256 | ...… | 256 | |||||||||||||||||||||||||||
| Logical Sector (FS) | 512 | ::UWCTOKENCOLSPANS:2::... | 512 ::UWCTOKENCOLSPANS:2:: | ... ::UWCTOKENCOLSPANS:13::… | 512 | … | ||||||||||||||||||||||||||||||
In the example above, a SMART MTD logical sector size of 512 bytes was chosen. On the 128K Byte FLASH represented in the table above, this means there would be:
...
128K / 256 = 512 Logical Sectors Total- {{
4K / 256 = 16 Logical Sectors per Erase Block}} - {{
256 / 256 = 1 MTD Read/Write Block per SMART Logical Sector}} - {{
10 / 256 = 3.9% Overhead for logical sector headers}}
A maximum of about 506 files / directories supported (considering format overhead)Allocations to files in 256 byte chunks (a zero-length file consumes 256 bytes)
...
The cache always contains the format and root-directory logical to physical mapping entries, and then stores additional mappings of recently used logical sectors. When a logical sector is requested that is not contained in the cache, then the MTD device is scanned front-to-back until it's physical location on the device is located. Additionally, if the number of logical sectors per erase block is 16 or less, then the "free count" and "release count" can be packed into a single byte per erase block.
_CONFIG_MTD_SMART_MINIMIZE_RAM=y,
CONFIG_MTD_SMART_SECTOR_CACHE_SIZE=64_
Item | RAM Requirement | 1MB / 256 Logical | 8MB / 1024 Logical |
|---|---|---|---|
dev struct | 368-400 (approx) | 392 | 392 |
Logical sector cache | cache entries * 6 | 384 | 384 |
Free sector bitmap | total sectors / 8 | 512 | 1024 |
Erase block free count | total erase blocks | 16 | 128 |
Erase block release count | total erase blocks | 16 | 128 |
Wear status | total erase blocks / 2 | 8 | 64 |
MTD sector R/W buffer | logical sector size | 256 | 1024 |
FS sector R/W buffer | logical sector size | 256 | 1024 |
Total | 1,832 | 4,168 |
...