STM32F4: fix for 2nd back sector

Use ADDR_FLASH_SECTOR_12 as this is defined by target (the flash size varies, for
instance for some F437xx is up to 2MB (2nd bank might not be there)).
pull/4889/head
Martin Kojtal 2017-08-08 09:50:17 +01:00 committed by adbridge
parent 72587feb64
commit 3efdbc018a
1 changed files with 1 additions and 1 deletions

View File

@ -151,7 +151,7 @@ static uint32_t GetSector(uint32_t address)
uint32_t sector = 0;
uint32_t tmp = address - ADDR_FLASH_SECTOR_0;
/* This function supports 1Mb and 2Mb flash sizes */
#if defined(FLASH_SECTOR_12)
#if defined(ADDR_FLASH_SECTOR_12)
if (address & 0x100000) { // handle 2nd bank
sector = FLASH_SECTOR_12;
tmp = address - ADDR_FLASH_SECTOR_12;