Implementation

TLDR: FATFS middleware will be connected and its functions will be further abstracted to allow use in state machines and central ZP applications.

Reference: https://01001000.xyz/2020-08-09-Tutorial-STM32CubeIDE-SD-card/

Architecture:

In order to link an SD card with our state machine application, FATFS middleware would need to be attached to both ends of the architecture. A user-specified driver included in the reference webpage will be used to attach FATFS to the HAL library.

After implementing the architecture in the webpage, further abstraction can be done when attaching the SD driver to the state machines. Mainly, mounting and dismounting the file system, opening and closing files, reading and writing to files, creating and deleting files, and manipulating directories. These FATFS functions can be abstracted further to enable easier use in the state machines.