I have successfully coded write data into a CSV file is an SD card using STM32 CubeMS FATFS SDIO interface 1-bit mode.
But I can't find the file append function in HAL FATFS driver to write data to existing file. Is there another way to do this using STM32CubeMX and HAL drivers?
Best Answer
Exactly as you would on other platforms.
Open the file for append
The
f_open()
function has aFA_OPEN_APPEND
flag, which makes subsequentf_write()
functions to append data at the end of the file.Move the file pointer to the end of the file
If the file can't be opened in append mode (e.g. when existing data must be accessed first), then you can set the file pointer to the length of the file.