Skip to content
Skills Library
Programming · Tool integration

fatfs-integration

/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

Repository
aix-skills ↗
Licence
MIT
Last repository change
17.07.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 17.07.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

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

Original author 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

How it works

  1. Overview
  2. When To Use
  3. First Questions
  4. Integration Checklist
  5. Common Failures
  6. Verification
  7. Example
Original SKILL.md headings · 81 lines, 434 words
SKILL.md preview
---
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:

```text
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`.

Versions

The database has no other skills named fatfs-integration.

Database snapshot: 13.11.2026 · package version 40935ed1f38b (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100u8g2-integration
    Use when integrating, porting, configuring, or debugging U8g2 displays, OLED/LCD drivers, I2C/SPI callbacks, fonts, frame buffers, or monochrome embedded UI
  • 100easylogger-integration
    Use when integrating, porting, configuring, or debugging EasyLogger output, filters, timestamps, colors, async logging, flash logging, or embedded log loss
  • 100bus-drivers-i2c-spi
    I2C and SPI bus driver skill for Linux client drivers. Use when writing i2c_driver or spi_driver, register access over bus, DMA SPI transfers, or ACPI/DT client binding. Activates on queries about i2c_client, spi_driver, regmap I2C, SPI transfer, or Linux I2C SPI subsystem.
  • 100embedded-firmware
    Embedded firmware and device drivers — BSP development, peripheral driver implementation (UART, SPI, I2C, GPIO, DMA, Timer), RTOS integration (FreeRTOS, Zephyr), and system validation. Use when writing chip bring-up firmware, implementing HAL drivers, porting an RTOS, or…
  • 100device-drivers
    Use when writing or debugging Linux drivers: platform, I2C/SPI, device-tree, char-device, IRQ, DMA, regmap, PM, sysfs, udev, NACK, -EREMOTEIO, or probe failures.
  • 100platform-port
    Guide porting FastLED to new MCU platforms, including int.h types, clockless drivers, SPI implementations, and platform detection. Use when adding support for a new microcontroller family or board.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.