Skip to main content
Visitor II
March 9, 2020
Question

Whats the relation between FatFs middleware (ff and the low layer implementation) and sd_diskio?

  • March 9, 2020
  • 1 reply
  • 607 views

To my knowledge, FatFs requires some low layer drivers in orden to work, and those APIs must be provided by the user. In UM1721 is pretty well described: "The FatFs Middleware solution provides low level disk I/O drivers for some supported disk drives (RAMDisk, microSD, USBDisk). An additional interface layer diskio.c has been added to add/remove dynamically physical media to the FatFs module, providing low level disk I/O functions".

However, I've seen some tutorials where sd_diskio and bsp_driver_sd are altered, in order for the application to support DMA transfer. I really dont get how ff functions (f_mount, f_read, etc) and diskio functions (disk_read, disk_write, etc) are related to that BSP layer and that sd_diskio file. Where are those functions called in the low level disk drivers?

    This topic has been closed for replies.

    1 reply

    SPalo.679Author
    Visitor II
    March 9, 2020

    Okey, so literally five minutes after I post this question I finally realized whats the connection lol

    So FATFS_LinkDriver has an Diskio_drvTypeDef argument and thats it.