Conversation
There was a problem hiding this comment.
Pull request overview
Updates the vendored FatFS library under lib/fatfs/source to ChaN FatFS R0.16 (2025), bringing in upstream fixes and feature work (notably exFAT getcwd / .. path handling and directory iteration fixes).
Changes:
- Sync core FatFS sources (
ff.c,ff.h) and documentation (00history.txt,00readme.txt) to R0.16. - Update FatFS configuration template (
ffconf.h) to the new revision ID and option set. - Refresh disk I/O skeleton headers/sources (
diskio.h,diskio.c) to the 2025 upstream template.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/fatfs/source/ffconf.h | Updates FatFS configuration header to R0.16 and changes several default config values. |
| lib/fatfs/source/ff.h | Updates public FatFS API/types to R0.16 (new structs/fields and config include logic). |
| lib/fatfs/source/ff.c | Updates FatFS implementation to R0.16 (upstream fixes/features and internal refactors). |
| lib/fatfs/source/diskio.h | Updates low-level disk I/O interface header comments and annotations. |
| lib/fatfs/source/diskio.c | Updates the disk I/O “skeleton” glue example template. |
| lib/fatfs/source/00readme.txt | Bumps readme version label to R0.16. |
| lib/fatfs/source/00history.txt | Appends upstream history entries for R0.15a/R0.15b/R0.16. |
Comments suppressed due to low confidence (1)
lib/fatfs/source/ffconf.h:186
- FF_VOLUMES was reduced to 1. However, the host MSC file explorer mounts devices using drive numbers derived from dev_addr (e.g., "0:", "1:", ...), so only supporting a single logical drive will make additional devices fail with FR_INVALID_DRIVE. Consider keeping FF_VOLUMES at its previous value (e.g., 4) or setting it to match CFG_TUH_DEVICE_MAX for that example.
#define FF_VOLUMES 1
/* Number of volumes (logical drives) to be used. (1-10) */
#define FF_STR_VOLUME_ID 0
#define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add lib/fatfs to deps_mandatory in get_deps.py, pinned to R0.16 (commit 30ca13c6) from github.com/abbrev/fatfs mirror - Move TinyUSB custom ffconf.h to examples/host/msc_file_explorer/src/ with project-specific settings: FF_CODE_PAGE=437, FF_USE_LFN=1, FF_FS_RPATH=2, FF_VOLUMES=4, FF_FS_NORTC=1 - get_deps.py removes stock ffconf.h after clone to avoid conflict - Remove vendored fatfs source files from git tracking FatFS R0.16 includes important fixes since R0.15: - Fixed FAT32 FsInfo regression (forced full FAT scan on f_getfree) - Fixed f_readdir infinite loop (from R0.15b) - f_getcwd/.. now works on exFAT - Added FF_FS_CRTIME support
hathach
left a comment
There was a problem hiding this comment.
thank you for the PR. Yeah, there is no official fatfs repo, but there is a mirror abbrev/fatfs, which seems to be regular updated. Let use that as dependency, I also move the customize ffconf.h to the example. That would make updating fatfs easier in the future.
|
| target | .text | .rodata | .data | .bss | total | % diff |
|---|---|---|---|---|---|---|
| msp_exp432e401y/msc_file_explorer | 37,228 → 37,252 (+24) | — | — | — | 37,760 → 37,784 (+24) | +0.1% |
| ch32v203c_r0_1v0/msc_file_explorer | 39,928 → 39,948 (+20) | — | — | — | 40,184 → 40,204 (+20) | +0.0% |
| hpm6750evk2/msc_file_explorer | 48,552 → 48,576 (+24) | — | — | — | 48,704 → 48,728 (+24) | +0.0% |
| ea4088_quickstart/msc_file_explorer | 32,296 → 32,312 (+16) | — | — | — | 32,732 → 32,748 (+16) | +0.0% |
| lpcxpresso1769/msc_file_explorer | 32,492 → 32,508 (+16) | — | — | — | 32,872 → 32,888 (+16) | +0.0% |
| metro_m4_express/msc_file_explorer | 32,944 → 32,960 (+16) | — | — | — | 32,952 → 32,968 (+16) | +0.0% |
| lpcxpresso18s37/msc_file_explorer | 34,724 → 34,740 (+16) | — | — | — | 35,170 → 35,186 (+16) | +0.0% |
| portenta_c33/msc_file_explorer | 35,417 → 35,433 (+16) | — | — | — | 35,417 → 35,433 (+16) | +0.0% |
| ea4357/msc_file_explorer | 35,972 → 35,988 (+16) | — | — | — | 36,418 → 36,434 (+16) | +0.0% |
| metro_m7_1011/msc_file_explorer | 37,352 → 37,368 (+16) | — | — | — | 37,360 → 37,376 (+16) | +0.0% |
Size Difference ReportBecause TinyUSB code size varies by port and configuration, the metrics below represent the averaged totals across all example builds. Note: If there is no change, only one value is shown. Changes >1% in sizeNo entries. Changes <1% in sizeNo entries. No changes
|
It's strange that FatFS, being so popular and awesome, doesn't have an official public git repo.
Anyway, we were 3 years out of date: https://elm-chan.org/fsw/ff/updates.html