1.3 FAT File System using NVM and SDMMC Media

This application shows an example of using the FAT File System to access files across multiple media (NVM, SDMMC).

Description

File System Operations on NVM and SD Card:

  • The application contains a FAT disk image consisting of a Master Boot Record (MBR) sector, Logical Boot Sector, File Allocation Table, and Root Directory Area, placed in the internal Flash memory (NVM)
  • A SD card is used as another disk, which might have FAT16 or FAT32 implemented on it (dependent on the formatting of SD card)
  • The application searches the NVM media for a file named FILE.TXT, opens and reads the contents of the file in NVM and copies the contents to the file, FILE.TXT, in the SD card
  • Once the copy is successful, an addition string “Test is successful” is added to the file. If the write operation is successful, LED indication is provided

File system layer uses:

  • Memory driver to communicate with underlying NVM media.
  • SDMMC Driver to communicate to SD Card

Downloading and Building the Application

To clone or download this application from Github, go to the main page of this repository and then click Clone button to clone this repository or download as zip file. This content can also be downloaded using content manager by following these instructions.

Path of the application within the repository is apps/fs/nvm_sdmmc_fat_multi_disk/firmware.

To build the application, refer to the following table and open the project using its IDE.

Project NameDescription
pic32cz_ca70_curiosity_ultra.XMPLABX project for PIC32CZ CA70 Curiosity Ultra Development Kit
pic32cz_ca70_curiosity_ultra_freertos.XMPLABX project for PIC32CZ CA70 Curiosity Ultra Development Kit

Setting Up the Hardware

The following table shows the target hardware for the application projects.

Project NameDescription
pic32cz_ca70_curiosity_ultra.X

pic32cz_ca70_curiosity_ultra_freertos.X

MPLABX project for PIC32CZ CA70 Curiosity Ultra Development Kit

Setting Up PIC32CZ CA70 Curiosity Ultra Development Kit

  • To run this application, following additional hardware is required
    • SD-Card formatted to fat file system
  • Connect the Debug USB port on the board to the computer using a micro USB cable

Running the Application

  1. Build and program the application using its IDE
  2. Insert the SD Card in the SD Card slot of the Device.
  3. The LED is turned ON when the content from the NVM media is copied to SD Card successfully
    Refer to the following table for LED name:
  4. If Success, Insert the SD Card on to your host PC
  5. FILE.txt should have the content “This data from NVM Disk Test is successful”