Skip to content

Commit 842657a

Browse files
yn386dpgeorge
authored andcommitted
stm32/flash: Change Flash sector size for STM32H7A3.
STM32H7A3 has 2MB internal flash and each sector size is 8KB. Signed-off-by: Yuuki NAGAO <[email protected]>
1 parent 3808ccd commit 842657a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ports/stm32/flash.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,13 @@ static const flash_layout_t flash_layout[] = {
159159

160160
#define FLASH_LAYOUT_IS_HOMOGENEOUS (1)
161161
#define FLASH_LAYOUT_START_ADDR (FLASH_BASE)
162+
#if defined(STM32H7A3xx) || defined(STM32H7A3xxQ)
163+
#define FLASH_LAYOUT_SECTOR_SIZE (0x2000)
164+
#define FLASH_LAYOUT_NUM_SECTORS (256)
165+
#else
162166
#define FLASH_LAYOUT_SECTOR_SIZE (0x20000)
163167
#define FLASH_LAYOUT_NUM_SECTORS (16)
168+
#endif
164169

165170
#else
166171
#error Unsupported processor

0 commit comments

Comments
 (0)