NetBurner 3.5.6
PDF Version
RAM Drive

This program illustrates basic file system operations for RAM drives:

  • Mounting a drive
  • Determining amount of used and free file space
  • Creating files
  • Writing data
  • Reading data
  • Un-mounting a drive

When the program executes it will display program status information through the debug serial port.

This example is similar to the EFFS-BASIC example, but uses a RAM drive for the file system. The RAM drive configuration is located in the 'ramdrvMcf.cpp' source file.

To build any of the EFFS- examples to use the RAM drive, add the 'ramdrvMcf.cpp' file to the build list and modify 'cardType.h' to define USE_RAM instead of USE_MMC and set the EXT_FLASH_DRV_NUM to the correct RAM drive number.

The RAM drive supports 12, 16 and 32 bit file systems. The most commonly used size is 12-bit, which supports drive sizes from 50k up to 2.8MB. If you change the FAT size, you must make the corresponding change in the function: int fstat = f_format(RAM_DRV_NUM, F_FAT12_MEDIA);

To change the RAM drive file size, edit ramdrv_mcf.cpp.

Minumum RAM drive file system sizes: FAT12: 50KB (most commonly used) FAT16: 2.8MB FAT32: 32MB

Note
All EFFS FAT examples require that you add the Embedded Flash File System File Allocation Table (EFFS FAT) library to your project: Add a Library to a Project