Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Auto-Mounter

General Description

NuttX implements an auto-mounter than can make working with SD cards or other removable media easier. With the auto-mounter, the file system will be automatically mounted when media is inserted and automatically unmounted when the media is removed.

...

For applications that write to the removable media, the automatic unmount is still beneficial (as opposed to leaving a broken mount in place) although should not be relied upon for a proper solution.

Board-Specific Support

Like many components of NuttX, the auto-mounter has a upper-half/lower-half architecture:

...

  • Lower Half. The lower half is defined by a standard interface. That interface definition is in the header file include/nuttx/fs/automount.h. The lower half interface provides: (1) mount information including file system type, block driver path, and mount point path, (2) mount and unmount retry delays, and (3) and callbacks to attach to and management the media insertion / removal interrupts.

Example Implementation

There is an example implementation of this lower half interface at boards/arm/sama5/sama5d4-ek/src/sam_automount.c. The boards/arm/sama5/sama5d4-ek/Kconfig as the board-specific configuration for the auto-mounter. You can see the configuration settings in the boards/arm/sama5/sama5d4-ek/configs/nsh/defconfig and boards/arm/sama5/sama5d4-ek/configs/nxwm/defconfig configuration files:

...