Update FatFS to R0.16 via abbrev/fatfs dependency#3583
Conversation
- 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
There was a problem hiding this comment.
Pull request overview
This PR updates TinyUSB’s FatFS integration from vendored R0.15 sources to a managed dependency (abbrev/fatfs) pinned to an R0.16 commit, and relocates TinyUSB’s custom ffconf.h into the msc_file_explorer example so project-specific settings stay out of the upstream mirror.
Changes:
- Add
lib/fatfsas a mandatory dependency intools/get_deps.pyand remove upstreamffconf.hafter cloning so the example’s custom config is used. - Update the example-specific
ffconf.hfor the new FatFS revision ID / options. - Remove previously vendored FatFS source and documentation files from
lib/fatfs/.
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/get_deps.py | Adds FatFS as a mandatory cloned dependency and deletes upstream ffconf.h post-clone. |
| examples/host/msc_file_explorer/src/ffconf.h | Updates the example’s FatFS configuration to match the newer FatFS revision/options. |
| lib/fatfs/source/ffsystem.c | Removed from git tracking (now provided by the dependency mirror). |
| lib/fatfs/source/ff.h | Removed from git tracking (now provided by the dependency mirror). |
| lib/fatfs/source/diskio.h | Removed from git tracking (now provided by the dependency mirror). |
| lib/fatfs/source/diskio.c | Removed from git tracking (now provided by the dependency mirror). |
| lib/fatfs/source/00readme.txt | Removed from git tracking (now provided by the dependency mirror). |
| lib/fatfs/source/00history.txt | Removed from git tracking (now provided by the dependency mirror). |
| lib/fatfs/LICENSE.txt | Removed from git tracking (now provided by the dependency mirror). |
Comments suppressed due to low confidence (3)
examples/host/msc_file_explorer/src/ffconf.h:130
- Spelling/grammar in this comment block: "requiers" should be "requires", and the sentence "It is recommended to be set 255" should be adjusted (e.g., "recommended to be set to 255"). These are user-facing docs in the config header and were touched in this update.
examples/host/msc_file_explorer/src/ffconf.h:262 - Spelling in this comment: "read current time form real-time clock" should be "from real-time clock".
examples/host/msc_file_explorer/src/ffconf.h:302 - Spelling in this comment block: "featuer" should be "feature".
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if d in deps_remove_files: | ||
| for f in deps_remove_files[d]: | ||
| fp = p / f | ||
| if fp.exists(): | ||
| fp.unlink() |
There was a problem hiding this comment.
The new deps_remove_files step assumes p is already an initialized git repo when p.exists() is true. Since lib/fatfs used to be a vendored directory, some worktrees may still have a non-git lib/fatfs/ present (e.g., leftover untracked files), causing git rev-parse HEAD to fail earlier and the script to crash on splitlines()[0]. Consider detecting a missing .git/ (or non-zero rev-parse) and re-initializing/cleaning the directory before continuing.
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
|
Summary
abbrev/fatfsGitHub mirror as a managed dependency viaget_deps.pyinstead of vendoring source filesffconf.htoexamples/host/msc_file_explorer/src/to keep project-specific settings separate from upstreamBased on #3581 by @non-bin. Rebased to current master with CI fixes.
Key changes
tools/get_deps.py: Addedlib/fatfstodeps_mandatory, pinned to R0.16 (commit30ca13c6). Addeddeps_remove_filesto delete stockffconf.hafter clone so the example's custom version takes precedence.examples/host/msc_file_explorer/src/ffconf.h: Custom config with TinyUSB-specific settings (FF_CODE_PAGE=437,FF_USE_LFN=1,FF_FS_RPATH=2,FF_VOLUMES=4,FF_FS_NORTC=1)lib/fatfs/from gitFatFS R0.16 highlights (since R0.15)
f_getfree()f_readdir()infinite loopf_getcwd()/..now works on exFATFF_FS_CRTIME(created-time timestamp) supportTest plan
msc_file_explorerforraspberry_pi_pico(CMake)msc_file_explorerformimxrt1064_evk(CMake)msc_file_explorerforstm32h743eval(CMake + Make)stm32h743eval🤖 Generated with Claude Code