summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/flash/stm32x.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c
index 5e1db209..ae5701a2 100644
--- a/src/flash/stm32x.c
+++ b/src/flash/stm32x.c
@@ -670,8 +670,7 @@ int stm32x_probe(struct flash_bank_s *bank)
LOG_INFO( "flash size = %dkbytes", num_pages );
/* calculate numbers of pages */
- if (page_size - 1024)
- num_pages /= (page_size - 1024);
+ num_pages /= (page_size / 1024);
bank->base = 0x08000000;
bank->size = (num_pages * page_size);