1.4 FAT File System using NVM and SDSPI Media

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

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 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
  • SDSPI Driver to communicate to SD Card over SPI

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_sdspi_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_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_freertos.X

MPLABX project for PIC32CZ CA70 Curiosity Ultra Development Kit

Running the Application

  1. Build and program the application using its IDE
  2. 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:
  3. If Success, Insert the SD Card on to your host PC
  4. FILE.txt should have the content “This data from NVM Disk Test is successful”