From 9d4baa983399613cafaccafe051e702663115608 Mon Sep 17 00:00:00 2001 From: Christopher Durand Date: Tue, 12 Mar 2024 13:53:59 +0100 Subject: [PATCH] [stm32] Fix flash page size for large F103, F105 and F107 devices --- src/modm/platform/flash/stm32/module.lb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modm/platform/flash/stm32/module.lb b/src/modm/platform/flash/stm32/module.lb index cf2dfa6a3b..8cc3db884e 100644 --- a/src/modm/platform/flash/stm32/module.lb +++ b/src/modm/platform/flash/stm32/module.lb @@ -37,7 +37,10 @@ def build(env): ftype = "sector" busy_bit = "FLASH_SR_BSY" elif target.family in ["f1"]: - block_shift = 10 + if target.name in ["05", "07"] or int(flash["size"]) >= 262144: + block_shift = 11 + else: + block_shift = 10 ftype = "page" busy_bit = "FLASH_SR_BSY" elif target.family in ["g0"]: