From 99ea236bc2b0e988a065ee99ff6c583d99a6b02d Mon Sep 17 00:00:00 2001 From: jflyper Date: Sat, 20 Apr 2019 00:40:23 +0900 Subject: [PATCH] Take care of "FLASH_SIZE" constant for stm32h750xx.h in lib --- .../CMSIS/Device/ST/STM32H7xx/Include/stm32h750xx.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/main/STM32H7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h750xx.h b/lib/main/STM32H7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h750xx.h index 2f9e15fbc8..28866ca06d 100755 --- a/lib/main/STM32H7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h750xx.h +++ b/lib/main/STM32H7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h750xx.h @@ -7,7 +7,7 @@ * This file contains: * - Data structures and the address mapping for all peripherals * - Peripheral's registers declarations and bits definition - * - Macros to access peripheral’s registers hardware + * - Macros to access peripheral's registers hardware * ****************************************************************************** * @attention @@ -25787,10 +25787,15 @@ typedef struct */ /****************************** Product define *********************************/ -#define FLASH_SECTOR_SIZE 0x00020000 /* 128 KB */ +// For Betaflight, FLASH_SIZE is defined by make/.mk in units of KB. +// FLASH_SIZE definition is not used elsewhere in the library. +// FLASH_BANK_SIZE is used, so define it as 1M directly. -#define FLASH_SIZE FLASH_SECTOR_SIZE /* 128 KB */ -#define FLASH_BANK_SIZE FLASH_SIZE /* 128 KB */ +#define FLASH_SECTOR_SIZE 0x00020000 /* 128 KB */ +//#define FLASH_SIZE FLASH_SECTOR_SIZE /* 128 KB */ +//#define FLASH_BANK_SIZE FLASH_SIZE /* 128 KB */ + +#define FLASH_BANK_SIZE FLASH_SECTOR_SIZE /* 128KB */ /**