Skip to main content
Ark1
Associate III
October 7, 2018
Question

FATFS API

  • October 7, 2018
  • 9 replies
  • 3289 views

hi, i have the HAL driver for sd card and fatfs software module but i can't understand the mechanisms that both hal and fatfs api's, it's all confused me. stuck here unable to move forward.

@Community member​ 

@Community member​ 

    This topic has been closed for replies.

    9 replies

    Lukasz Przenioslo
    Associate III
    October 7, 2018

    Hi,

    Take a look at the Fatfs application note: http://www.elm-chan.org/fsw/ff/doc/appnote.html

    The Fatfs api provides you with the hight level functionality of the fat system- it doesnt care to what it is writing or reading. HAL API provides you with the low level api, allowing you to write/read data from the SD card controller.

    0690X000006C8kXQAS.png

    Fatfs has an interface that has to be "married" with the HAL interface. The mechanism you are talking about connects the SD card access functions with the Fatfs module (by providing function pointers to disk_read, disk_write etc).

    Ark1
    Ark1Author
    Associate III
    October 7, 2018

    thank you:smiling_face_with_smiling_eyes: @Community member​ 

    Tesla DeLorean
    Guru
    October 7, 2018

    Where is your confusion

    Block Storage Devices

    File Systems (FAT, ISO9660, UDF, ..)

    File Access (stdio)

    File Data (data representation, byte data, structures, etc)

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    AvaTar
    Senior III
    October 8, 2018

    To add to Lukasz's comment:

    The HAL code is used by the higher-level FAT-FS code to physically access the device.

    As user, you only need the FAT-FS API functions, and don't need the respective HAL code directly.

    Andrew Neil
    Super User
    October 8, 2018

    Cross-post: http://www.keil.com/forum/63932/

    As noted, FatFs is an independent 3rd-party product - nothing to do with ST.

    As @Community member​  said, have you looked at the FatFs documentation?

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Ark1
    Ark1Author
    Associate III
    October 9, 2018

    @Andrew Neil​  which is right forum to ask my doubts about FATFS?

    yeah, i did the cross-post because i do want to clear all my doubts.

    Andrew Neil
    Super User
    October 9, 2018

    You still haven't told us what your doubts actually are!

    Clearly, nobody can help you with those doubts when they don't know what they are!

    Have you actually visited the FatFs site? Did you not notice that there is a forum there? Have you studied the FatFs documentation?

    Fatfs must be the most widely-used free Filesystem on small microcontrollers - there are lods of tutorials an examples available on the interwebs.

    How much research have you done?

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Tesla DeLorean
    Guru
    October 9, 2018

    I think "doubts" in this context is a lack of foundational knowledge about computer architecture, interfacing, and the ability to find, study and experiment independently. I'm not from a subservient teacher-student background, often teachers have a limited or tenuous grasp of the topic areas they are covering. Pull supporting documentation, examples and sources, and review in detail, independently. Review end-to-end, some detail will make more sense if you understand the whole, other issues may flag a need to study other topic areas so you have a foundation to make decisions yourself.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Ark1
    Ark1Author
    Associate III
    October 10, 2018

    thanks you:smiling_face_with_smiling_eyes:

    @Community member​