From 093acc157707cad55067f49936f7f02ac04dd603 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 4 Apr 2022 18:50:34 +1000 Subject: [PATCH] HAL_ChibiOS: use 16 byte lines for flash storage on H7 this halves the number of flash writes needed, and makes flash storage twice as space efficient on H7 On H7 we need to write 32 bytes at a time to flash, which corresponds to 30 bytes of data in AP_FlashStorage. By using a 16 byte storage line we don't waste as much space --- libraries/AP_HAL_ChibiOS/Storage.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_HAL_ChibiOS/Storage.h b/libraries/AP_HAL_ChibiOS/Storage.h index 54577f67ef..beccd623b1 100644 --- a/libraries/AP_HAL_ChibiOS/Storage.h +++ b/libraries/AP_HAL_ChibiOS/Storage.h @@ -30,7 +30,11 @@ // when using flash storage we use a small line size to make storage // compact and minimise the number of erase cycles needed #ifdef STORAGE_FLASH_PAGE +#if defined(STM32H7XX) +#define CH_STORAGE_LINE_SHIFT 4 +#else #define CH_STORAGE_LINE_SHIFT 3 +#endif #elif defined(USE_POSIX) && !defined(HAL_WITH_RAMTRON) #define CH_STORAGE_LINE_SHIFT 9 #else