Keil Logo

SD_File

The SD_File example program shows the use of the Flash File System to store, retrieve, and manage files on a Secure Data Card drive. Example are located in the folders \ARM\Boards\vendor\board\RL\FlashFS.

  1. Open the SD_File.uvproj project.
  2. Build the project.
  3. Connect ULINK to the PC and to the target board.
  4. Power-up the target board.
  5. Download the example to the target board.
  6. 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 gives it the label KEIL.
  2. FILL "M:\Test folder\Test file.txt"
    Creates a long file name Test file.txt in the folder Test folder and filles the file with text.
  3. DIR "M:\Test folder\*.*"
    Displays all the files of the folder Test folder.
  4. TYPE "M:\Test folder\Test file.txt"
    Displays the content of the file Test file.txt.
  5. REN "M:\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 file in the same folder.
  6. COPY "M:\Test folder\Test file renamed.txt" "M:\test.txt"
    Copies the file Test file renamed.txt located in the folder Test folder to the file TEST.TXT of the root folder.
  7. DEL "M:\Test folder\Test file renamed.txt"
    Deletes the file Test file renamed.txt from the folder Test folder.
  8. DEL "M:\Test folder\"
    Deletes the folder Test folder.
  9. DIR "M:\*.*"
    Displays all file names located in the root folder.
  10. TYPE "M:\test.txt"
    Displays the content of the file TEST.TXT which is located in the root folder.
  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.