From 05b072f8d1a3848763d82386271d7ffa9ea15b52 Mon Sep 17 00:00:00 2001 From: Peter Bigot Date: Tue, 7 Apr 2020 06:13:54 -0500 Subject: [PATCH] fs: littlefs: force alignment for buffers At least one flash driver requires that the source and destination buffers be word-aligned. Annotate the synthesized definitions to make sure this happens. Signed-off-by: Peter Bigot --- include/fs/littlefs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fs/littlefs.h b/include/fs/littlefs.h index ac18e890456..6b864b10102 100644 --- a/include/fs/littlefs.h +++ b/include/fs/littlefs.h @@ -68,8 +68,8 @@ struct fs_littlefs { * @param lookahead_sz see :option:`CONFIG_FS_LITTLEFS_LOOKAHEAD_SIZE` */ #define FS_LITTLEFS_DECLARE_CUSTOM_CONFIG(name, read_sz, prog_sz, cache_sz, lookahead_sz) \ - static u8_t name ## _read_buffer[cache_sz]; \ - static u8_t name ## _prog_buffer[cache_sz]; \ + static u8_t __aligned(4) name ## _read_buffer[cache_sz]; \ + static u8_t __aligned(4) name ## _prog_buffer[cache_sz]; \ static u32_t name ## _lookahead_buffer[(lookahead_sz) / sizeof(u32_t)]; \ static struct fs_littlefs name = { \ .cfg = { \