Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

API Function

Description

Comments

FRESULT f_mount (FATFS* fs, const TCHAR* path, BYTE opt)

Mount filesystem specifed specified by path

Pass fs equal to NULL to unmount

FRESULT f_open (FIL* fp, const TCHAR* path, BYTE mode)

Open file

FRESULT f_close (FIL* fp)

Close file

FRESULT f_read (FIL* fp, void* buff, UINT btr, UINT* br)

Read file

FRESULT f_write (FIL* fp, const void* buff, UINT btw, UINT* bw)

Write file

FRESULT f_opendir (DIR* dp, const TCHAR* path)

Open a directory to read its content

FRESULT f_mkdir (const TCHAR* path)

Create a directory

FRESULT f_unlink (const TCHAR* path)

Delete an existing file or directory

The full description of the FAT file system API and data structures can be found in Middlewares/Third_Party/FatFs/Src/ff.h in the project source code directory.

...

The FreeRTOS application implements the following USB Host mode related CLI command::

Command

Description

Comments

usbfatls

Print content of the top directory and its subdirectories

3. Validating USB Host Mode Operation

...

  1. Format a USB Flash partition to FAT. Make sure that the FAT partition is using the same code page as configured by the _CODE_PAGE parameter in Projects/STM32H7_SOM/Applications/FreeRTOS/freertos_stm32h750/Inc/ffconf.h, e.g. for dosfstools v4.2:

    Code Block
    $ sudo mkfs.fat --codepage=850 /dev/sdh1
  2. Attach a USB Flash device with a formatted FAT partition to the OTG micro-USB connector of the STM32H7 BSB board.

  3. Power up the board.

  4. From the FreeRTOS CLI, run the usbfatls command and check that the list of the files in the FAT partition is printed to the serial console:

...