mirror of https://github.com/ARMmbed/mbed-os.git
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
parent
72587feb64
commit
3efdbc018a
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue