Skip to content
Development
Skill

/fatfs-integration

Use when integrating, porting, configuring, or debugging FatFs FAT/exFAT filesystems, diskio drivers, SD cards, SPI flash disks, or embedded file I/O failures

From plugin
aix-skills
3976 skills

Claude Code

$ npx -y skills add easyzoom/aix-skills --skill fatfs-integration --agent claude-code

SKILL.md

fatfs-integration.SKILL.md
name: fatfs-integration
description: Use when integrating, porting, configuring, or debugging FatFs FAT/exFAT filesystems, diskio drivers, SD cards, SPI flash disks, or embedded file I/O failures

FatFs Integration

Overview

Use this skill to integrate FatFs by proving the disk I/O layer before trusting filesystem behavior. FatFs is portable C, but the target-specific `diskio` functions, sector geometry, mount policy, and media timing decide whether it works reliably.

When To Use

Use this skill when:

  • The user wants to add or debug FatFs on SD card, eMMC, USB MSC, RAM disk, SPI flash, or block devices.
  • The issue involves `f_mount`, `f_open`, `f_read`, `f_write`, `FR_DISK_ERR`, `FR_NOT_READY`, `FR_NO_FILESYSTEM`, long filenames, Unicode, or exFAT.
  • The project uses `ff.c`, `ffconf.h`, `diskio.c`, or `FATFS`.

Do not use this skill when the raw block device cannot read/write sectors yet; debug the storage driver first.

First Questions

Ask for:

  • Media type and transport: SDIO, SPI SD, eMMC, USB MSC, RAM disk, or flash translation layer.
  • Sector size, sector count, erase/block size, and whether writes are cached.
  • `ffconf.h`, `diskio.c`, and current FatFs return code.
  • RTOS or bare-metal runtime and whether reentrancy is enabled.
  • Whether formatting is allowed. Formatting can destroy user data.
  • Long filename, Unicode, exFAT, timestamp, and multi-volume requirements.

Integration Checklist

1. Prove disk I/O. `disk_initialize`, `disk_status`, `disk_read`, `disk_write`, and `disk_ioctl` must work independently.

1. Match sector geometry. FatFs expects logical sectors and correct sector count. `GET_SECTOR_COUNT`, `GET_SECTOR_SIZE`, and `CTRL_SYNC` matter.

1. Mount before formatting. Try `f_mount` first. Ask before `f_mkfs` or any operation that can erase media.

1. Configure `ffconf.h` intentionally. Reentrancy, LFN buffers, exFAT, code page, relative paths, and timestamp support affect RAM and behavior.

1. Add locking if shared. Enable and implement synchronization when multiple tasks can access the same volume.

1. Verify persistence. Write, `f_sync`/`f_close`, unmount/reset, remount, and read back.

Common Failures

  • `FR_DISK_ERR` from incomplete `disk_ioctl` or bad `CTRL_SYNC`.
  • `FR_NO_FILESYSTEM` from wrong sector offset or unformatted media.
  • Data loss because files are not closed or synced before power loss.
  • LFN stack/heap buffers exceed MCU memory.
  • SD card init works at low speed but data transfer fails after clock switch.
  • Multi-task access corrupts files without FatFs reentrancy support.

Verification

Before claiming FatFs works:

  • State media, sector size/count, `ffconf.h` options, and mount path.
  • Confirm disk read/write/ioctl tests.
  • Confirm mount behavior and whether format was skipped, approved, or performed.
  • Confirm create/write/sync/readback after reset or remount.
  • Confirm locking policy when RTOS is used.

Example

User:

FatFs f_mount 返回 FR_NO_FILESYSTEM。

Agent:

1. Asks for media type, sector offset, diskio implementation, and whether formatting is allowed. 1. Tests raw sector read and `GET_SECTOR_COUNT`. 1. Mounts before formatting and asks before `f_mkfs`.

Read more
@easyzoom
Ships withaix-skills

AIX Skills is a public collection of Agent Skills, templates, and references for building repeatable AI workflows.

Stars on GitHub

Momentum

stars in total
39
Star history of easyzoom/aix-skills on GitHub, a chart by star-history.com

Other skills on aix-skills.

8051-mcu-debug

8051-mcu-debug

Use when debugging 8051-compatible microcontrollers, 51 MCU firmware, STC download issues, Keil C51 projects, interrupts, timers,…

@easyzoom@easyzoomInstall Skill
avem-integration

avem-integration

Use when integrating, evaluating, configuring, or debugging Avem embedded C framework modules, event-driven components, drivers,…

@easyzoom@easyzoomInstall Skill
ble-gatt-integration

ble-gatt-integration

Use when integrating, designing, or debugging BLE GATT services, characteristics, descriptors, MTU, notifications, indications,…

@easyzoom@easyzoomInstall Skill
bootloader-debug

bootloader-debug

Use when debugging embedded bootloaders, application jumps, vector table offsets, firmware upgrade flow, OTA state, image…

@easyzoom@easyzoomInstall Skill
canbus-integration

canbus-integration

Use when integrating, porting, configuring, or debugging CAN bus libraries, CANBus-Triple, MCP2515, CAN frames, bit timing,…

@easyzoom@easyzoomInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about fatfs-integration.

Which coding agents can use fatfs-integration?
fatfs-integration installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.