summaryrefslogtreecommitdiff
path: root/chip/stm32/flash-stm32g4-l4.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32/flash-stm32g4-l4.c')
-rw-r--r--chip/stm32/flash-stm32g4-l4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/stm32/flash-stm32g4-l4.c b/chip/stm32/flash-stm32g4-l4.c
index 27092a1156..360d63a739 100644
--- a/chip/stm32/flash-stm32g4-l4.c
+++ b/chip/stm32/flash-stm32g4-l4.c
@@ -46,7 +46,7 @@
* CONFIG_WP_STORAGE_SIZE -> size of RO region in bytes
*/
#define FLASH_PAGE_SIZE CONFIG_FLASH_BANK_SIZE
-#define FLASH_PAGE_MAX_COUNT (CONFIG_FLASH_SIZE / FLASH_PAGE_SIZE)
+#define FLASH_PAGE_MAX_COUNT (CONFIG_FLASH_SIZE_BYTES / FLASH_PAGE_SIZE)
#define FLASH_RO_FIRST_PAGE_IDX WP_BANK_OFFSET
#define FLASH_RO_LAST_PAGE_IDX ((CONFIG_WP_STORAGE_SIZE / FLASH_PAGE_SIZE) \
+ FLASH_RO_FIRST_PAGE_IDX - 1)