From 22f7218acf15ad9c78d6eb36d340c67075dafcb2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 16 Apr 2021 09:13:47 +1000 Subject: [PATCH] HAL_ChibiOS: support 512k F7 parts for flash --- libraries/AP_HAL_ChibiOS/hwdef/common/flash.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c b/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c index e9c1f6f255..5405414712 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c +++ b/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c @@ -103,7 +103,11 @@ static const uint32_t flash_memmap[STM32_FLASH_NPAGES] = { KB(16), KB(16), KB(16 #endif #elif defined(STM32F7) -#if BOARD_FLASH_SIZE == 1024 +#if BOARD_FLASH_SIZE == 512 +#define STM32_FLASH_NPAGES 8 +static const uint32_t flash_memmap[STM32_FLASH_NPAGES] = { KB(16), KB(16), KB(16), KB(16), KB(64), KB(128), KB(128), KB(128) }; + +#elif BOARD_FLASH_SIZE == 1024 #define STM32_FLASH_NPAGES 8 static const uint32_t flash_memmap[STM32_FLASH_NPAGES] = { KB(32), KB(32), KB(32), KB(32), KB(128), KB(256), KB(256), KB(256) };