1.22 MPFS File System Using NVM and FAT File System Using SDMMC media
This application shows an example of using the MPFS File System on NVM and FAT File System on SDMMC media simultaneously.
Description
File System Operations on NVM and SD Card
- The application contains the
MPFS disk image placed in the internal Flash memory (NVM). The disk image
contains below file:
abc.txt, Size = 13 bytes. The content of the file is:HELLO WORLD !
- An SD card is used as another disk, which might have FAT16 or FAT32 implemented on it (dependent on the formatting of SD card)
- On board RTC is used by file
system to update the time stamps of the file. Initial value to RTC is the
app.c compile time - The application opens and
reads the contents of the file
abc.txtin NVM and copies the contents to the file toFILE.txtin the SD card - Once the copy is successful
from NVM to SD card, the application writes the last modified timestamp of
FILE.txtupdated by file system toFILE.txton SD card - 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
- RTC to update file modification time
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_mpfs_multi_disk/firmware.
To build the application, refer to the following table and open the project using its IDE.
| Project Name | Description |
|---|---|
| sam_e54_xpro.X | MPLAB X project for SAM E54 Xplained Pro Evaluation Kit |
Setting Up the Hardware
The following table shows the target hardware for the application projects.
| Project Name | Description |
|---|---|
| sam_e54_xpro.X | SAM E54 Xplained Pro Evaluation Kit |
Setting Up SAM E54 Xplained Pro Evaluation Kit
- To run the demo, the following additional hardware are required:
- SD card
- Connect the Debug USB port on the board to the computer using a micro USB cable
Running the Application
- Build and program the application using its IDE.
- Insert the SD card in the SD card slot of the device.
- The LED is turned ON when:
- The content from the NVM
media (
HELLO WORLD !) is copied to SD card successfully - Application has successfully written the last modified time stamp to SD card
Refer to the following table for LED name:Board LED Name SAM E54 Xplained Pro Evaluation Kit LED0 - The content from the NVM
media (
- If Success, insert the SD card on to the host PC.
FILE.txtshould have the following content:HELLO WORLD ! File Modified on [dd/mm/yy hh:mm:ss]
Note:
- The initial time loaded into
RTC is the compile time of
app.cfile - The File Modified time stamp
mentioned above is the RTC time retrieved after writing
HELLO WORLD !toFILE.txt - If step 3 is repeated then
new timestamp along with
HELLO WORLD !is appended to the existingFILE.txt - If device is reset, RTC will
be again loaded with compile time of
app.cfile
