Skip to content

Commit f200db3

Browse files
committed
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)).
1 parent c7dd95d commit f200db3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

targets/TARGET_STM/TARGET_STM32F4/flash_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static uint32_t GetSector(uint32_t address)
151151
uint32_t sector = 0;
152152
uint32_t tmp = address - ADDR_FLASH_SECTOR_0;
153153
/* This function supports 1Mb and 2Mb flash sizes */
154-
#if defined(FLASH_SECTOR_12)
154+
#if defined(ADDR_FLASH_SECTOR_12)
155155
if (address & 0x100000) { // handle 2nd bank
156156
sector = FLASH_SECTOR_12;
157157
tmp = address - ADDR_FLASH_SECTOR_12;

0 commit comments

Comments
 (0)