docs: add FS and FileService info

This commit is contained in:
2025-09-16 08:27:05 +02:00
parent dd0c7cca78
commit adde7a3676
3 changed files with 119 additions and 0 deletions

View File

@@ -73,6 +73,37 @@ lib_deps =
ESP8266WiFi@1.0
```
### Filesystem, Linker Scripts, and Flash Layout
This project uses LittleFS as the filesystem on ESP8266. Flash layout is controlled by the linker script (ldscript) selected per environment in `platformio.ini`.
- **Filesystem**: LittleFS (replaces SPIFFS). Although ldscripts reference SPIFFS in their names, the reserved region is used by LittleFS transparently.
- **Why ldscript matters**: It defines maximum sketch size and the size of the filesystem area in flash.
| Board / Env | Flash size | ldscript | Filesystem | FS size | Notes |
|-------------|------------|---------|------------|---------|-------|
| esp01_1m | 1MB | `eagle.flash.1m64.ld` | LittleFS | 64KB | Prioritizes sketch size on 1MB modules. OTA is constrained on 1MB.
| d1_mini | 4MB | `eagle.flash.4m1m.ld` | LittleFS | 1MB | Standard 4M/1M layout; ample space for firmware and data.
Configured in `platformio.ini`:
```ini
[env:esp01_1m]
board_build.filesystem = littlefs
board_build.ldscript = eagle.flash.1m64.ld
[env:d1_mini]
board_build.filesystem = littlefs
board_build.ldscript = eagle.flash.4m1m.ld
```
Notes:
- The ldscript name indicates total flash and filesystem size (e.g., `4m1m` = 4MB flash with 1MB FS; `1m64` = 1MB flash with 64KB FS).
- LittleFS works within the filesystem region defined by the ldscript, despite SPIFFS naming.
- If you need a different FS size, select an appropriate ldscript variant and keep `board_build.filesystem = littlefs`.
- On ESP8266, custom partition CSVs are not used for layout; the linker script defines the flash map. This project removed prior `board_build.partitions` usage in favor of explicit `board_build.ldscript` entries per environment.
## Building
### Basic Build Commands