From 5a2cecd0c8b7f89963c2a1b567b916ed00a19075 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 19 Oct 2019 21:45:31 +1100 Subject: [PATCH] HAL_ChibiOS: fixed page size for STM31F105 flash --- libraries/AP_HAL_ChibiOS/hwdef/common/flash.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c b/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c index 02852873e0..9595e5fafe 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c +++ b/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c @@ -112,9 +112,12 @@ static const uint32_t flash_memmap[STM32_FLASH_NPAGES] = { KB(32), KB(32), KB(32 #elif defined(STM32H7) #define STM32_FLASH_NPAGES (BOARD_FLASH_SIZE / 128) #define STM32_FLASH_FIXED_PAGE_SIZE 128 -#elif defined(STM32F1) +#elif defined(STM32F100_MCUCONF) || defined(STM32F103_MCUCONF) #define STM32_FLASH_NPAGES BOARD_FLASH_SIZE #define STM32_FLASH_FIXED_PAGE_SIZE 1 +#elif defined(STM32F105_MCUCONF) +#define STM32_FLASH_NPAGES (BOARD_FLASH_SIZE/2) +#define STM32_FLASH_FIXED_PAGE_SIZE 2 #else #error "Unsupported processor for flash.c" #endif