From 416886c723e31d15834a8ff1cdd470011bad42e4 Mon Sep 17 00:00:00 2001 From: Greg Davill Date: Fri, 10 Dec 2021 17:11:08 +1030 Subject: [PATCH] software.fatfs: Align fatfs sector buffers --- litex/soc/software/libfatfs/ff.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litex/soc/software/libfatfs/ff.h b/litex/soc/software/libfatfs/ff.h index 522504164..d9823aa16 100644 --- a/litex/soc/software/libfatfs/ff.h +++ b/litex/soc/software/libfatfs/ff.h @@ -172,7 +172,7 @@ typedef struct { LBA_t bitbase; /* Allocation bitmap base sector */ #endif LBA_t winsect; /* Current sector appearing in the win[] */ - BYTE win[FF_MAX_SS]; /* Disk access window for Directory, FAT (and file data at tiny cfg) */ + BYTE win[FF_MAX_SS] __attribute__ ((aligned (4))); /* Disk access window for Directory, FAT (and file data at tiny cfg) */ } FATFS; @@ -217,7 +217,7 @@ typedef struct { DWORD* cltbl; /* Pointer to the cluster link map table (nulled on open, set by application) */ #endif #if !FF_FS_TINY - BYTE buf[FF_MAX_SS]; /* File private data read/write window */ + BYTE buf[FF_MAX_SS] __attribute__ ((aligned (4))); /* File private data read/write window */ #endif } FIL;