Keil Logo

MSD_File

The MSD_File example application shows the use the Flash File System to store, retrieve, and manage files on a USB Mass Storage Device. Examples are located in the folder \ARM\Boards\vendor\board\RL\USB\Host.

  1. Load the project MSD_File.uvproj.
  2. Build the project.
  3. Power-up and connect the target board.
  4. Download application to target board.
  5. Test the following file commands from a serial window:

    Command Description
    CAP "fname" [/A] Captures serial data and stores it in the file fname.
    /A - the option appends data to a file.
    COPY "fin" ["fin2"] "fout" Copy of the file fin to the file fout.
    The fin2 option merges the file fin and fin2 into the file fout.
    DEL "fname" Deletes the file fname.
    DIR ["mask"] Displays the list of files and folders.
    FILL "fname" [nnnn] Creates a file fname and fills it with text.
    nnnn - the option specifies the number of lines containing the fill-text (default is 1000).
    FORMAT [labName] [/FAT32] Formats the media and gives it a label labName.
    The option /FAT32 enforces formatting the media as FAT32.
    REN "fname1" "fname2" Renames the file fname1 file to fname2.
    TYPE "fname" Displays the content of the file fname.

Examples of using the commands:

  1. FORMAT KEIL
    Formats the media and give it a label KEIL.
  2. FILL "U:\Test folder\Test file.txt"
    Creates a long file name Test file.txt in the folder Test folder and fills it with text.
  3. DIR "U:\Test folder\*.*"
    Displays all the files of the folder Test folder.
  4. TYPE "U:\Test folder\Test file.txt"
    Displays the content of the file Test file.txt located in the folder Test folder.
  5. REN "U:\Test folder\Test file.txt" "Test file renamed.txt"
    Renames the file Test file.txt located in the folder Test folder to Test file renamed.txt.
  6. COPY "U:\Test folder\Test file renamed.txt" "U:\test.txt"
    Copies the file Test file renamed.txt located in the folder Test folder to the file test.txt located in the root folder.
  7. DEL "U:\Test folder\Test file renamed.txt"
    Deletes the file Test file renamed.txt.
  8. DEL "U:\Test folder\"
    Delete the folder Test folder.
  9. DIR "U:\*.*"
    Displays all the files of the root folder.
  10. TYPE "U:\test.txt"
    Displays the content of the file test.txt.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.