Skip to content

Commit 9d4baa9

Browse files
chris-durandsalkinium
authored andcommitted
[stm32] Fix flash page size for large F103, F105 and F107 devices
1 parent 734de07 commit 9d4baa9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/modm/platform/flash/stm32/module.lb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ def build(env):
3737
ftype = "sector"
3838
busy_bit = "FLASH_SR_BSY"
3939
elif target.family in ["f1"]:
40-
block_shift = 10
40+
if target.name in ["05", "07"] or int(flash["size"]) >= 262144:
41+
block_shift = 11
42+
else:
43+
block_shift = 10
4144
ftype = "page"
4245
busy_bit = "FLASH_SR_BSY"
4346
elif target.family in ["g0"]:

0 commit comments

Comments
 (0)