Open khevessy opened 1 year ago
Hello @khevessy,
Thank you for your contribution. You are absolutely right about this point. Actually, the point you raised has already been dealt and fixed internally. The fix will be made available in the frame of a future release.
Thank you again for your contribution. We are looking forward to reading from you again.
With regards,
ST Internal Reference: 133958
I am using FatFS library on STM32H723 MCU with FreeRTOS and DMA. I have encountered the issue mentioned here on the forum. When buffers are not aligned, file access functions like
f_read
returnFR_INT_ERR
as cache coherency operations probably don't work as expected. Turning theENABLE_SCRATCH_BUFFER
andENABLE_SD_DMA_CACHE_MAINTENANCE
defines on in sd_diskio.c template also does not help. I do not know if ST is able to fix those issues in the library, but the fix is simple, changehttps://github.com/STMicroelectronics/stm32_mw_fatfs/blob/5042a94556d1c4477642fc6b09450725d18ab5e8/src/ff.h#L125
to
BYTE win[_MAX_SS] __attribute__((aligned(32)));
and
https://github.com/STMicroelectronics/stm32_mw_fatfs/blob/5042a94556d1c4477642fc6b09450725d18ab5e8/src/ff.h#L170
to
BYTE buf[_MAX_SS] __attribute__((aligned(32)));
.Then the issue goes away completely.