Browse Source

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
apm_2208
Andrew Tridgell 3 years ago
parent
commit
093acc1577
  1. 4
      libraries/AP_HAL_ChibiOS/Storage.h

4
libraries/AP_HAL_ChibiOS/Storage.h

@ -30,7 +30,11 @@ @@ -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

Loading…
Cancel
Save